N
O
D
E
M
E
D
I
A
Thinking
首页
产品
文档
博客
订单
文档
快速集成
2026年 5月 20日 下午4:22
## 采集摄像头推流 ### 1. 先准备一个video标签 ``` <video id="video" autoplay muted width="640" height="360"></video> ``` ### 2.加载NodePublisher.js ``` <script type="text/javascript" src="./NodePublisher.min.js"></script> ``` ### 3.预览摄像头并设置编码参数 ``` var nodePublisher; NodePublisher.load(async () => { nodePublisher = new NodePublisher(); nodePublisher.setAudioSource(); nodePublisher.setVideoSource("video"); nodePublisher.setAudioConfig("mp4a.40.2", 96_000, 1, 48000); nodePublisher.setVideoConfig("avc1.64001E", 1920, 1080, 30, 60, 2_000_000); } ``` ### 4.开始推流 ``` nodePublisher.start(url); ``` ### 5.停止推流 ``` nodePublisher.stop(); ``` ## 采集canvas推流
嘿,我是小R,需要帮助随时找我哦
QQ客服:281269007
邮件支持
扫码加微信
回到顶部