CMS Development

davidpru
Teilnehmer/-in

Video plays simultaneously. Stop on play.

lösung

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 Akzeptierte Lösung
tjoyce
Lösung
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Video plays simultaneously. Stop on play.

lösung

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>

Lösung in ursprünglichem Beitrag anzeigen

5 Antworten
Tirabuchi
Mitglied

Video plays simultaneously. Stop on play.

lösung

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
Teilnehmer/-in

Video plays simultaneously. Stop on play.

lösung

Can you write me the code?

I'm not an expert of javascript.

https://www.captio.net/clientes

0 Upvotes
tjoyce
Lösung
Trendsetter/-in | Elite Partner
Trendsetter/-in | Elite Partner

Video plays simultaneously. Stop on play.

lösung

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
Teilnehmer/-in

Video plays simultaneously. Stop on play.

lösung

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
Teilnehmer/-in

Video plays simultaneously. Stop on play.

lösung

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.