Highlighted

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

New Here ,
Feb 28, 2020

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by BenPleysier | Adobe Community Professional

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/

Topics

Code, How to

Views

691

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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

New Here ,
Feb 28, 2020

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by BenPleysier | Adobe Community Professional

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/

Topics

Code, How to

Views

692

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Feb 28, 2020

Copy link to clipboard

Copied

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? 

 

Nancy O'Shea, ACP
Alt-Web.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Feb 28, 2020

Copy link to clipboard

Copied

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/


Ben

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Feb 28, 2020

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
New Here ,
Feb 28, 2020

Copy link to clipboard

Copied

Ok so I have an mp4 video file in my site folder that i have made and i want it in this code on dreamweaver html. What would i type to replace the youtube files that are in here? 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Feb 28, 2020

Copy link to clipboard

Copied

You could try using javascripts setTimeout() and hide the videos container after a set time (obviously set the time to the length of the video, or  a bit longer), example here .

 

 


Paul-M, ACP - www.webspectrum.co.uk

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Adobe Community Professional ,
Feb 29, 2020

Copy link to clipboard

Copied

"What would i type to replace the youtube files that are in here? "

This is not an endorsement of what you're trying to do.  I think it's bad from a usability standpoint.  But to answer your last question, upload your MP4 video to YouTube and use the YouTube API that Ben posted. 

 

Nancy O'Shea, ACP
Alt-Web.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Paul-M LATEST
Adobe Community Professional ,
Mar 01, 2020

Copy link to clipboard

Copied

Youd could used 'ened' to detect when video is finished, see here

 


Paul-M, ACP - www.webspectrum.co.uk

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
LEGEND ,
Feb 29, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...