Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Anythingslider html 5 video autoplay Reply To: Anythingslider html 5 video autoplay

#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);
}
}