Hello I’m currently designing my portfolio.
here is the page : [https://julienwidmer.webflow.io/]
After clicking on the title of the first project “shell advance”
a video from vimeo is playing with PLYR
Then if I scroll during play, It goes back to the menu to watch another project but we still hear the player that play in background.
What I want is that in case I’m playing the video, If I scroll with mouse,
it need to stop the player.
here is the actual custom code. everything is working. the only one that doesn’t work is the last code which is not good.
for(let x = 0 ; x < 20 ; x ++){
// Play on click .titre
on('#titre-' + (x + 2), 'click', () => {
players[x].play();
});
// Stop and back to 0 at end
players[x].on('ended', function(event) {
players[x].pause();
players[x].currentTime = 0;
});
//Stop on return
on('#btnreturn' + (x + 2), 'click', () => {
players[x].pause();
players[x].currentTime = 0;
//console.log('players[x].stop');
});
// WIP - stop on scroll (doesn't work)
on('.player_js', 'onscroll', () => {
players[x].pause();
players[x].currentTime = 0;
});
here is the page : [https://julienwidmer.webflow.io/home-swiper]
Here is my site Read-Only: https://preview.webflow.com/preview/julienwidmer?utm_medium=preview_link&utm_source=designer&utm_content=julienwidmer&preview=b1c6e4b8e968903cb0a0e7087aa1063b&pageId=61030daf86d4c07d5d4f4d4d&workflow=preview
( don’t forget to select the page Home-swiper to see the good page !! )