Home › Forums › JavaScript › Anythingslider html 5 video autoplay › Reply To: Anythingslider html 5 video autoplay
August 31, 2016 at 12:33 pm
#245069
vernominon
Participant
Just in case the following issue isn’t just a problem elsewhere with my page, I found that with autoPlay set to true the script produced an “undefined” error with the isVideoPlaying part. Wrapping it up with a check to see if slider is defined fixed it. Probably not the most elegant fix but it all works now.
function(slider) {
if (typeof slider !==’undefined’) {
var vid = slider.$currentPage.find(‘video’);
return (vid.length && typeof(vid[0].pause) !== ‘undefined’ && !vid[0].paused && !vid[0].ended);
}
}