How to bind a button that open jPlayer in fullscren mode -
how bind button open jplayer in fullscren mode ?
i have custom user button in html:
<a onclick="javascript:$('#top_video_player').jplayer('fullscreen');event.preventdefault();" class="button" href="#">open in big screen</a>
but don't work.
i try:
$('#top_video_player').jplayer('option','fullscreen',true)
or
$('#top_video_player').jplayer('option',{fullscreen:true})
also try add class .jp-full-screen button ( tag ) - no effect ):
but failed again - nothing happened
in jplayer initialization bind "enter" button , works - need bind html button:
keybindings: { play: { key: 32, // space fn: function(f) { if(f.status.paused) { f.play(); } else { f.pause(); } } }, fullscreen: { key: 13, // enter fn: function(f) { if(f.status.video || f.options.audiofullscreen) { f._setoption("fullscreen", !f.options.fullscreen); } } } },
thanks in advance.
i have managed using:
$('#top_video').data('jplayer')._setoption('fullscreen', true);
where 'top_video' - jplayer div id
Comments
Post a Comment