修正不同终端开关音频设置不同引起播放问题的bug

pull/1/head
Lawrence 2020-11-09 18:44:35 +08:00
parent 54704e1e6a
commit 2589c5fac8
1 changed files with 2 additions and 2 deletions

View File

@ -223,15 +223,15 @@ export default {
play: function (streamInfo, hasAudio) {
this.hasaudio = hasAudio;
//
var realHasAudio = false;
if (!!streamInfo.tracks && streamInfo.tracks.length > 0 && hasAudio) {
var realHasAudio = false;
for (let i = 0; i < streamInfo.tracks.length; i++) {
if (streamInfo.tracks[i].codec_type == 1 && streamInfo.tracks[i].codec_id_name == "CodecAAC") { // AAC
realHasAudio = true;
}
}
this.hasaudio = realHasAudio && this.hasaudio;
}
this.hasaudio = realHasAudio && this.hasaudio;
this.ssrc = streamInfo.ssrc;
// this.$refs.videoPlayer.hasaudio = hasAudio;
// this.videoUrl = streamInfo.flv + "?" + new Date().getTime();