bqworks / slider-pro

A modular, responsive and touch-enabled jQuery slider plugin that enables you to create elegant and professionally looking sliders.
MIT License
877 stars 390 forks source link

Video is paused until transition completes #243

Closed Murphy1976 closed 3 years ago

Murphy1976 commented 6 years ago

If I have a video in a slide, and I transition to that slide, the video will stay at frame 1 until the transition is complete until is finally plays the video. Is there a way to have the video start playing when the transition is triggered, instead of completed?

My init already contains the following settings: reachVideoAction: 'playVideo', leaveVideoAction: 'stopVideo', endVideoAction: 'replayVideo'

I am using version 1.4.0

davidghi commented 6 years ago

Hi. By default, the video will start playing, if set, when the gotoSlideComplete event is fired. There isn't an option to modify this behaviour, but it's possible remove the event handler from that event and attach it to the gotoSlide event, which is fired as soon as the slide is requested:

var slider = $( '#my-slider' ).data('sliderPro');
$( '#my-slider' ).off( 'gotoSlideComplete.Video.SliderPro' );
$( '#my-slider' ).on( 'gotoSlide.Video.SliderPro', $.proxy( slider._videoOnGotoSlideComplete, slider ); 

Cheers!