rtc-streamer
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published
  • 支持 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)
})

Readme

Keywords

Package Sidebar

Install

npm i rtc-streamer

Weekly Downloads

0

Version

0.2.2

License

MIT

Unpacked Size

4.31 kB

Total Files

7

Last publish

Collaborators

  • reinerlau