Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b17172f

Browse files
committed
fix(client): stop video when slides are changed
1 parent b7daa03 commit b17172f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/client/assets/style/tags.css

+4
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,7 @@ tbody {
180180
}
181181
}
182182
}
183+
184+
video {
185+
outline: none;
186+
}

packages/client/src/components/SlideCore.js

+7
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ export const SlideCore = (props) => {
8787
}
8888
: {}),
8989
}}
90+
onSlideChange={(e) => {
91+
const videos = e.slides[e.previousIndex].querySelectorAll('video');
92+
93+
if (videos.length) {
94+
videos.forEach((el) => el.pause());
95+
}
96+
}}
9097
{...props}
9198
>
9299
{slides.map(({ slide: Slide, fusumaProps: { classes, sectionTitle, background } }, i) => (

0 commit comments

Comments
 (0)