Hi all,
I am showing some videos from youtube to my participants though a survey using the Merge & Loop option. Importantly, each video has a different duration.
After each video I would like to display immediately a multiple choice question. However, to move automatically forward.. the timing option only allows to choose one specific time (i.e., auto-advance). Is there a way to customise this? Otherwise, sometimes my participants have to wait long for the multiple choice whereas other times they videos are cut without finishing..
any thoughts, code, and so on are more than welcome!
thanks in advance.
best wishes,
Alex
Page 1 / 1
Hello @Alex_GP ,
If your video is not embedded from youtube then just paste the following code in the js(on ready) of question:
var video = jQuery("#vidid");
var preview = false;
if(/^\\/jfe[0-9]?\\/preview/.test(window.location.pathname)) preview = true;
if(preview) {
if(jQuery('.MobilePreviewFrame:first').length > 0) {
var vidEl = video.get(0);
vidEl.muted = true;
vidEl.width = "300";
}
}
$('NextButton').hide();
video.on('ended', function(event) {
$('NextButton').click();
});
Note: var video = jQuery("#vidid"); // vidid is the id of video tag
You question will be something like this in html
!
If your video is not embedded from youtube then just paste the following code in the js(on ready) of question:
var video = jQuery("#vidid");
var preview = false;
if(/^\\/jfe[0-9]?\\/preview/.test(window.location.pathname)) preview = true;
if(preview) {
if(jQuery('.MobilePreviewFrame:first').length > 0) {
var vidEl = video.get(0);
vidEl.muted = true;
vidEl.width = "300";
}
}
$('NextButton').hide();
video.on('ended', function(event) {
$('NextButton').click();
});
Note: var video = jQuery("#vidid"); // vidid is the id of video tag
You question will be something like this in html
!
Hi Shashi,
I have tried putting your code in but I kept getting the message about "unexpected identifier". Would you happen to know where have I gone wrong?
Thanks.
This is what I have done:
var video = jQuery("#vidid");//<video id="vidid" controls="controls" autoplay="autoplay" height="500" src="https://www.youtube.com/embed/YLYIVOcsH2U?rel=0&XXX;autoplay=1" width="889"></iframe>
var preview = false;
if(/^\\/jfe[0-9]?\\/preview/.test(window.location.pathname)) preview = true;
if(preview) {
if(jQuery('.MobilePreviewFrame:first').length > 0) {
var vidEl = video.get(0);
vidEl.muted = true;
vidEl.width = "300";
}
}
$('NextButton').hide();
video.on('ended', function(event)
$('NextButton').click();
I have tried putting your code in but I kept getting the message about "unexpected identifier". Would you happen to know where have I gone wrong?
Thanks.
This is what I have done:
var video = jQuery("#vidid");//<video id="vidid" controls="controls" autoplay="autoplay" height="500" src="https://www.youtube.com/embed/YLYIVOcsH2U?rel=0&XXX;autoplay=1" width="889"></iframe>
var preview = false;
if(/^\\/jfe[0-9]?\\/preview/.test(window.location.pathname)) preview = true;
if(preview) {
if(jQuery('.MobilePreviewFrame:first').length > 0) {
var vidEl = video.get(0);
vidEl.muted = true;
vidEl.width = "300";
}
}
$('NextButton').hide();
video.on('ended', function(event)
$('NextButton').click();
> @Shashi said:
> Hello @Alex_GP ,
>
> Please see this post
Hello @Alex_GP , You can use this Post ,if you are embedding your Youtube videos
> Hello @Alex_GP ,
>
> Please see this post
Hello @Alex_GP , You can use this Post ,if you are embedding your Youtube videos
> @Shashi said:
> Hello @Alex_GP ,
>
> If your video is not embedded from youtube then just paste the following code in the js(on ready) of question:
>
> var video = jQuery("#vidid");
> var preview = false;
> if(/^\\/jfe[0-9]?\\/preview/.test(window.location.pathname)) preview = true;
>
> if(preview) {
> if(jQuery('.MobilePreviewFrame:first').length > 0) {
> var vidEl = video.get(0);
> vidEl.muted = true;
> vidEl.width = "300";
> }
> }
>
> $('NextButton').hide();
> video.on('ended', function(event) {
>
>
> $('NextButton').click();
>
> });
>
> Note: var video = jQuery("#vidid"); // vidid is the id of video tag
>
> You question will be something like this in html
> !
>
>
>
Hello @Alex_GP , You can go with this post if your video is uploaded in qualtrics library or video is hosted somewhere else.
> Hello @Alex_GP ,
>
> If your video is not embedded from youtube then just paste the following code in the js(on ready) of question:
>
> var video = jQuery("#vidid");
> var preview = false;
> if(/^\\/jfe[0-9]?\\/preview/.test(window.location.pathname)) preview = true;
>
> if(preview) {
> if(jQuery('.MobilePreviewFrame:first').length > 0) {
> var vidEl = video.get(0);
> vidEl.muted = true;
> vidEl.width = "300";
> }
> }
>
> $('NextButton').hide();
> video.on('ended', function(event) {
>
>
> $('NextButton').click();
>
> });
>
> Note: var video = jQuery("#vidid"); // vidid is the id of video tag
>
> You question will be something like this in html
> !
>
>
>
Hello @Alex_GP , You can go with this post if your video is uploaded in qualtrics library or video is hosted somewhere else.
@sankeshkumar
I'm trying to use this code, and am successfully getting the next button to hide, but button doesn't get clicked (no advance) when the video ends. Is this code outdated, or do you have any advice?
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.