woocommerce / FlexSlider

An awesome, fully responsive jQuery slider plugin
http://www.woocommerce.com/flexslider/
GNU General Public License v2.0
4.91k stars 1.69k forks source link

playing same video in different tab causing the issue. #1764

Closed kundanrock closed 2 months ago

kundanrock commented 5 years ago

Hi Contributors,

I was facing an issue when I play a video in flexslider and change the video and come back to the tab the video is playing in the background and the slider is rotating in the foreground.

I have implemented before method and issue got resolved (Thanks for exposing before method).

Now I am facing a weird problem, when I am playing the same video in two different tabs then it is not working. For 2nd tab, the before events doesn't get triggered.

My code:

// Added before event to flex slider to resolve video issue. before: function(slider){ slider.animateSlides = function (){ var focused ='true'; if($( "li" ).hasClass( "slide-video-open" )) { focused = ''; } if(slider.animate && focused) { slider.flexAnimate(slider.getTarget("next"), true); } }; }

Please help me on this.