Reputation: 309
I am using Fullpage.js and my first slide has a youtube video that autoplays using youtube embedded api. When I scroll to the next slide I have noticed that the video stops playing, I would like it to continue.
I am trying to check if the body has the class "fp-viewing-home" which is generated by fullpage.js when the first slide is active. Then if body has class play video.
var body = document.getElementsByTagName("body")[0];
var homeSlide = document.getElementsByClassName("fp-viewing-home")[0];
function hasClass(body, homeSlide) {
event.target.playVideo();
}
I would like if the first slide in displaying the video to continue to play, else pause video
Upvotes: 0
Views: 330
Reputation: 41595
According to fullpage.js documentation:
Pause on leave Embedded HTML5 / and Youtube iframes are automatically paused when you navigate away from a section or slide. This can be disabled by using the attribute data-keepplaying. For example:
<audio data-keepplaying>
<source src="http://metakoncept.hr/horse.ogg" type="audio/ogg">
</audio>
Upvotes: 1