rtc-streamer
v0.3.1
Published
webrtc-streamer
Downloads
12
Readme
- 支持 TypeScript
- 与 SRS 服务结合使用
开始
安装
npm i rtc-streamer --save
使用
拉流
import { SrsRtcPlayerAsync } from "rtc-streamer";
const srs = new SrsRtcPlayerAsync();
const video = document.getElementsByTagName("video");
video.srcObject = srs.stream;
srs.play(`webrtc://192.168.18.140/test/test`).catch((error) => {
console.log(error);
});
推流
import { SrsRtcPublisherAsync } from 'rtc-streamer'
const srs = new SrsRtcPublisherAsync()
srs.publish(`webrtc://192.168.18.140/test/test`).catch((error: any) => {
console.log(error)
})