[*] 优化

This commit is contained in:
acgist
2022-11-26 12:38:11 +08:00
parent 474be08cc9
commit 56dc649279
3 changed files with 8 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ const defaultRPCConfig = {
/** 信令配置 */
const signalConfig = {
/** 当前终端SN */
sn: 'taoyao',
sn: localStorage.getItem('taoyao.sn', 'taoyao'),
/** 当前版本 */
version: '1.0.0',
// 信令授权
@@ -484,7 +484,8 @@ function Taoyao(
/** WebRTC配置 */
this.webrtc = null;
/** WebSocket地址 */
this.webSocket = webSocket;
// "wss://192.168.1.100:8888/websocket.signal"
this.webSocket = webSocket || 'wss://' + location.host + '/websocket.signal';
/** 设备状态 */
this.audioEnabled = true;
this.videoEnabled = true;

View File

@@ -50,16 +50,8 @@
meetingId: null
},
mounted() {
// 随机终端标识
if(signalConfig.sn === 'taoyao') {
let sn = localStorage.getItem('taoyao.sn');
if(sn) {
signalConfig.sn = sn;
}
console.debug('终端标识', sn);
}
let self = this;
this.taoyao = new Taoyao("wss://192.168.1.100:8888/websocket.signal");
this.taoyao = new Taoyao();
this.remoteClient = this.taoyao.remoteClient;
// 打开信令通道
this.taoyao