[*] 会议

This commit is contained in:
acgist
2022-11-20 14:10:20 +08:00
parent f900bbb998
commit cf476b842b
14 changed files with 274 additions and 70 deletions

View File

@@ -1,6 +1,6 @@
/** 桃夭WebRTC终端核心功能 */
/** 兼容 */
const PeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
const RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
/** 默认音频配置 */
const defaultAudioConfig = {
// 音量0~1
@@ -39,6 +39,21 @@ const defaultVideoConfig = {
// 选摄像头user|left|right|environment
facingMode: 'environment'
}
/** 默认RTCPeerConnection配置 */
const defaultRPCConfig = {
// ICE代理的服务器
// iceServers: null,
// 证书
// certificates: null,
// 传输通道绑定策略balanced|max-compat|max-bundle
bundlePolicy: 'balanced',
// RTCP多路复用策略require|negotiate
rtcpMuxPolicy: 'negotiate',
// ICE传输策略all|relay
iceTransportPolicy: 'all'
// ICE候选个数
// iceCandidatePoolSize: 10
}
/** 信令配置 */
const signalConfig = {
/** 当前终端SN */
@@ -328,13 +343,9 @@ function TaoyaoClient(
/** 设置媒体流 */
this.buildStream = async function(stream) {
if(stream) {
if ('srcObject' in this.video) {
this.video.srcObject = stream;
} else {
this.video.src = URL.createObjectURL(stream);;
}
this.video.srcObject = stream;
await this.play();
}
await this.play();
return this;
};
/** 设置音频流 */

View File

@@ -62,9 +62,9 @@
this.taoyao
.checkDevice()
.buildChannel(this.callback)
//.buildLocalMedia()
//.then(stream => this.taoyao.buildLocalClient('local', stream))
//.catch((e) => console.error('打开终端媒体失败', e));
.buildLocalMedia()
.then(stream => this.taoyao.buildLocalClient('local', stream))
.catch((e) => console.error('打开终端媒体失败', e));
},
beforeDestroy() {
},