when displaying videos, is there a way to move forward immediately after each video? | XM Community
Skip to main content
Solved

when displaying videos, is there a way to move forward immediately after each video?

  • August 13, 2018
  • 6 replies
  • 865 views

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

Best answer by Anonymous

Hello @Alex_GP , Please see this post

6 replies

  • 0 replies
  • Answer
  • August 13, 2018
Hello @Alex_GP , Please see this post

  • 0 replies
  • August 13, 2018
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 !

  • 1 reply
  • September 4, 2018
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();

sankeshkumar
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 16 replies
  • September 4, 2018
> @Shashi said: > Hello @Alex_GP , > > Please see this post Hello @Alex_GP , You can use this Post ,if you are embedding your Youtube videos

sankeshkumar
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 16 replies
  • September 4, 2018
> @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.

  • 1 reply
  • June 19, 2020

@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?