Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
- August 10, 2020 at 7:54 pm #25765Jeffrey MillerGuest
How do I get a video that is embedded in a page to autostart and auto-repeat? Thank you.
August 10, 2020 at 8:07 pm #25795Jesse OwensKeymasterHi Jeffrey-
The answer to this is going to depend on the video hosting service. If you’re using YouTube, you can use the iFrame Player API to specify a couple of parameters.On YouTube, navigate to the video you’d like to embed, click on Share, then click Embed, then click Copy to get the embed code. By default, it will look something like this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Now, add a few arguments to the src= section at the end of the URL. To autoplay, add ?autoplay=1 . To loop, add &loop=1&playlist=dQw4w9WgXcQ . The “playlist” attribute is the same as the video ID of the video (the last part of the video URL). So the final code looks like this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&loop=1&playlist=dQw4w9WgXcQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The topic ‘Video – auto start’ is closed to new replies.