企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] > [github](https://github.com/webRTC-io/webRTC.io) ## 概述 客户端 ``` <video id="local" autoplay="autoplay"></video> <video id="remote" autoplay="autoplay"></video> <script src="/webrtc.io.js"></script> <script> // note: make sure hostname available to all connecting clients // (ie. probably not `localhost`) rtc.connect('ws://yourserveraddress:8001'); rtc.createStream({"video": true, "audio":false}, function(stream){ // get local stream for manipulation rtc.attachStream(stream, 'local'); }); rtc.on('add remote stream', function(stream){ // show the remote video rtc.attachStream(stream, 'remote'); }); // more rtc callbacks are available </script> ``` 服务器 ``` var webRTC = require('webrtc.io').listen(8001); ```