Jump to content

CORS WebRtc Canvas


fiveworlds

Recommended Posts

Well I wanted to make some multiplayer games that make use of motion capture by drawing a video stream to a canvas in html.  WebRtc is fairly new though so there isn't many tutorials on it. It also seems hard to do and might not work if CORS prevents me from getting the video stream pixel data.

Link to comment
Share on other sites

As with any project, start from making quick and dirty example code, which will verify proof of concept.

 

Google for "cors example javascript"

https://www.html5rocks.com/en/tutorials/cors/

and make your own quick & dirty example basing on it.

 

Google for "webrtc examples"

https://webrtc.github.io/samples/

and make your own quick & dirty example basing on it.

 

What video stream source? Located outside of your own HTTP/HTTPS server?

Examples that I see in the above link are taking web camera image and renders in web browser..

Edited by Sensei
Link to comment
Share on other sites

Quote

What video stream source?

WebRtc is the new standard for video capture from a users camera. So similar to like facebook video chat/ google hangouts. The gets streamed to a <video> element normally and video data can then be drawn to canvas. The problem would be that sometimes the canvas can prevent access to the pixels data due to CORS. So something like this

only multiplayer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.