|
@@ -83,8 +83,9 @@
|
|
|
</div>
|
|
|
<div id="wine">
|
|
|
<div id="box">
|
|
|
+ <!-- 默认webRTC是关闭状态的 -->
|
|
|
<video muted poster="" autoplay="autoplay" webkit-playsinline="" playsinline=""
|
|
|
- style="object-fit: contain;" id="playVideo"></video>
|
|
|
+ style="object-fit: contain;display: none;" id="playVideo"></video>
|
|
|
<canvas id="playCanvas" width="450" height="800"></canvas>
|
|
|
</div>
|
|
|
<div class="count-view" id="countView">
|
|
@@ -340,7 +341,6 @@
|
|
|
// }
|
|
|
// 判断是否支持webRTC
|
|
|
let isVideo = !!(typeof RTCPeerConnection !== 'undefined' && typeof RTCIceCandidate !== 'undefined' && typeof RTCSessionDescription !== 'undefined')
|
|
|
- $(isVideo ? '#playCanvas' : '#playVideo').css('display', 'none')
|
|
|
var topwinHeight = window.screen.height - window.innerHeight + 30; //计算title top 头部
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/');
|
|
@@ -1081,7 +1081,6 @@
|
|
|
Module.onRuntimeInitialized = function () {
|
|
|
isFinish = true;
|
|
|
};
|
|
|
-
|
|
|
function decodeAAC(data) {
|
|
|
var retPtr = Module._malloc(4 * 5 * 1024); //接收的数据
|
|
|
var inputPtr = Module._malloc(4 * data.length); //输入数据
|
|
@@ -1174,6 +1173,12 @@
|
|
|
console.log('鉴权失败');
|
|
|
}
|
|
|
}
|
|
|
+ function successCallback() {
|
|
|
+ console.log('webRTC请求成功了')
|
|
|
+ // 如果支持webRTC,就直接切换成webRTC的画面显示
|
|
|
+ $('#playVideo').show()
|
|
|
+ $('#playCanvas').hide()
|
|
|
+ }
|
|
|
let extranetIp, extranetPort
|
|
|
function doConnectBusiness(res) {
|
|
|
if(isVideo) {
|
|
@@ -1222,8 +1227,8 @@
|
|
|
mode: mode, //可选,默认为自动切换,可以强行指定模式
|
|
|
debug: true, //可选
|
|
|
callback: statusCallBack, //回调函数
|
|
|
+ successCallback // 成功请求WEBRTC回调
|
|
|
};
|
|
|
- console.log(option, 123456)
|
|
|
engine = new RtcEngine(option);
|
|
|
let myVideo = document.getElementById('playVideo');
|
|
|
// 禁用 <video> 元素的默认控件(例如播放按钮、进度条等)
|