
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
webrtc-player
Advanced tools
webrtcPlayer.js是基于webrtc协议的播放器 兼容各主流流媒体webrtc协议 SRS、ZLM、M7s等
webrtcPlayer.js 基于 JSWebrtc.js 改造而来。
1.安装
npm i webrtc-player
2.创建video标签
<video id="media" src="" muted controls></video>
3.在js中引入 创建实例:
import webrtcPlayer from 'webrtc-player'
let play;
play = new webrtcPlayer({
url: 'webrtc://',
video: "media",
// streamingMediaType: 'srs', //如果是srs需要加上这个参数
autoplay: true,
onPlay: (e) => {
console.log('开始播放', e);
},
onPause: (e) => {
console.log('暂停', e);
}
})
webrtcPlayer(optinos
)
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
url | 视频地址 | string | - | - |
autoplay | 是否自动播放 | boolean | - | - |
streamingMediaType | 流媒体类型(srs必传,其他流媒体可不传) | string | 'srs'|'m7s'... | - |
onPlay | 视频开始播放回调 | Function | - | - |
onPause | 视频暂停播放回调 | Function | - | - |
事件名称 | 说明 | 回调参数 |
---|---|---|
play | 播放 | - |
stop | 暂停 | - |
destroy | 销毁(在外部定义变量赋值时 let play = new webrtcPlayer(options) 在调用destroy后 将play也置为null play=null) | - |
FAQs
webrtcPlayer.js是基于webrtc协议的播放器 兼容各主流流媒体webrtc协议 SRS、ZLM、M7s等
The npm package webrtc-player receives a total of 4 weekly downloads. As such, webrtc-player popularity was classified as not popular.
We found that webrtc-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.