Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jPlayer fullscreen while inside IFRAME?

Can jPlayer's fullscreen be made to work while inside an IFRAME tag? As is, the "full screen" is restricted by the size of the iframe.

EDIT:

Here's how I insert jPlayer in an IFRAME:

<div id="movieContainer" >
  <object id="videoTut" name="videoTut" type="text/html" data="/videotutorial/videotut.html">
  </object>
</div>

Where videotut.html contains a full HTML page that contains jPlayer and works if loaded independently. And the object tag is modified using code like document.getElementById('movieContainer').innerHTML = '....

Also see: https://groups.google.com/forum/#!topic/jplayer/IQxIIYhtAnE

(P.S. If you'd like to help me out on a multiple video design for jPlayer, please do so here: jPlayer multi-video demo code?)

like image 956
Xonatron Avatar asked May 16 '12 21:05

Xonatron


1 Answers

put this in iframe

<iframe /* your iframe code */ webkitAllowFullScreen="true" mozallowfullscreen="true" allowFullScreen="true"></iframe>

and add this in js file

$("a.jp-full-screen").on('click', function() {
    var docm, rqst;

    docm = document.documentElement;
    rqst = docm.requestFullScreen || docm.webkitRequestFullScreen || docm.mozRequestFullScreen || docm.msRequestFullScreen;

    if(typeof rqst!="undefined" && rqst){
        rqst.call(docm);
    }
});
$("a.jp-restore-screen").on('click', function() {
    var docm, rqst;

    docm = document;
    rqst = docm.cancelFullScreen|| docm.webkitCancelFullScreen || docm.mozCancelFullScreen || docm.msCancelFullScreen || docm.exitFullscreen;
    if(typeof rqst!="undefined" && rqst){
        rqst.call(docm);
    }
});

i'm not sure if this works with the flash solution

like image 126
Christian David Avatar answered Sep 20 '22 06:09

Christian David