If a YouTube video in a post is paused or finished playing and you scroll up or down the page enough to load new posts, the aforementioned video will start playing automatically. I’ve successfully recreated this issue on Windows 7 in Chrome version 56.0.2924.87 in this thread: Post your favorite video game glitches - #74 by jacknife - Game Discussion - Let's Play Zone
Load the post in the page above
Play one or all of the videos in the post
Pause them at any point
Scroll up the page until the browser loads in new comments
I have spent a lot of time this afternoon on this issue and I feel like this issue might not be fixable unless someone else has a brilliant idea.
The problem is in the virtual DOM with prepending (scrolling up). In this case, you are adding a bunch of elements (posts) to the beginning of an array. When the virtual DOM does its diff, it notices the element with the youtube <iframe> is not in the same place, so it removes and re-adds it later. This causes the youtube player to refresh the iframe, which causes it to play again.
It seems impossible to move an <iframe> in the DOM without reloading it.
Note that this bug doesn’t happen when scrolling down because appending posts doesn’t change the order. It also doesn’t matter if the user hasn’t started the video already, because lazyYT hasn’t inserted the iframe yet.
OK our debugging shows that for some reason the Youtube embedded player did fix the autoplay thing, so I am fixing the title here.
The bug we have is that we have “protection” in place when you click play that tells the “post cloaker”, hi … don’t cloak me. But this protection is somehow binned when you scroll up.
This means that if you play a song on youtube and scroll up it will just stop playing when we load the next chunk.
이 스레드를 다시 꺼내게 되어 죄송합니다. 하지만 이제 아래로 스크롤할 때도 이런 문제가 발생하기 시작했다는 걸 알게 되었습니다. 최근에 이 버그가 더 나빠졌는지, 아니면 아예 다른 버그인지 확실하지 않습니다. 저희 인스턴스에서 여러 사람과 확인해 보았습니다. 이전 영상이 갑자기 재생되기 시작하면 영상 공유 스레드가 꽤 견디기 힘들어집니다.
이 문제에 대해서는 복합적인 감정을 가지고 있습니다. 600개 이상의 게시물 위에 있는 영상이, 메가토픽에서 끝없이 아래로 스크롤하는 동안 계속 재생되어야 한다는 기대를 사람들이 가져야 한다고 생각하지 않거든요. 아래로 스크롤 중이라면 해당 영상은 보이지도 않고, 이미 한동안 보이지 않았을 테니까요.
예를 들어, 웹사이트를 둘러보면서 오랫동안 오디오를 재생하고 싶다면 새 탭에서 여는 건 어떨까요?
3.0 안정판에서도 여전히 이 문제가 발생합니다. 재미있는 점은, 위로 스크롤하면 한 영상은 새로고침되지만, 아래로 스크롤하면 여전히 일시정지 상태라는 것입니다. 또 다른 랜덤한 영상은 그 반대 현상을 보이는데, 위로 스크롤할 때 일시정지되고 아래로 스크롤할 때 재생이 새로고침됩니다.