npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@efox/webrtc

v1.24.2

Published

``` npm i --save-dev @efox/webrtc ``` #### yarn ``` yarn add -s @efox/webrtc ```

Downloads

51

Readme

Install

npm

  npm i --save-dev @efox/webrtc

yarn

  yarn add -s @efox/webrtc

Use it in your project

  import { RtcService } from '@efox/webrtc'

APIs

RtcService

| Function | Summary | Useage | Paramter | ReturnType | | :----- | :----- | :----- | :----- | :----- | | initWebRtc | 根据参数初始化实例,并根据refs中的uid自动填装绑定video标签 | initWebRtc(param) | param: initParam | Promise | | startLiveAndJoinRoom | 开播并创建房间 | startLiveAndJoinRoom(param) | param: startLiveParam | Promise | | joinRoom | 加入房间 | joinRoom(uid, roomid) | uid: string, roomid: string | Promise | | showVideo | 将流填充入对应el中 | showVideo(el, MediaStreamId) | el: HTMLVideoElement, MediaStreamId: string | void | | publishVideo | 根据type发布视频 | publishVideo(type, param) | type: 'screen'or'camera', param: publishParam | Promise | | unpublishVideo | 取消发布 | unpublishVideo(type) | type: 'screen'or'camera' | Promise | | enableVideo | 打开视频采集 | enableVideo(type) | type: 'screen'or'camera' | void | | disableVideo | 关闭视频采集 | disableVideo(type) | type: 'screen'or'camera' | void | | enableAudio | 打开音频采集 | enableAudio(type) | type: 'screen'or'camera' | void | | disableAudio | 关闭音频采集 | disableAudio(type) | type: 'screen'or'camera' | void | | getVideoDevice | 获取视频设备 | getVideoDevice(fn) | fn:Function(deviceInfo?: {deviceId: string}) | void | | getAudioDevice | 获取音频设备 | getAudioDevice(fn) | fn:Function(deviceInfo?: {deviceId: string}) | void | | setPublisherVolume | 设置麦克风音量 | setPublisherVolume(type, volume) | type: 'screen'|'camera', volume: 0-100 | void | | changeRoom | 更换房间 | changeRoom(uid) | uid: string | Promise | | addRefs | 添加展示流的标签 | addRefs(refs) | refs: videoRefs[] | void | | addBaseInfo | 添加基本信息 | addBaseInfo(param) | param: baseInfo | void | | onLiveRoomInfoChange | 房间信息更改监听 | onLiveRoomInfoChange(fn) | fn: (data?: liveRoomInfo) => void | void | | offLiveRoomInfoChange | 取消监听 | offLiveRoomInfoChange(fn) | fn: (data?: liveroomInfo) => void | void | | leaveRoom | 离开房间 | leaveRoom() | null | Promise |

otherType

videoMode