Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Adding Video Element | Trabajando con Medios y Tablas
Quizzes & Challenges
Quizzes
Challenges
/
HTML Definitivo

bookAdding Video Element

You can embed video files on a web page using the <video> element. Consider the following example:

index.html

index.html

copy

In this example:

  • <video> element contains a <source> element, which specifies the URL and file type of the video file. Commonly supported formats are WebM, MP4, and OGG;
  • controls attribute displays standard playback controls;
  • If the user's browser doesn't support the video element, a fallback message will be displayed.

Commonly used attributes for the HTML video element include:

  • autoplay: starts playing the video file as soon as the page loads;
  • loop: causes the video file to loop continuously;
  • muted: mutes the audio by default;
  • volume: specifies the default volume level for the audio file, ranging from 0.0 (silent) to 1.0 (full volume);
  • poster: specifies the URL of an image to display as the video thumbnail before the video is played;
  • width and height: specifies the width and height of the video player in pixels.

Here's an example demonstrating the usage of all these attributes:

index.html

index.html

copy
Note
Note

Additionally, there are many JavaScript libraries and APIs available that provide additional functionality for playing and manipulating video content on the web.

question mark

Which of the following are valid attributes you can use with the HTML video element?

Select the correct answer

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 6

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you show me the example with all these attributes included?

What does the fallback message look like in practice?

Can you explain more about the `poster` attribute and how to use it?

bookAdding Video Element

Desliza para mostrar el menú

You can embed video files on a web page using the <video> element. Consider the following example:

index.html

index.html

copy

In this example:

  • <video> element contains a <source> element, which specifies the URL and file type of the video file. Commonly supported formats are WebM, MP4, and OGG;
  • controls attribute displays standard playback controls;
  • If the user's browser doesn't support the video element, a fallback message will be displayed.

Commonly used attributes for the HTML video element include:

  • autoplay: starts playing the video file as soon as the page loads;
  • loop: causes the video file to loop continuously;
  • muted: mutes the audio by default;
  • volume: specifies the default volume level for the audio file, ranging from 0.0 (silent) to 1.0 (full volume);
  • poster: specifies the URL of an image to display as the video thumbnail before the video is played;
  • width and height: specifies the width and height of the video player in pixels.

Here's an example demonstrating the usage of all these attributes:

index.html

index.html

copy
Note
Note

Additionally, there are many JavaScript libraries and APIs available that provide additional functionality for playing and manipulating video content on the web.

question mark

Which of the following are valid attributes you can use with the HTML video element?

Select the correct answer

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 4. Capítulo 6
some-alt