- Posts: 40
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
To Hide Next Button Until Video Is watched
- mnelson
- Topic Author
- Offline
- Senior Member
Less
More
3 years 5 months ago #207280
by mnelson
To Hide Next Button Until Video Is watched was created by mnelson
Hi,
Is it possible to hide the next button the question that Im displaying the video until the video is watched then the button is active.
Lime Version 3.24.2
Is it possible to hide the next button the question that Im displaying the video until the video is watched then the button is active.
Lime Version 3.24.2
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12779
- Thank you received: 3940
3 years 5 months ago #207282
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic To Hide Next Button Until Video Is watched
Use this:
If you don't want to proceed after the video change the last line to
$('#ls-button-submit').show();
Joffm
Code:
<div class="embed-responsive embed-responsive-16by9"> <video autoplay="autoplay" id="myvideo"><source src="path_to_video.mp4" type="video/mp4" /> Browser does not support this format.</video> </div> <script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Hide the "Next" button $('#ls-button-submit').hide(); var vid = document.getElementById("myvideo"); // Set a volume if necessary vid.volume = 0.3; // When video is watched show the NEXT-button and proceed to the next question vid.onended = function() { // Show the "Next" button $('#ls-button-submit').show().trigger('click'); } }); </script>
If you don't want to proceed after the video change the last line to
$('#ls-button-submit').show();
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- mnelson
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 40
- Thank you received: 1
3 years 5 months ago - 3 years 5 months ago #207295
by mnelson
<p> </p>
Replied by mnelson on topic To Hide Next Button Until Video Is watched
Thanks for this, I was using a video from YouTube and im finding it a bit hard to integrate it in the below:
<div class="videodetector"><iframe frameborder="0" src="https://www.youtube.com?autohide=1&controls=1&showinfo=0">
<div class="videodetector"><iframe frameborder="0" src="https://www.youtube.com?autohide=1&controls=1&showinfo=0">
<p> </p>
Last edit: 3 years 5 months ago by mnelson.
The topic has been locked.
- tpartner
- Online
- LimeSurvey Community Team
Less
More
- Posts: 10630
- Thank you received: 3696
3 years 5 months ago #207296
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic To Hide Next Button Until Video Is watched
You will need to use the YouTube iframe API -
developers.google.com/youtube/iframe_api_reference
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.