
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
npm install webrtclib
import videoWebrtc from "webrtclib";
import "webrtclib/lib/videoWebrtc.css"
Vue.use(videoWebrtc);
<video-webrtc
:server="server"
:stun="stun"
:sid="sid"
:orgId="orgId"
@saveVideo="saveVideo"
@capture="capture"
></video-webrtc>
参数 | 类型 | 类型 | 解释 |
---|---|---|---|
server | 必传 | String | 服务地址 |
stun | 必传 | String | ice协议服务地址 |
sid | 必传 | [Number, String] | 直播时候传入的设备id |
orgId | 必传 | [Number, String] | 直播时候传入的组织ID |
custTime | 非必传 | [Number, String] | 录像时间(秒),默认5分钟,最大1小时 |
saveVideo | 非必传 | 回调方法 | 返回录像地址url |
capture | 非必传 | 回调方法 | 返回截图文件base64 |
录像需要配置proxy
proxy: {
"/webrtcApi": {
target: "http://ip:port", // 目标接口域名
pathRewrite: {
"^/webrtcApi": ""
},
changeOrigin: true // 是否跨域
}
}
<template>
<div class="home">
<div class="video" v-for="item in arr" :key="item">
<video-webrtc
:server="server"
:stun="stun"
:sid="sid"
:orgId="orgId"
@saveVideo="saveVideo"
@capture="capture"
></video-webrtc>
</div>
<div class="dialog-mask" v-if="imgCapture" @click="imgCapture = null"></div>
<div class="dilog" v-if="imgCapture">
<img v-if="imgCapture" :src="imgCapture" alt="" />
</div>
</div>
</template>
<script>
export default {
name: "Home",
data() {
return {
arr: [1, 2, 3, 4, 5, 6, 7, 8, 9],
stun: "stun://ip:port",
server: "ws://ip:port/wsrtc",
sid: "摄像头ID",
orgId: "组织ID"
imgCapture: ""
};
},
methods: {
// 截图
capture(val) {
console.log(val);
this.imgCapture = val;
},
// 录像
saveVideo(val) {
console.log(val);
}
}
};
</script>
<style>
.home {
display: flex;
flex-wrap: wrap;
}
.video {
width: 320px;
height: 180px;
position: relative;
margin: 10px;
}
.dialog-mask {
position: absolute;
z-index: 1001;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #00000090;
}
.dilog {
position: absolute;
z-index: 1001;
width: 80%;
left: 10%;
top: 10%;
padding: 20px;
background-color: #fff;
}
</style>
FAQs
a webrtc lib for vue
The npm package webrtclib receives a total of 1 weekly downloads. As such, webrtclib popularity was classified as not popular.
We found that webrtclib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.