Commit 2589c5fac8827f281df618e10335ab8dec17c402

Authored by Lawrence
1 parent 54704e1e

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

web_src/src/components/gb28181/devicePlayer.vue
@@ -223,15 +223,15 @@ export default { @@ -223,15 +223,15 @@ export default {
223 play: function (streamInfo, hasAudio) { 223 play: function (streamInfo, hasAudio) {
224 this.hasaudio = hasAudio; 224 this.hasaudio = hasAudio;
225 // 根据媒体流信息二次判断 225 // 根据媒体流信息二次判断
  226 + var realHasAudio = false;
226 if (!!streamInfo.tracks && streamInfo.tracks.length > 0 && hasAudio) { 227 if (!!streamInfo.tracks && streamInfo.tracks.length > 0 && hasAudio) {
227 - var realHasAudio = false;  
228 for (let i = 0; i < streamInfo.tracks.length; i++) { 228 for (let i = 0; i < streamInfo.tracks.length; i++) {
229 if (streamInfo.tracks[i].codec_type == 1 && streamInfo.tracks[i].codec_id_name == "CodecAAC") { // 判断为AAC音频 229 if (streamInfo.tracks[i].codec_type == 1 && streamInfo.tracks[i].codec_id_name == "CodecAAC") { // 判断为AAC音频
230 realHasAudio = true; 230 realHasAudio = true;
231 } 231 }
232 } 232 }
233 - this.hasaudio = realHasAudio && this.hasaudio;  
234 } 233 }
  234 + this.hasaudio = realHasAudio && this.hasaudio;
235 this.ssrc = streamInfo.ssrc; 235 this.ssrc = streamInfo.ssrc;
236 // this.$refs.videoPlayer.hasaudio = hasAudio; 236 // this.$refs.videoPlayer.hasaudio = hasAudio;
237 // this.videoUrl = streamInfo.flv + "?" + new Date().getTime(); 237 // this.videoUrl = streamInfo.flv + "?" + new Date().getTime();