I'm currently using:
<iframe class="video" src="https://www.youtube.com/embed/VIDEO_ID?loop=1&playlist=VIDEO_ID" frameborder="0" allowfullscreen></iframe>
in order to include a YouTube video in a web page and get it loop automatically.
The problem is that each time the video ends, it reloads in order to start again. This behaviour is annoying and also a waste of bandwidth.
Is there any way to make it auto-replay without refresh ? Something like setting the video to 00:00 when it reaches the end, instead of reloading it.
I have the same issue, so I researched a solution to embed a YouTube video using an iFrame (recommended by YT) which is set to loop without that annoying refresh state.
Seems that loading the video programmatically via the iFrame Player API solves the issue we both are experiencing.
https://developers.google.com/youtube/iframe_api_reference
Also, there is a pretty nice open source jQuery solution which makes use of the iFrame Player API. you can find it here:
http://rochestb.github.io/jQuery.YoutubeBackground/
If you are using the jQuery.YoutubeBackground solution for embedding a video inside a instead of as a full screen background, set fitToBackground as false inside the YTPlayer object.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With