rcaferati / react-awesome-slider

React content transition slider. Awesome Slider is a 60fps, light weight, performant component that renders an animated set of production ready UI general purpose sliders with fullpage transition support for NextJS and GatsbyJS. 🖥️ 📱
https://fullpage.caferati.me
MIT License
2.94k stars 296 forks source link

Putting Video in slides causes same videos to play #161

Open StokedOnIt opened 3 years ago

StokedOnIt commented 3 years ago

Putting video or other video components, causes the same videos to repeat. The first video plays on the 3rd and that repeats,

trolit commented 3 years ago

Did you check closed issue #102? There is example with adding videos to slider from repo owner. If you view it, launch video on first slide and go to the next one. You will see that it needs 1 more step to stop it by itself (tl;dr on slide with number 8 you will still hear video playing).

Now if you overwrite example with code from snippet 1 (I've added some samples and put the same video from the first slide to third one)

snippet 1 ```js import React from "react"; import AwesomeSlider from "react-awesome-slider"; import "react-awesome-slider/dist/styles.css"; import "./styles.css"; export default function App() { return (

React Awesome Slider

8
42
); } ```

it works as expected if you consider the same videos. It needs 1 more step to pause the video from the first slide but third one contains the same video. Therefore it will still play when moving to it. And if you continue on changing slides, you will note the same rule. If you move from slide(3) to slide(5) video will stop playing since on fifth slide there isnt the same video and one step was made, slide(4).

ps: the same rule applies to moving with bullets


ps2: Update 10.06.2021 - #186 might help