Mastering the Media: Complete HTML Course
Sobre a Aula

Loop on YouTube

The loop feature on YouTube allows a video to be played continuously, automatically restarting as soon as it reaches the end.

This can be useful in various situations, such as playing music at a party, creating constant visual presentations, or providing an uninterrupted viewing experience.

5.6.1 How to Activate Loop

To activate the loop on a YouTube video embedded on a web page, simply add the parameter “loop=1” to the video’s URL. This parameter signals to YouTube that the video should be played continuously.

<iframe width="420" height="315"
src="https://www.youtube.com/embed/tgbNymZ7vqY?playlist=tgbNymZ7vqY&loop=1">
</iframe>

5.6.2 Loop Parameters

  • Value 0 (Default): In this case, the video will be played only once, following the default behavior.
  • Value 1: If the parameter is set to 1, the video will enter an infinite loop mode, restarting automatically after reaching the end.

5.6.3 Versatility of Use

The loop is a versatile feature that can be applied in various situations, from music videos that users want to listen to repeatedly to visual presentations that need to be displayed continuously.

5.6.4 Note on Browsers

It is important to mention that some browsers may have restricted policies regarding automatic playback, including loops.

In these cases, user experience may vary, and it is always advisable to check the specific policies of each browser.

Entrar na conversa
Rolar para cima