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.
Sorry to resurrect this, but I’ve noticed this starts happening now even when scrolling down. Not sure if something changed this bug recently to the worse, or if it’s a different bug altogether. Confirmed with several people in our instance. This makes video sharing threads quite unbearable, when the earlier videos start suddenly playing.
Ich stimme dem zu, das passiert beim Scrollen nach oben oder unten und spielt zufällig alle zuvor abgespielten Videos erneut ab (ich stelle mir vor, es hat etwas damit zu tun, wie Discourse vorherige Inhalte beim Laden neuer Inhalte in einem Thema verarbeitet, aber ich weiß es ehrlich gesagt nicht).
Ich habe gemischte Gefühle dazu. Ich glaube nicht, dass die Leute erwarten sollten, dass ein Video von über 600 Beiträgen darüber weiter abgespielt wird, während man endlos in einem Megathema scrollt? Das Video ist nicht sichtbar und war auch schon eine Weile nicht mehr sichtbar, wenn man nach unten scrollt.
z.B. wenn man lange Audio hören möchte, während man sich auf einer beliebigen Website umsieht, sollte man es in einem neuen Tab öffnen?
Meiner Meinung nach sollte es das nicht. Wenn das Video pausiert oder beendet ist, sollte es sich nicht von selbst wieder abspielen, nur weil man nach unten gescrollt hat. (Was das beschriebene Verhalten ist, auch wenn der Titel irreführend ist)
Tatsächlich gibt es eine Alternative für Leute, die möchten, dass „Leute weiterspielen“, wenn sie sich bewegen, wenn sie den Tab-Ansatz zu viel finden.
Dies passiert immer noch in 3.0 Stable. Lustigerweise aktualisiert sich ein Video beim Scrollen nach OBEN, beim Scrollen nach UNTEN bleibt es pausiert, ein anderes zufälliges Video macht das Gegenteil. Bleibt beim Scrollen nach OBEN pausiert und aktualisiert sich beim Scrollen nach UNTEN.
Unser Plan ist, unsere Themenansicht in den nächsten ein bis zwei Jahren neu aufzubauen, was die Situation hoffentlich verbessern wird. Es gibt hier keine einfache Lösung, wir haben es versucht.