embed docs edit
This commit is contained in:
parent
f954208cce
commit
b9b96e9417
2 changed files with 8 additions and 3 deletions
|
|
@ -70,7 +70,7 @@ To show different videos based on the screen width, use the `ScrollerVideo` comp
|
||||||
|
|
||||||
## Embeds
|
## Embeds
|
||||||
|
|
||||||
Setting `embedded` will autoplay the entire `ScrollerVideo` component like a video.
|
Setting `embedded` to `true` will turn `ScrollerVideo` into an embeddable version, where the video autoplays when the user scrolls upon it. Optionally, you can control the embed video behaviour by passing `embeddedProps` to control the autoplay `delay`, `threshold` for triggering autoplay, and the `duration` of the video.
|
||||||
|
|
||||||
> 💡**TIP:** Another way to recreate the ScrollerVideo experience for embeds is to record the desktop screen with [Scroll Capture](https://chromewebstore.google.com/detail/scroll-capture/egmhoeaacclmanaimofoooiamhpkimkk?hl=en) while scrolling through the video and use that video instead as an HTML video component.
|
> 💡**TIP:** Another way to recreate the ScrollerVideo experience for embeds is to record the desktop screen with [Scroll Capture](https://chromewebstore.google.com/detail/scroll-capture/egmhoeaacclmanaimofoooiamhpkimkk?hl=en) while scrolling through the video and use that video instead as an HTML video component.
|
||||||
|
|
||||||
|
|
@ -79,11 +79,13 @@ Setting `embedded` will autoplay the entire `ScrollerVideo` component like a vid
|
||||||
```svelte
|
```svelte
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ScrollerVideo } from '@reuters-graphics/graphics-components';
|
import { ScrollerVideo } from '@reuters-graphics/graphics-components';
|
||||||
|
|
||||||
|
let embedded = $state(true); // Set to true to enable embedded mode
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ScrollerVideo
|
<ScrollerVideo
|
||||||
src='my-video.mp4'
|
src='my-video.mp4'
|
||||||
embedded={true}
|
{embedded}
|
||||||
embeddedProps={{
|
embeddedProps={{
|
||||||
delay: 200, // Optional: Delay before autoplay starts. Defaults to 200ms.
|
delay: 200, // Optional: Delay before autoplay starts. Defaults to 200ms.
|
||||||
threshold: 0.5, // Optional: Threshold for triggering the autoplay. Defaults to 0.5.
|
threshold: 0.5, // Optional: Threshold for triggering the autoplay. Defaults to 0.5.
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
import ScrollerVideoForeground from '../ScrollerVideoForeground.svelte';
|
import ScrollerVideoForeground from '../ScrollerVideoForeground.svelte';
|
||||||
import Goldengate from '../videos/goldengate.mp4';
|
import Goldengate from '../videos/goldengate.mp4';
|
||||||
import BodyText from '../../BodyText/BodyText.svelte';
|
import BodyText from '../../BodyText/BodyText.svelte';
|
||||||
|
import Block from '../../Block/Block.svelte';
|
||||||
|
|
||||||
import type { ContainerWidth } from '../../@types/global';
|
import type { ContainerWidth } from '../../@types/global';
|
||||||
|
|
||||||
|
|
@ -46,6 +47,8 @@
|
||||||
const dummyText =
|
const dummyText =
|
||||||
'Reprehenderit hamburger pork bresaola, dolore chuck sirloin landjaeger ham hock tempor meatball alcatra nostrud pork belly. Culpa pork belly doner ea jowl, elit deserunt leberkas cow shoulder ham hock dolore.';
|
'Reprehenderit hamburger pork bresaola, dolore chuck sirloin landjaeger ham hock tempor meatball alcatra nostrud pork belly. Culpa pork belly doner ea jowl, elit deserunt leberkas cow shoulder ham hock dolore.';
|
||||||
const scrollerVideoBlock = content.blocks[0];
|
const scrollerVideoBlock = content.blocks[0];
|
||||||
|
|
||||||
|
let embedded = $state(true);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<BodyText text={dummyText} />
|
<BodyText text={dummyText} />
|
||||||
|
|
@ -59,7 +62,7 @@
|
||||||
src={Goldengate}
|
src={Goldengate}
|
||||||
class="embedded-demo"
|
class="embedded-demo"
|
||||||
showDebugInfo={true}
|
showDebugInfo={true}
|
||||||
embedded={true}
|
{embedded}
|
||||||
embeddedProps={{
|
embeddedProps={{
|
||||||
threshold: 0.5,
|
threshold: 0.5,
|
||||||
duration: 12000,
|
duration: 12000,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue