Cast video from one server to babylon.js on another server

Hello,

I’m new to Babylon and javascript. I was wondering if there is a way to cast a video that is being played on a website hosted on a server (let’s say ServerA) to a Babylon mesh (plane) to give the effect of a TV playing a video in the 3D world.

Thanks in advance.

Yes it is !

https://doc.babylonjs.com/how_to/video_texture

The doc shows how to use videos stored on the same server. What if I were to use a third-party website which plays some of its videos.

You can also use an absolute URL and it will works

I already have a project based internal website thats renders a video on the browser. I just want to pick that video and show in the babylon 3D world in a Plane mesh. Just cast whatever is being played on original website.

ahh you you want a video played on a server by someone to be played simultaneously in your babylon scene ?

I would connect to the server with websockets and send a event from the server to the client when video should play.

yeah, thats exactly my point. But that server by someone is one of mine too, but from a different project.

socket.io is the only way (but if you are a beginner it may be difficult)

Any docs that i can follow along?

actually, yes, I am a beginner. Can you please point the way?

You have to broadcast the video state to all the babylon clients… You will have to make one script server side in node.js and two clients in js : one for the video player and one for the babylon player. If you are a beginner it could be a (good) challenge ! Babylon will be the easiest :slight_smile:

Good luck !

Thank you for the heads up. As a developer, a nice challenge is always welcome. :grinning: