diff --git a/docs/docs-components/SandpackExample.js b/docs/docs-components/SandpackExample.js index df6fac1d10..382692eb29 100644 --- a/docs/docs-components/SandpackExample.js +++ b/docs/docs-components/SandpackExample.js @@ -243,11 +243,14 @@ export default function SandpackExample({ import { Box, ColorSchemeProvider } from 'gestalt'; import App from "./App"; + const html = document.querySelector('html'); + html.setAttribute('dir', '${exampleTextDirection}'); + const root = createRoot(document.getElementById("root")); root.render( - + diff --git a/docs/examples/video/autoplayAndErrorDetectionExample.js b/docs/examples/video/autoplayAndErrorDetectionExample.js index 1c86c8ef10..7fab73cce6 100644 --- a/docs/examples/video/autoplayAndErrorDetectionExample.js +++ b/docs/examples/video/autoplayAndErrorDetectionExample.js @@ -4,6 +4,7 @@ import { Box, Video } from 'gestalt'; export default function Example(): Node { const [playing, setPlaying] = useState(false); + const [volume, setVolume] = useState(1); return ( @@ -17,7 +18,9 @@ export default function Example(): Node { onControlsPlay={() => setPlaying(true)} onControlsPause={() => setPlaying(false)} onEnded={() => setPlaying(false)} + onVolumeChange={(e) => setVolume(e.volume)} playing={playing} + volume={volume} loop src="https://v.pinimg.com/videos/mc/expMp4/c8/37/71/c83771d856bc1ee12e2d2f81083df9d4_t1.mp4" /> diff --git a/docs/examples/video/captionsExample.js b/docs/examples/video/captionsExample.js index 7670717208..660b77b568 100644 --- a/docs/examples/video/captionsExample.js +++ b/docs/examples/video/captionsExample.js @@ -4,6 +4,7 @@ import { Box, Video } from 'gestalt'; export default function Example(): Node { const [playing, setPlaying] = useState(false); + const [volume, setVolume] = useState(1); return ( @@ -12,12 +13,14 @@ export default function Example(): Node { aspectRatio={1024 / 435} captions="https://iandevlin.github.io/mdn/video-player-with-captions/subtitles/vtt/sintel-en.vtt" controls - onPlayError={({ error }) => error && setPlaying(false)} + playing={playing} + volume={volume} onPlay={() => setPlaying(true)} + onPlayError={({ error }) => error && setPlaying(false)} onControlsPlay={() => setPlaying(true)} onControlsPause={() => setPlaying(false)} onEnded={() => setPlaying(false)} - playing={playing} + onVolumeChange={(e) => setVolume(e.volume)} loop src="https://iandevlin.github.io/mdn/video-player-with-captions/video/sintel-short.mp4" /> diff --git a/docs/examples/video/controlsExample.js b/docs/examples/video/controlsExample.js index 34694ecd44..cfc441f0cf 100644 --- a/docs/examples/video/controlsExample.js +++ b/docs/examples/video/controlsExample.js @@ -4,6 +4,8 @@ import { Box, Flex, IconButton, Label, Switch, Text, Video } from 'gestalt'; export default function Example(): Node { const [showControls, setShowControls] = useState(false); + const [playing, setPlaying] = useState(false); + const [volume, setVolume] = useState(1); return ( @@ -24,8 +26,14 @@ export default function Example(): Node {