facade-webrtc
v1.0.3
Published
webrtc
Downloads
4
Maintainers
Readme
facade-webrtc
- 基于
facade-signalr-client
- 兼容不同浏览器
webrtc-adapter
使用
- 连接
import facadeWebRTC from 'facade-webrtc'
// remoteVideoId <video id =''remoteVideoId />
// localVideoId <video id =''localVideoId />
// signalr 目标 target orgId
// signalr 目标 target userId
facadeWebRTC.connect(remoteVideoId, localVideoId, targetOrgId, targetUserId)
- 呼叫
// remoteVideoId <video id =''remoteVideoId />
// localVideoId <video id =''localVideoId />
facadeWebRTC.call(remoteVideoId, localVideoId)
- 关闭呼叫
facadeWebRTC.stop()
- 是否占线
// 返回 是否占线
facadeWebRTC.busy()
- 利用 signalr 发送 SendWebRTC 消息
// handMessageType: IHandMessageType = {
// candidate: 'candidate',
// offer: 'offer',
// answer: 'answer',
// }
facadeWebRTC.sendWebRTCMessage(targetOrgId, targetUserId, handMessage)