Youtube videos continue to play after swiping to a new article

Avatar

Avatar

royh70849153

Avatar

royh70849153

royh70849153

28-01-2016

I've embedded some Youtube videos in some of my content, which seem to work well.  However, when you swipe horizontally, the video does not stop playing and can be heard while reading the next article.

is there something in the API that will tell me when the users are leaving the article so i can fire the js to stop the video?

thank you for your time!

r

View Entire Topic

Avatar

Avatar

jerwarren

Avatar

jerwarren

jerwarren

28-01-2016

One workaround you could do:

Using the gesture API, you can disable all gestures, and listen for the swipe yourself.  Then stop the video, then hand it back to DPS to let the article change happen.

Last time i tried using the gesture api like this for swiping, though, it introduced some weird content refresh behavior.  If you want to try it, you can do it like this:

            adobeDPS.Gesture.disableNavigation();

            $('.content').on('swipe',function() {

               [code to stop the media playing]

                adobeDPS.Gesture.relinquishCurrentGesture();

            });


You'll need to include the gesture api found here: 20150706 Adobe DPS 2015 HTML Gesture API - Examples.zip