-
-
+
@@ -123,20 +122,17 @@
methods: {
play: function(streamInfo, deviceId, channelId, hasAudio) {
- // this.hasaudio = hasAudio;
- if (!hasAudio) { // hasaudio == false时设置播放器hasaudio false, 否则不设置
- this.hasaudio = hasAudio;
- }
+ this.hasaudio = hasAudio;
// 根据媒体流信息二次判断
- // if( this.hasaudio && !!streamInfo.tracks && streamInfo.tracks.length > 0) {
- // var realHasAudio = false;
- // for (let i = 0; i < streamInfo.tracks; i++) {
- // if (streamInfo.tracks[i].codec_type == 1) { // 判断为音频
- // realHasAudio = true;
- // }
- // }
- // this.hasaudio = realHasAudio && this.hasaudio;
- // }
+ if( this.hasaudio && !!streamInfo.tracks && streamInfo.tracks.length > 0) {
+ var realHasAudio = false;
+ for (let i = 0; i < streamInfo.tracks; i++) {
+ if (streamInfo.tracks[i].codec_type == 1) { // 判断为音频
+ realHasAudio = true;
+ }
+ }
+ this.hasaudio = realHasAudio && this.hasaudio;
+ }
this.ssrc = streamInfo.ssrc;
this.deviceId = deviceId;
this.channelId = channelId;