Video plays simultaneously. Stop on play.

SOLVE
davidpru
Participant

Hello, on my website I have a page with 4 videos.

I am using video player on rich text module.

 

{% video_player “embed_player”%}

 

I need not play videos simultaneously.

When I play in another video, the first video stops.


Any ideas?

0 Upvotes
1 Accepted solution

Accepted Solutions
tjoyce
Solution
Recognized Expert | Platinum Partner

Put this javascript into your page. When someone clicks to button to change videos it will pause all playing videos.

 

<script>
$('*[data-toggle="pill"]').on('click', function(){
for(var i = 0;i < VidyardV4.players.length; i++){
  VidyardV4.players[i].pause();
}
});
</script>

View solution in original post

4 Replies 4
Tirabuchi
Member

Hello,
You will need JS to do that. I do not remember the exact Hubspot-generated video markup, in general you have to manage the onClick event via jQuery on video elements and then stop video playback of every video element BUT the video clicked. 

0 Upvotes
davidpru
Participant

Can you write me the code?

I'm not an expert of javascript.

https://www.captio.net/clientes

0 Upvotes
tjoyce
Solution
Recognized Expert | Platinum Partner

Put this javascript into your page. When someone clicks to button to change videos it will pause all playing videos.

 

<script>
$('*[data-toggle="pill"]').on('click', function(){
for(var i = 0;i < VidyardV4.players.length; i++){
  VidyardV4.players[i].pause();
}
});
</script>

View solution in original post

davidpru
Participant

Thanks for your help. I have solved the problem.

I have to learn JS. Only with html and css it is difficult to live.


Very happy for your help.