How to properly add a video to a page. HTML5 example open

How to properly add a video to a page. HTML5 example

Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators

Use the tag video to properly add videos to your page
source type=”video/webm” src=”videos/video.webm” – link to your video in a modern webm format that is more optimized for the web. You can convert your mp4 by following the link – https://convertio.co/mp4-webm/

source type=”video/mp4″ src=”videos/video.mp4″ – added for browsers that do not support webm
 <video poster="img/video-image.jpg" controls preload="metadata">
	<source type="video/webm" src="videos/video.webm">
	<source type="video/mp4" src="videos/video.mp4">
</video>

More about tags

src – specifies the path to the video being played.

width – Specifies the width of the area for video playback.

height – Sets the height of the area for playing the video.

muted – Turns off audio.

autoplay – Video starts playing automatically after the page is loaded.

controls – adds a control panel to the video.

loop – repeats video playback from the beginning after it ends.

poster – Specifies the address of the image to be displayed,
until the video is available or playing.

preload – Used to download video along with web page download.

– none: Specifies that the video should not be preloaded.
– metadata: specifies that video metadata is preloaded
(for example, length).
– auto: indicates that the entire video file can be downloaded,
even if the user should not use it.
– empty string: synonymous with auto.

0

More

Leave a Reply

Your email address will not be published. Required fields are marked *

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*