Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autostart video when slide is displayed for the first time does not work? #214

Open
baden32 opened this issue Sep 7, 2017 · 4 comments
Open

Comments

@baden32
Copy link

baden32 commented Sep 7, 2017

I included my video as an iframe from youtube.
I added the following to my sliderPro config:

		reachVideoAction: 'playVideo',
		leaveVideoAction: 'pauseVideo',

Everything is fine as long as the slide containing the video is shown for the 2nd time, video starts to play automatically.

Unfortunately, when the video is displayed for the 1st time (ie. if the video is in the fist slide), the video does not start automatically.

Looks like the 'reachVideoAction' event is not fired?

Am I doing something wrong to get this strange behaviour?
Thanks in advance for your help.
Joël

@baden32 baden32 changed the title Autostart video when slide is displayed for the first time? Sep 7, 2017
@davidghi
Copy link
Member

Hi, Joël. This was a bug in an older version but it was fixed. Are you sure you're using the latest version? I've just tested it locally and it's working as expected.

Cheers

@brosoftsystem
Copy link

I have updated my library with the latest version v1.5.0.

Still autoplay video, not working with YouTube slides.

Thanks

@smurfxx
Copy link

smurfxx commented Mar 26, 2024

I found this issue with mp4 videos, I made a simple example here: https://www.farmarqua.it/testslide.html
If I start the video manually, after a loop it restarts correctly but not the first time.

As you can see form the source code I setted these options:
$( '#my-slider' ).sliderPro({ fade: true, autoplay: true, autoplayDelay: 1000, loop: true, arrows: false, buttons: false, autoplayOnHover: 'none', reachVideoAction: 'playVideo', playVideoAction: 'stopAutoplay', endVideoAction: 'startAutoplay' });

EDIT: I solved using the event "gotoSlide" and chek if the current slide has a video, full code in the above html

@davidghi
Copy link
Member

Also note that Chromium browsers don't allow videos to autoplay unless the video is muted or the user interacts with the page. https://developer.chrome.com/blog/autoplay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants