Reputation: 1495
When trying out the WebRTC sample where video is streamed to a peer connection:
https://github.com/webrtc/samples/tree/gh-pages/src/content/capture/video-pc
In Firefox, I see only a black video rendered on the right video :-(
In Chrome I encounter a cross-origins error: Uncaught DOMException: Failed to execute 'captureStream' on 'HTMLMediaElement': Cannot capture from element with cross-origin data at HTMLVideoElement.maybeCreateStream
I have made no code changes, I simply cloned the repo and opened the index.html. I also tried serving the pages without luck in seeing the video.
How can I run this sample locally on Windows using either Chrome or Firefox?
Upvotes: 1
Views: 684
Reputation: 336
How can I run this sample locally on Windows using either Chrome or Firefox?
The code base contains a server.js file under web_server folder. You can run it locally using nodejs.
npm install
from the base directory to install the
dependencies.node server.js
You should be able to access your demo https://localhost:8080/src/content/capture/video-pc/
The demo runs in my machine. You have not mentioned which browser version you are using.
I used Chrome : Version 75.0.3770.100
for testing.
Upvotes: 6