Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

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

BSMontclair
BSMontclair Montclair NJCommunity Member Qubie ✭

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!!

Tagged:

Answers

  • rondev
    rondev Community Member Wizard ✭✭✭✭✭
    edited January 2020

    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

  • NeoNorth
    NeoNorth Community Member Qubie ✭

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

  • San
    San Ontario, Canada Community Member Qubie ✭

    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:

    <iframe src="https://drive.google.com/file/d/1Byw-3LiJv2lKp3aH3Dz5jgzPO_uubR_X/preview" width="640" height="480"></iframe>

    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.

  • ahmedA
    ahmedA IndiaCommunity Member, XMPN Member Wizard ✭✭✭✭✭

    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