0

I have this URL:

https://www.youtube.com/embed/wU4DgHHwVCc?autoplay=1&start=100&end=120&loop=1&playlist=wU4DgHHwVCc

What I want to achieve:

  • keep looping
  • auto play on every loop
  • on every loop back start from 100th sec and end on 200th sec.

Issue:

On every loop back video starts from 0th sec, instead of what is given at start parameter.

Does anyone know what I am doing wrong?


OS: Ubuntu 16.04 LTS

Chrome version: 67.0.3396.87 (64-bit)

2

The problem you are seeing is from the &playlist= tag. What it looks like is that you were having problems getting 'loop' and 'autoplay' to work together, so you added the 'playlist' tag.

What's happening here is that the API is being tricked into playing the same video over and over by making it think that it's in an infinite playlist of the same video. After the video ends, the next video plays.. which happens to be the same video. However, the end tag was only applied to the first instance of the video.

In order to achieve this, your best bet is to use the YouTube Javascript API as pensan suggested.

  • You're right about the playlist tag. I can do this with the API but this was just for general browsing. Some portions of songs or videos that I wanted to keep repeating. – zindarod Jun 25 '18 at 12:16
  • Check this endlessvideo.com – Jagjeet Singh Jun 25 '18 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.