How do I get a video to play automatically, be full-screen, and not display any controls? | XM Community

How do I get a video to play automatically, be full-screen, and not display any controls?

  • 30 January 2020
  • 5 replies
  • 1631 views

I am trying to embed a video, either from Youtube or my files (not sure which one is easier with what I am hoping to do), that plays full-screen and automatically when displayed and does not show any controls. Ideally, I would like the ability to click somewhere on the video to allow it to pause and re-click to start again, but only this feature. I assume I would need a custom code in order to accomplish this (if at all possible), however I am very much a novice when it comes to this. Any suggestions would be appreciated!!

5 replies

Userlevel 7
Badge +22
If you can add video via your file and HTML file attribute you can easily remove controls by not adding control attribute to video tag. Create a toggle functionality button to start or pause the video.

For Play/ Pause:

jQuery('video').trigger('play');
jQuery('video').trigger('pause');

For full screen check here
Badge

Hi! Did you happen to figure out the code to do this? Thank you!

Hi!
I'm trying to figure this out too - I would also like my video to autoplay while having all of the controls disabled.
My original code to embed the video without including any autoplay or invisible divs looks like this:

If anyone could help me out with this, that would be absolutely amazing. I'm very new to coding and have been trying to figure this out for days.

Userlevel 7
Badge +21

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

Badge +1

https://community.qualtrics.com/XMcommunity/discussion/comment/32263#Comment_32263Hi ahmedA,
Thanks for the really simple and understandable coding. I tried the working demo but the video just could not start playing.

Leave a Reply