Skip to main content
Feb 28, 2020 8:30 PM UTC
Answered

can you make an mp4 video on page disappear after it autoplays?

I was trying to look up a code but could'nt find out how to do this if it's even possible.

This topic is closed to new replies. Start a new post to keep the conversation going.
BenPleysier
BenPleysierCorrect answer
Community Expert
Feb 28, 2020 9:24 PM UTC

I totally agree with Nancy's answer, if I come across a website that plays a video automatically, then I will never return.

 

But to answer your question, the video can be hidden using intricate JavaScript code as shown here: https://memberfix.rocks/hide-youtube-video/

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!

8 replies

Legend
Feb 29, 2020 1:01 PM UTC

If you really need to do this then its best to check if the video has finished then hide it or remove it. I think that can be accomplished using some javascript.

 

Personally l wouldnt try to time how long the video plays for and then hide/remove it because there is a possibility of lagging which will result in the video being removed before it finishes

Translate
BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
Feb 28, 2020 9:24 PM UTC

I totally agree with Nancy's answer, if I come across a website that plays a video automatically, then I will never return.

 

But to answer your question, the video can be hidden using intricate JavaScript code as shown here: https://memberfix.rocks/hide-youtube-video/

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Feb 29, 2020 2:47 AM UTC

Oh awesome thanks for the link but the reason I'm asking is because I want it to play the video on a demo site I'm creating and the video is gonna play ounce then load the site, kinda like an intro animation. 

Translate
Nancy OShea
Community Expert
Community Expert
Feb 28, 2020 9:18 PM UTC

1.  Autoplay does not work on all devices and web browsers especially if it contains audio. 

 

2. Autoplay is widely regarded as intrusive and annoying. For this reason, many people block autoplay in their browser settings.

 

3. The use of Autoplay is not recommended.  Don't rely on it to start playback.  See the specs below.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/autoplay

 

4. If you make the video disappear, how will users access it again? 

 

Translate
Nancy O'Shea— Product User & Community Expert