How to autoplay videos and prevent video controls? | XM Community
Skip to main content

Hi!
I am trying to prevent my participants from being able to rewatch or pause the videos I’m using in my Qualtrics study. Based on previous questions, it seems like the only way to do this is to create an invisible cover overtop of the video to prevent participants from clicking the controls and just letting the video autoplay. I have tried to copy and paste codes from past discussions but the autoplay function hasn’t been working for any of them. The invisible div seems to work though. I’ve been scouring a lot of discussion pages and trying lots of other people’s codes with no success for days 😞 For example, I consulted this discussion - https://www.qualtrics.com/community/discussion/8715/allow-user-to-start-video-but-not-pause-it - and tried to use the custom code there but I don’t think I embedded my video properly in their code (I’m very new to coding)
If anyone could help me come up with the code in which the div AND autoplay will work, I would greatly appreciate it!!
Here is the embedding code for one of the videos I’m using (without any modifications):


Can you try uploading the video to YouTube, then you can use all the control parameters.
Don't know if Google Drive has the same functionality.


I don't know about Google Drive, but it should be the same as for YouTube.
You need to do two things:
1. Add autoplay to your YouTube.com URL. Copy the entire URL and this at the end. The "&controls=0" hides the controls, but people can still click on the video to pause it.
?autoplay=1&controls=0
2. Next you'll need to use JS to disable clicks on your question.
document.getElementById(this.questionId).style.pointerEvents = "none";
Here's a working demo: https://iima.au1.qualtrics.com/jfe/form/SV_a59xW4WRdTsd4vH

The limitation is that it won't work for people who have disabled autoplay through the browser. After setting it up, the video would autoplay on my Edge, but not FF. It took me half an hour to figure out the reason.


Leave a Reply