Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fixes Vide.js videos not autoplaying on Safari
/**
* @link https://github.com/vodkabears/Vide/issues/206
*/
function cameronjoneswebAutoPlayVideo( video ) {
if ( video.readyState === 4 ) {
video.play();
} else {
setTimeout( cameronjoneswebAutoPlayVideo, 100, video );
}
}
jQuery( document ).ready( function () {
video = jQuery( '#my-video-selector' ).data( 'vide' ).getVideoObject();
cameronjoneswebAutoPlayVideo( video );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.