HTML Embedding Videos


The <video> tag allows web developers to insert video content directly into web pages. The tag supports playing various video formats and includes playback options such as play, pause, volume adjustment and fullscreen mode. </video>

Syntax

<video src="video.mp4" controls></video>  

html-video


Example

<video controls>
  <source src="video.mp4" type="video/mp4">
  <source src="video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video> 

Attributes of <video>

Attribute Description
src Path to the video file
controls Shows default video controls (play, pause, volume, etc.)
autoplay Starts playing automatically (⚠️ may be blocked by browsers)
loop Repeats the video when it ends
muted Starts the video with sound off
poster Specifies an image to show before the video plays
width Sets the width of the video player
height Sets the height of the video player
preload Controls video loading behavior (auto, metadata, none)

Embedding YouTube Video

Use an <iframe> to embed a video from platforms like YouTube:

 

<iframe width="560" height="315" 
  src="https://www.youtube.com/embed/VIDEO_ID" 
  frameborder="0" 
  allowfullscreen>
</iframe> 



OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.