0

I'm a designer and I do projects where I try to code, let's say I DIY in front end! But right now I want to do something where I'm completely stuck.

I would like to have several screens (multiple devices) containing videos, they would all launch at the same time when clicking on a button on a specific page. I heard about nodejs to maybe create several pages each containing a video, and on clicking a button on the index page all the other pages launch the video at the same time. I tried to dive into nodejs but I'm extremely clueless, I'd like to know if you think it's possible to do it like that? And if so, if you maybe have any resources?

I hope I'm clear, thanks a lot in advance!

1 Answers1

0

You can achieve this with pure html and javascript, I'm not sure that's what you asking but...here is an example:

            document.getElementById("clickme").addEventListener("click",function(){
                document.getElementById("vid1").play();
            document.getElementById("vid2").play();
            document.getElementById("vid3").play();

            })
      <video width="400" controls id="vid1">
        <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
      </video>
      
      <video width="400" controls id="vid2">
        <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
      </video>
      
      <video width="400" controls id="vid3">
        <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
      </video>

      <button id="clickme">click me</button>
Leo Ramadani
  • 223
  • 1
  • 11
  • Thank you for your answer ! I just tested it and the thing is : it works when the videos are on the same page, but not when they are in different pages (which is what I want to do) – Andrea O May 20 '22 at 14:34
  • Please try to show us what you have tried so far. Explaining only what you want to do gives me some freelance vibes not stackoverflow lol. – Leo Ramadani May 20 '22 at 14:38
  • I'm a design student and I am trying to achieve a school project, I did mean to give you freelance vibes haha sorry! So far I tried to connect multiple IP adresses of different computers with Processing, but It was not successful because the network at my school is really bad. Then I tried something that is near your answer (the only difference is that I used Jquery) and therefore, it didn't worked either because it played only the video inside the page that has the button, not video in other pages. – Andrea O May 20 '22 at 14:46
  • I also tried to dive into node.js but I honestly didn't understood a thing.. So here I am, with almost no clue on how to do it haha – Andrea O May 20 '22 at 14:46
  • You can find my mail in my profile here, feel free to write me there, I will try to help you. – Leo Ramadani May 20 '22 at 14:59
  • It's very nice of you thx, I will contact you shortly! – Andrea O May 20 '22 at 15:02