Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you trigger fullscreen with mediaelement.js?

I'd like to trigger full screen when a MediaElement video is played.

$('video').on("play", function () {
     //fullscreen mode
});

Any ideas? thanks!

like image 582
Andrew Gale Avatar asked Oct 06 '22 18:10

Andrew Gale


1 Answers

Make sure you have jquery version 1.7 or later to use the on function. Then this should work:

player = new MediaElementPlayer('video');
$('video').on("play", function() {
    player.enterFullScreen();
});
like image 97
ifthiselsethat Avatar answered Oct 11 '22 00:10

ifthiselsethat