I am trying to embed a video that will play a video once automatically (autoplay) and with no controls visible to the user.
Ideally there is no pause function. There cannot be a replay (loop) function either, as each participant should see the video only once.
I tried embedding the video using iframe and adding in controls=0 and loop=0 and autoplay=1. This hides the controls except for the replay (which is a problem), but the video will not autoplay unless I refresh the frame.
Without IFrame: <div class="embed-responsive embed-responsive-16by9">
<video autoplay="autoplay" id="myvideo"><source src="http(s)/myServer.com/myFolder/myVideo.mp4" type="video/mp4" /> browser does not support this</video>
</div>
And with a little snippet you may
hide the "next" button till the end of the video: <script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Hide the "Next" button
$('#ls-button-submit').hide();
var vid = document.getElementById("myvideo");
vid.volume = 0.3;
vid.onended = function() {
// Show the "Next" button
$('#ls-button-submit').show();
}
});
</script>
or proceed to the next page at the end of the video: <script type="text/javascript" charset="utf-8">
$(document).ready(function() {
// Hide the "Next" button
$('#ls-button-submit').hide();
var vid = document.getElementById("myvideo");
vid.volume = 0.3;
vid.onended = function() {
// Show the "Next" button
$('#ls-button-submit').trigger('click');
}
});
</script>
By the way: You see the line vid.volume = 0.3;
If there are no controls you may set the volume of the video.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless