- Posts: 10285
- Thank you received: 3649
Ask the community, share ideas, and connect with other LimeSurvey users!
Yep, looking forward to it and other 3.x features.In LS3, it will be very easy for you to share those workarounds as new "question template"
If working on a locale machine, you should simply be able to extract those files from the zipped template download and copy them to the appropriate locations.I noticed errors during importation of the template :
<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>