javascript events - HTML5 Detect Entering Fullscreen -
i cannot seem figure out how bring element fullscreen mode upon video entering fullscreen mode. tried looking through various materials available still answer eludes me. have far:
document.getelementbyid("videoid").addeventlistener("mozfullscreenchange", function () { document.getelementbyid("imageid").mozrequestfullscreen(); }, false);
the code firefox assume other browsers have similar behavior prefix have switched "moz" "webkit".
thank help.
as said in comments, there can't 2 fullscreen elements @ once. code should work:
document.getelementbyid("videoid").addeventlistener("mozfullscreenchange", function () { if(document.mozfullscreen){ document.mozcancelfullscreen(); document.getelementbyid("imageid").mozrequestfullscreen(); } }, false);
Comments
Post a Comment