1.24.2 • Published 4 years ago

@efox/webrtc v1.24.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

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

FunctionSummaryUseageParamterReturnType
initWebRtc根据参数初始化实例,并根据refs中的uid自动填装绑定video标签initWebRtc(param)param: initParamPromise
startLiveAndJoinRoom开播并创建房间startLiveAndJoinRoom(param)param: startLiveParamPromise
joinRoom加入房间joinRoom(uid, roomid)uid: string, roomid: stringPromise
showVideo将流填充入对应el中showVideo(el, MediaStreamId)el: HTMLVideoElement, MediaStreamId: stringvoid
publishVideo根据type发布视频publishVideo(type, param)type: 'screen'or'camera', param: publishParamPromise
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-100void
changeRoom更换房间changeRoom(uid)uid: stringPromise
addRefs添加展示流的标签addRefs(refs)refs: videoRefs[]void
addBaseInfo添加基本信息addBaseInfo(param)param: baseInfovoid
onLiveRoomInfoChange房间信息更改监听onLiveRoomInfoChange(fn)fn: (data?: liveRoomInfo) => voidvoid
offLiveRoomInfoChange取消监听offLiveRoomInfoChange(fn)fn: (data?: liveroomInfo) => voidvoid
leaveRoom离开房间leaveRoom()nullPromise

otherType

videoMode

1.24.2

4 years ago

1.24.1

4 years ago

1.24.0

4 years ago

1.22.0

4 years ago

1.21.2

4 years ago

1.21.0

4 years ago

1.20.0

4 years ago

1.18.0

4 years ago

1.17.0

4 years ago

1.16.1

4 years ago

1.16.0

4 years ago

1.15.0

4 years ago

1.14.0

4 years ago

1.13.0

4 years ago

1.12.0

4 years ago