- Posts: 10244
- Thank you received: 3644
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript"> $(document).ready(function(){ var thisQuestion = $('#question{QID}'); function resizePlayer() { var playerWidth = $('#jquery_jplayer_{QID}').width(); var aspectRatio = { 'width': 16, 'height': 9 }; var playerHeight = (playerWidth*aspectRatio.height)/aspectRatio.width; $('#jquery_jplayer_{QID}').css('height', playerHeight+'px'); $('#jquery_jplayer_{QID} img').css('height', playerHeight+'px'); $('#jp_container_{QID} .jp-video-play').css({ 'height': playerHeight+'px', 'margin-top': '-'+playerHeight+'px' }); } $(window).resize(function() { resizePlayer(); }); $('#jquery_jplayer_{QID}').jPlayer({ ready: function () { resizePlayer(); $(this).jPlayer("setMedia", { title: "Big Buck Bunny Trailer", m4v: "https://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v", ogv: "https://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv", poster: "https://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png" }); }, ended: function () { $(this).jPlayer("destroy"); $('#jp_container_{QID}').hide; }, cssSelectorAncestor: "#jp_container_{QID}", swfPath: "{TEMPLATEURL}scripts/jPlayer-2.9.2/dist/jplayer", supplied: "m4v, ogv", useStateClassSkin: true, autoBlur: false, smoothPlayBar: true, keyEnabled: true, remainingDuration: true, toggleDuration: true, size: { 'width': '100%', 'height': 'auto', 'cssClass': 'jp-video-ls' // Custom class for LimeSurvey } }); }); </script>
That new script should replace the jPlayer script you had previously.I did try to add your script below the script for Jplayer in the question source...
It seems there is a bug in the script provided above (as I said, "untested"What way you would prefer to force going to the next question ?
<script type="text/html"> $(document).ready(function(){ var thisQuestion = $('#question{QID}'); function resizePlayer() { var playerWidth = $('#jquery_jplayer_{QID}').width(); var aspectRatio = { 'width': 16, 'height': 9 }; var playerHeight = (playerWidth*aspectRatio.height)/aspectRatio.width; $('#jquery_jplayer_{QID}').css('height', playerHeight+'px'); $('#jquery_jplayer_{QID} img').css('height', playerHeight+'px'); $('#jp_container_{QID} .jp-video-play').css({ 'height': playerHeight+'px', 'margin-top': '-'+playerHeight+'px' }); } $(window).resize(function() { resizePlayer(); }); $('#jquery_jplayer_{QID}').jPlayer({ ready: function () { resizePlayer(); $(this).jPlayer("setMedia", { title: "Big Buck Bunny Trailer", m4v: "https://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v", ogv: "https://www.jplayer.org/video/ogv/Big_Buck_Bunny_Trailer.ogv", poster: "https://www.jplayer.org/video/poster/Big_Buck_Bunny_Trailer_480x270.png" }); }, ended: function () { $('#jp_container_{QID}').fadeOut(300, function(e) { $('#jquery_jplayer_{QID}').jPlayer("destroy"); }); $('#movenextbtn, #movesubmitbtn').trigger('click'); }, cssSelectorAncestor: "#jp_container_{QID}", swfPath: "{TEMPLATEURL}scripts/jPlayer-2.9.2/dist/jplayer", supplied: "m4v, ogv", useStateClassSkin: true, autoBlur: false, smoothPlayBar: true, keyEnabled: true, remainingDuration: true, toggleDuration: true, size: { 'width': '100%', 'height': 'auto', 'cssClass': 'jp-video-ls' // Custom class for LimeSurvey } }); }); </script>
Remove this from the player HTML source.and how to disable the "wide screen" button on the player ?
<button class="jp-full-screen" role="button" tabindex="0">full screen</button>
The player appearance is controlled by styles in the assigned skin. In LS 2.6x, the skin is defined by including the appropriate CSS file in config.xml like this:Could you indicate me also how to change the skin color of the Player
<css> <filename>css/jquery-ui-custom.css</filename> <filename>css/bootstrap-slider.css</filename> <filename>css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css</filename> <filename>css/flat_and_modern.css</filename> <filename>css/template.css</filename> <filename>scripts/jPlayer-2.9.2/dist/skin/blue.monday/css/jplayer.blue.monday.css</filename> </css>
<css> <filename>css/jquery-ui-custom.css</filename> <filename>css/bootstrap-slider.css</filename> <filename>css/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css</filename> <filename>css/flat_and_modern.css</filename> <filename>css/template.css</filename> <filename>scripts/jPlayer-2.9.2/dist/skin/pink.flag/css/jplayer.pink.flag.css</filename> </css>