<video> playing twice in firefox

Hello,

I encountered this bug in one of my custom project. I think it’s new since the last update. Here’s the reproduction in the example room :

When you click on the video on the wall, it shows a video. However, the video is playing twice (one is hidden) so the sound is also doubled and when you close the popup, the hidden one is still playing.

Here’s the code (sorry for the spaces, it shows the actual video instead of the code …) :

< video controls autoplay>
< source src=‘https://discovr-360.eu/test/videoplayback.mp4’ type=‘video/mp4’>
< /video>

This only happens in Firefox v96.0.2 (the last version). It works normally in Google Chrome.

I tried some fix but it doesn’t work (probably because the “second” video is not a

document.getElementById("ext-html-label-close").addEventListener('click',function(){
	this.fistChild.pause();
	muteAllVideos();

});

function muteAllVideos(){
var allVideos = document.querySelectorAll(‘video’);
allVideos.forEach(element => element.pause());
}

Thanks