fiveworlds Posted June 28, 2019 Posted June 28, 2019 Does anybody know if a WebRtc stream drawn to html canvas is blocked by CORS?
Sensei Posted June 28, 2019 Posted June 28, 2019 Do you have the real problem, or is it generic question.. ?
fiveworlds Posted June 28, 2019 Author Posted June 28, 2019 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.
Sensei Posted June 28, 2019 Posted June 28, 2019 (edited) 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 June 28, 2019 by Sensei
fiveworlds Posted June 28, 2019 Author Posted June 28, 2019 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now