Autoplaying


show more Autoplaying provides you with in-depth training on Video. Taught by Steve Heffernan as part of the HTML5: Video and Audio in Depth show less
please wait ...

Autoplaying

Another option we have is to autoplay the video or audio, which means it will play automatically once the page loads without any interaction from the user. This can be useful in cases where you know your user will watch the video first. Think of a YouTube video being played back on the YouTube site. When you go to the video's page the video starts playing automatically because you're obviously there to watch that video. So it doesn't make sense to make you click play to start it. So to add autoplay, first let's go back our code and we're now in the 2-04 folder of the exercise files.

To add it, we just add the autoplay attribute. It's not a Boolean attribute, so it's just true or dalse and we just include it to turn it on or exclude it to turn it off, and we can save that, and jump back to our web browser and reload it. (Music playing) See that the video starts playing automatically. That was easy. Let's go back, and do the audio just to make sure that works a...

Autoplaying
Video duration: 2m 2s 2h 7m Intermediate

Viewers:

Autoplaying provides you with in-depth training on Video. Taught by Steve Heffernan as part of the HTML5: Video and Audio in Depth

Subjects:
Video Web
Software:
HTML
Author:
please wait ...