Search code examples
jqueryhtmlvideoplaybackmediaelement.js

chrome issue - jquery play() control


Ok,

I am using medialement.js to play and control a video. The purpose is very simple. I play the video once I click over the cover image of the video. It works fine in Firefox, in IE I still have to allow it or something but in Chrome the video turns invisible after clicking over the cover.

$("document").ready(function() {

    $("video").click(function() {

    player2.play();
    $("nav").delay(4500).fadeIn(3000);

    });

});

an online sample can be found at evo.lopezi.com


Solution

  • It's a bug in chrome, you can make it appear by clicking. Try adjusting the video element, by doing something like this before playing (or changing its opacity):

    $('#player2').attr('controls', true);
    $('#player2').attr('controls', false);
    player2.play();