Multiple Videos | SoloLearn: Learn to code for FREE!


Multiple Videos

let's say I have two or more videos on my page with HTML video tag, I found out that when I clicked both, both of them play... and I want a situation whereby only one video will play at a time, when one is clicked the other will stop... How can I use JavaScript for this? please help thanks

9/9/2018 8:36:38 PM

Adewale Olaoye

4 Answers

New Answer


Video dom has play() and pause() methods.


In additional to Toni Isotalo's answer: Have a look at this source👍:


thank you guys this helps but I've not gotten what I want... I want a situation that when I play one video, let's say out of 5 videos, only that one will play and if another video, say video4 is been clicked, video 1 will automatically pause without the user touching it...


gotcha!!! Now i get it, Thanks guys