|
@@ -53,10 +53,10 @@
|
|
</div>
|
|
</div>
|
|
<div class="leftmains">
|
|
<div class="leftmains">
|
|
<div class="PictureQualityMain">
|
|
<div class="PictureQualityMain">
|
|
- <div class="PictureQuality " data-id="1803000">高清</div>
|
|
|
|
- <div class="PictureQuality avit" data-id="1243000">标清</div>
|
|
|
|
- <div class="PictureQuality" data-id="400000">极速</div>
|
|
|
|
- <div class="PictureQuality" data-id="200">自动</div>
|
|
|
|
|
|
+ <div class="PictureQuality" data-id="4">高清</div>
|
|
|
|
+ <div class="PictureQuality avit" data-id="3">标清</div>
|
|
|
|
+ <div class="PictureQuality" data-id="2">极速</div>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
<div class="operation">
|
|
<div class="operation">
|
|
<div class="upload" id="showsuss" data-text="uploads">
|
|
<div class="upload" id="showsuss" data-text="uploads">
|
|
@@ -111,8 +111,9 @@
|
|
<script type="text/javascript" src="pcm-player.js"></script>
|
|
<script type="text/javascript" src="pcm-player.js"></script>
|
|
<script type="text/javascript" src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
|
|
<script type="text/javascript" src="https://cdn.bootcss.com/vConsole/3.2.0/vconsole.min.js"></script>
|
|
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
|
|
<script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
|
|
- <script type="text/javascript" src="WXdraw.js?v=110"></script>
|
|
|
|
|
|
+ <script type="text/javascript" src="WXdraw.js"></script>
|
|
<script type="text/javascript" src="jmuxer.js"></script>
|
|
<script type="text/javascript" src="jmuxer.js"></script>
|
|
|
|
+ <script type="text/javascript" src="spsParser.js"></script>
|
|
<script>
|
|
<script>
|
|
var parameters = GetRequest();
|
|
var parameters = GetRequest();
|
|
if (parameters['mealType'] === 'VIP') {
|
|
if (parameters['mealType'] === 'VIP') {
|
|
@@ -163,15 +164,10 @@
|
|
var winese = document.createElement("wine");
|
|
var winese = document.createElement("wine");
|
|
wine.style.top = "-" + winese + 'px';
|
|
wine.style.top = "-" + winese + 'px';
|
|
|
|
|
|
- var requestCount = 0;
|
|
|
|
var isVisuable = true;
|
|
var isVisuable = true;
|
|
var isFeed = true;
|
|
var isFeed = true;
|
|
- var isDrag = false;
|
|
|
|
- var isEnough = true;
|
|
|
|
var isFinish = false;
|
|
var isFinish = false;
|
|
-
|
|
|
|
- var delayTime = new Date().getTime();
|
|
|
|
- var curTime = new Date().getTime();
|
|
|
|
|
|
+ var isWaitSps = false;
|
|
var myVideo = document.getElementById("playerVideo");
|
|
var myVideo = document.getElementById("playerVideo");
|
|
Module = {};
|
|
Module = {};
|
|
Module.onRuntimeInitialized = function () {
|
|
Module.onRuntimeInitialized = function () {
|
|
@@ -182,7 +178,6 @@
|
|
var ip = parameters["ip"];
|
|
var ip = parameters["ip"];
|
|
var cardToken = parameters["cardToken"];
|
|
var cardToken = parameters["cardToken"];
|
|
cardToken = cardToken && cardToken.replace(/@/g, "=");
|
|
cardToken = cardToken && cardToken.replace(/@/g, "=");
|
|
- cardToken = cardToken.replace(/\$/g, "+");
|
|
|
|
var appletPushAddress = parameters["appletPushAddress"];
|
|
var appletPushAddress = parameters["appletPushAddress"];
|
|
var socketURL = isWSS ? "wss://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken : "ws://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken;
|
|
var socketURL = isWSS ? "wss://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken : "ws://" + appletPushAddress + "?cardIp=" + ip + "&token=" + cardToken;
|
|
|
|
|
|
@@ -195,8 +190,6 @@
|
|
});
|
|
});
|
|
|
|
|
|
window.onload = function () {
|
|
window.onload = function () {
|
|
- curTime = new Date().getTime();
|
|
|
|
-
|
|
|
|
var myPlay = document.getElementById("wine");
|
|
var myPlay = document.getElementById("wine");
|
|
|
|
|
|
myPlay.onkeydown = function (event) {
|
|
myPlay.onkeydown = function (event) {
|
|
@@ -228,7 +221,7 @@
|
|
ws.send("ping");
|
|
ws.send("ping");
|
|
} else {
|
|
} else {
|
|
clearInterval(intervaler);
|
|
clearInterval(intervaler);
|
|
- $.toast("画面异常,请重新进入", "text");
|
|
|
|
|
|
+ $.toast("画面异常,请重新进入1", "text");
|
|
if (navigator.userAgent.toLowerCase().includes('toutiaomicroapp')) {
|
|
if (navigator.userAgent.toLowerCase().includes('toutiaomicroapp')) {
|
|
tt.miniProgram.switchTab({
|
|
tt.miniProgram.switchTab({
|
|
url: '/pages/home/home'
|
|
url: '/pages/home/home'
|
|
@@ -253,7 +246,7 @@
|
|
clearInterval(intervaler);
|
|
clearInterval(intervaler);
|
|
throttle(doConnect, 100);
|
|
throttle(doConnect, 100);
|
|
if (errorTime > 1000) {
|
|
if (errorTime > 1000) {
|
|
- $.toast("画面异常,请重新进入", "text");
|
|
|
|
|
|
+ $.toast("画面异常,请重新进入2", "text");
|
|
wsss.close();
|
|
wsss.close();
|
|
if (navigator.userAgent.toLowerCase().includes('toutiaomicroapp')) {
|
|
if (navigator.userAgent.toLowerCase().includes('toutiaomicroapp')) {
|
|
tt.miniProgram.switchTab({
|
|
tt.miniProgram.switchTab({
|
|
@@ -282,9 +275,33 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (data.frameType != undefined && data.frameType != 1 && data.frameType != 6) {
|
|
|
|
+ if (data.frameType == 7) {
|
|
|
|
+ let info = spsParser(data.video);
|
|
|
|
+
|
|
|
|
+ if (info.width != myVideo.videoWidth && info.height != myVideo.videoHeight) {
|
|
|
|
+ if (myVideo.videoWidth == 0) {
|
|
|
|
+ console.log("SPS计算得到宽 %d, 高 %d, 控件宽 %d, %d", info.width, info.height, myVideo.videoWidth, myVideo.videoHeight);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (data.video != null) { //喂视频
|
|
if (data.video != null) { //喂视频
|
|
|
|
+ if (data.frameType == 0x05 && isVisuable) {
|
|
|
|
+ isFeed = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (data.frameType == 7 || data.frameType == 8) {
|
|
|
|
+ isFeed = true;
|
|
|
|
+ isAudioPlay = true;
|
|
|
|
+ isWaitSps = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (isFeed) {
|
|
if (isFeed) {
|
|
- jmuxer.feed(data);
|
|
|
|
|
|
+ if (!isWaitSps) {
|
|
|
|
+ jmuxer.feed(data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -348,11 +365,13 @@
|
|
var input = new Uint8Array(data),
|
|
var input = new Uint8Array(data),
|
|
duration,
|
|
duration,
|
|
video,
|
|
video,
|
|
|
|
+ frameType,
|
|
audio;
|
|
audio;
|
|
if (input[0] == 0 && input[1] == 0 && input[2] == 0 && input[3] == 1) {
|
|
if (input[0] == 0 && input[1] == 0 && input[2] == 0 && input[3] == 1) {
|
|
video = input;
|
|
video = input;
|
|
duration = 24;
|
|
duration = 24;
|
|
var nalType = input[4] & 0x1f;
|
|
var nalType = input[4] & 0x1f;
|
|
|
|
+ frameType = nalType;
|
|
|
|
|
|
if (!isFeed) {
|
|
if (!isFeed) {
|
|
if (nalType == 0x05 && isVisuable) {
|
|
if (nalType == 0x05 && isVisuable) {
|
|
@@ -360,15 +379,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (input[0] == 0xff) {
|
|
} else if (input[0] == 0xff) {
|
|
- if (!isEnough) {
|
|
|
|
- requestCount++;
|
|
|
|
- }
|
|
|
|
audio = input;
|
|
audio = input;
|
|
-
|
|
|
|
- if (new Date().getTime() - curTime > 100) {
|
|
|
|
- delayTime = new Date().getTime();
|
|
|
|
- }
|
|
|
|
- curTime = new Date().getTime();
|
|
|
|
duration = 24;
|
|
duration = 24;
|
|
} else if (input[0] == 0x68) {
|
|
} else if (input[0] == 0x68) {
|
|
if (input[23] == 0x5c) {
|
|
if (input[23] == 0x5c) {
|
|
@@ -380,7 +391,7 @@
|
|
ws.send(checkBuffer);
|
|
ws.send(checkBuffer);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- $.toast("画面异常,请重新进入", "text");
|
|
|
|
|
|
+ $.toast("画面异常,请重新进入3", "text");
|
|
clearInterval(intervaler);
|
|
clearInterval(intervaler);
|
|
ws.close();
|
|
ws.close();
|
|
wsss.close();
|
|
wsss.close();
|
|
@@ -417,7 +428,8 @@
|
|
return {
|
|
return {
|
|
audio: audio,
|
|
audio: audio,
|
|
video: video,
|
|
video: video,
|
|
- duration: duration
|
|
|
|
|
|
+ duration: duration,
|
|
|
|
+ frameType: frameType
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
@@ -620,7 +632,6 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- var orientation = 0; //0 竖屏,1横屏
|
|
|
|
|
|
|
|
var btnMuted = document.querySelector("#btnMuted");
|
|
var btnMuted = document.querySelector("#btnMuted");
|
|
btnMuted && (function () {
|
|
btnMuted && (function () {
|
|
@@ -758,24 +769,6 @@
|
|
btnMuted.classList.remove("hide");
|
|
btnMuted.classList.remove("hide");
|
|
})();
|
|
})();
|
|
|
|
|
|
- $(".boximg").on("click", function () {
|
|
|
|
- $(".mainbox").css({
|
|
|
|
- "display": "none"
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- // 剪贴板
|
|
|
|
- $(".sboxbu").on("click", function () {
|
|
|
|
- $(".sbox").css({
|
|
|
|
- "display": "none"
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- // 剪贴板
|
|
|
|
- $(".uploadss").on("click", function () {
|
|
|
|
- $(".sbox").css({
|
|
|
|
- "display": "none"
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
$("#upload").on("click", function () {
|
|
$("#upload").on("click", function () {
|
|
clearInterval(intervaler);
|
|
clearInterval(intervaler);
|
|
ws.close();
|
|
ws.close();
|
|
@@ -790,31 +783,6 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
- function selectText(x) {
|
|
|
|
- if (document.selection) {
|
|
|
|
- var range = document.body.createTextRange();
|
|
|
|
- range.moveToElementText(x);
|
|
|
|
- range.select();
|
|
|
|
- } else if (window.getSelection) {
|
|
|
|
- var selection = window.getSelection();
|
|
|
|
- var range = document.createRange();
|
|
|
|
- selection.removeAllRanges();
|
|
|
|
- range.selectNodeContents(x);
|
|
|
|
- selection.addRange(range);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function cp(x) {
|
|
|
|
- $(".mainbox").css({
|
|
|
|
- "display": "none"
|
|
|
|
- })
|
|
|
|
- $(".sbox").css({
|
|
|
|
- "display": "block"
|
|
|
|
- })
|
|
|
|
- selectText(x);
|
|
|
|
- document.execCommand("copy");
|
|
|
|
- }
|
|
|
|
window.onbeforeunload = function () {
|
|
window.onbeforeunload = function () {
|
|
ws.close();
|
|
ws.close();
|
|
wsss.close();
|
|
wsss.close();
|