Video is still playing when you scroll down so video is no more visible but is still playing

Mirra _ Posted in Component Development 4 years ago

Hello,

thank you for this project, it is absolutely awesome!
I would like to discuss new feature.
When I play some video and scroll down or up (so I don't see the video anymore), it still plays.

Please, could you make it like:
When users scroll down or up, (so user will no longer see the content of the video which is playing) it would pause or stop the video?

Thank you for this project, it is absolutely AWESOME. :)

Replies
Byelorussian TC TRASH Replied 4 years ago

trouver le fichier js de vos integration iframe youtube vimeo etc et
Ajoutez cette méthode à votre script:

var stopVideo = function ( element ) {
var iframe = element.querySelector( 'iframe');
var video = element.querySelector( 'video' );
if ( iframe !== null ) {
var iframeSrc = iframe.src;
iframe.src = iframeSrc;
}
if ( video !== null ) {
video.pause();
}
};
Appelez la fonction si nécessaire, en passant l'élément conteneur dans la fonction:

stopVideo( tab );

German Michael Zülsdorff Replied 4 years ago

You may contact
https://www.opensource-socialnetwork.org/u/bansh33
He's the right one for customizing things like that.