I am trying to learn WebRTC and I can’t seem to find anything helpful. I am looking for an example code. I want a node server for the signaling and 2 browser tabs that will be able to transfer text between them using webRTC. Anyone knows where can I find working code for this?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
- 反爬能检测到JS模拟的键盘输入吗
The official WebRTC samples work, just launch the demos directly. They're all local however.
If you need an example with a node server, try installing emannion/webrtc-audio-video.
If you just want a demo that communicates between two browser tabs, try this fiddle with no server.
It uses a
localSocket
hack I wrote to mimmick a web socket with localStorage. Open it in two tabs, or better, two windows, so you see both.(Unfortunately, my trick doesn't work in stack snippets, so launch the fiddle in two tabs.)
Oh, and always use adapter.js to avoid browser differences until WebRTC has solidified.