页面修改
This commit is contained in:
@@ -178,7 +178,7 @@ function doPlayer(nodeData: any, index: number = 0) {
|
||||
console.log('index=', index);
|
||||
if (mpegts.isSupported()) {
|
||||
streamProxy(nodeData, (res: AddStreamProxyResult) => {
|
||||
const url = res.wsFlv;
|
||||
const url = res.flv;
|
||||
// 将url 绑定到 nodeData
|
||||
nodeData.url = url;
|
||||
closePlayer(index);
|
||||
|
@@ -305,7 +305,7 @@ function doPlayer(nodeData: any, index: number = 0) {
|
||||
console.log('index=', index);
|
||||
if (mpegts.isSupported()) {
|
||||
streamProxy(nodeData, (res: AddStreamProxyResult) => {
|
||||
const url = res.wsFlv;
|
||||
const url = res.flv;
|
||||
// 将url 绑定到 nodeData
|
||||
nodeData.url = url;
|
||||
closePlayer(index);
|
||||
@@ -371,10 +371,25 @@ function closePlayer(index: number) {
|
||||
}
|
||||
}
|
||||
|
||||
function catchUp() {
|
||||
playerList.forEach((playerData) => {
|
||||
if (playerData) {
|
||||
const { player, el } = playerData;
|
||||
const end = player.buffered.end(player.buffered.length - 1);
|
||||
const diff = end - el.currentTime;
|
||||
if (diff > 2) {
|
||||
// 如果延迟超过2秒
|
||||
el.currentTime = end - 0.5; // 跳转到接近直播点
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let isSupportH265 = false;
|
||||
onMounted(() => {
|
||||
// 检测浏览器是否支持h265
|
||||
isSupportH265 = checkHEVCSupport();
|
||||
setInterval(catchUp, 10000);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
Reference in New Issue
Block a user