Video plays simultaneously. Stop on play.

SOLVE
Occasional Contributor

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?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Top Advisor | Gold 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>
4 Replies 4
Occasional Contributor

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. 

Reply
0 Upvotes
Occasional Contributor

Can you write me the code?

I'm not an expert of javascript.

https://www.captio.net/clientes

Reply
0 Upvotes
Highlighted
Top Advisor | Gold 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>
Occasional Contributor

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.