diff --git a/components/video/index.js b/components/video/index.js new file mode 100644 index 00000000..caa5bfcd --- /dev/null +++ b/components/video/index.js @@ -0,0 +1,2 @@ +export { Video } from './video'; +export { VideoControl } from './video-control'; diff --git a/components/video/readme.md b/components/video/readme.md new file mode 100644 index 00000000..8540b4d1 --- /dev/null +++ b/components/video/readme.md @@ -0,0 +1,122 @@ +# Video + +The Video component allows you to easily add videos to your custom blocks without needing to manually worry about loading states etc. It renders a `` component in place of the video if the id is not set and shows a spinner when the video is still loading. + +## Usage + +```js +import { Video } from '@10up/block-components'; + +function BlockEdit(props) { + const { attributes, setAttributes } = props; + const { videoId } = attributes; + + function handlevideoSelect( video ) { + setAttributes({videoId: video.id}); + } + + return ( +