|
@@ -17,7 +17,7 @@ const playList = [
|
|
|
key: "webrtc",
|
|
|
text: "webrtc 播放器",
|
|
|
description: "延迟较低的播放器,需要浏览器支持",
|
|
|
- support: ['h264'],
|
|
|
+ support: ['h264', 'h265'],
|
|
|
disable: false
|
|
|
},
|
|
|
{
|
|
@@ -142,17 +142,18 @@ export default {
|
|
|
},
|
|
|
findPlayer(videoType, audioType)
|
|
|
{
|
|
|
+ console.log(`search player ${videoType}, ${audioType}`)
|
|
|
return playList.find(item => {
|
|
|
// 判断播放器是否同时支持 视频与音频
|
|
|
if (item.support.includes(videoType) &&
|
|
|
item.support.includes(audioType))
|
|
|
{
|
|
|
return true;
|
|
|
- } else if (item.support.includes(videoType))
|
|
|
+ }
|
|
|
+ else if (item.support.includes(videoType))
|
|
|
{
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -260,13 +261,17 @@ export default {
|
|
|
this.fps = fps;
|
|
|
if (isFirst) {
|
|
|
if (isH265) {
|
|
|
- let h265Player = this.findPlayer();
|
|
|
- console.log("265视频流,切换为默认播放器");
|
|
|
- this.activePlayer = h265Player.key;
|
|
|
- } else {
|
|
|
- console.log("使用默认播放器");
|
|
|
- this.activePlayer = playList[0].key;
|
|
|
+ // 判断是否为
|
|
|
+ let h265Player = this.findPlayer(isH265?'h265':'h264');
|
|
|
+ if (h265Player)
|
|
|
+ {
|
|
|
+ console.log("265视频流,切换为默认播放器");
|
|
|
+ this.activePlayer = h265Player.key;
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
+ console.log("使用默认播放器");
|
|
|
+ this.activePlayer = playList[0].key;
|
|
|
}
|
|
|
}
|
|
|
} else {
|