Les vidéos YouTube en pause ou terminées se lisent automatiquement lorsque vous faites défiler vers le haut assez loin pour charger de nouveaux posts

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 - General Game Discussion - Let's Play Zone

  1. Load the post in the page above
  2. Play one or all of the videos in the post
  3. Pause them at any point
  4. Scroll up the page until the browser loads in new comments
  5. The videos will autoplay without any interaction

Here’s a thread about it on my forum if it’s of any help: Embedded Youtube Video Replaying - Site Feedback - Let's Play Zone

6 « J'aime »

Possibly related to this bugfix:

2 « J'aime »

From what I can see on the linked topic it appears the issue is still happening @eviltrout

2 « J'aime »

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.

4 « J'aime »

So this does not happen in the scrolling down scenario?

No it doesn’t happen when scrolling down.

I have edited the topic to make this more clear.

A similar bug happens if you don’t stop the video. When you scrolling up the page, the video stops and after few seconds restart from the beginning.

I wonder if @Osama could take a look at this? It is annoying, and easy to repro.

3 « J'aime »

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.

1 « J'aime »

It’s also the opposite, if you stopped it playing, it will now restart… by itself.

This has been assigned both to @eviltrout and @Osama over the years, we have invested lots of time here and simply can not come up with a fix.

I am tagging this pr-welcome … but keep in mind … difficulty level on this is somewhere around 11.

image

13 « J'aime »

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.

Je confirme, cela se produit en faisant défiler vers le haut ou vers le bas et rejoue aléatoirement toutes les vidéos précédemment lues (j’imagine que cela a quelque chose à voir avec la façon dont Discourse traite le contenu précédent lors du chargement de nouveau dans un sujet, mais honnêtement, je ne sais pas).

J’ai des sentiments mitigés à ce sujet, je ne pense pas que les gens devraient s’attendre à ce qu’une vidéo de plus de 600 messages au-dessus continue de jouer pendant que vous faites défiler sans fin dans un méga-sujet ? La vidéo n’est pas visible, et ne l’a pas été depuis un moment si vous faites défiler vers le bas.

par exemple, si vous voulez écouter de l’audio pendant longtemps tout en naviguant sur le site que vous visitez, ouvrez-le dans un nouvel onglet ?

À mon avis, ce ne devrait pas être le cas. Si la vidéo est en pause ou terminée, elle ne devrait pas se rejouer d’elle-même simplement parce que vous avez fait défiler la page. (Ce qui est le comportement décrit, même si le titre est trompeur)

En fait, il existe une alternative pour les personnes qui veulent que « les gens continuent à jouer » pendant qu’ils naviguent, s’ils trouvent l’approche par onglets trop contraignante.

1 « J'aime »

Est-ce que cela semble mieux ?

Cela se produit toujours dans la version stable 3.0. Ce qui est drôle, c’est qu’une vidéo se rafraîchit en faisant défiler vers le HAUT, en faisant défiler vers le BAS, elle reste en pause. Une autre vidéo aléatoire fait le contraire. Elle reste en pause lorsque vous faites défiler vers le HAUT et se relance en faisant défiler vers le BAS.

Très agaçant

Nous n’avons pas encore apporté de changements ici.

Notre plan est de reconstruire notre vue des sujets au cours des 1 ou 2 prochaines années, ce qui devrait, espérons-le, améliorer la situation. Il n’y a pas de solution facile ici, nous avons essayé.

2 « J'aime »