CMS Development

davidpru
Participant

Video plays simultaneously. Stop on play.

SOLVE

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
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Video plays simultaneously. Stop on play.

SOLVE

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

5 Replies 5
Tirabuchi
Member

Video plays simultaneously. Stop on play.

SOLVE

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

Video plays simultaneously. Stop on play.

SOLVE

Can you write me the code?

I'm not an expert of javascript.

https://www.captio.net/clientes

0 Upvotes
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Video plays simultaneously. Stop on play.

SOLVE

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>
SAlberts
Participant

Video plays simultaneously. Stop on play.

SOLVE

I implemented your js-code on my landingpage but it does not stop the Vidyard player from playing multiple videos simultaneously. 
See the page here: https://5598614.hs-sites.com/implant-training-videos

0 Upvotes
davidpru
Participant

Video plays simultaneously. Stop on play.

SOLVE

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.