Commit 2589c5fac8827f281df618e10335ab8dec17c402

Authored by Lawrence
1 parent 54704e1e

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

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