修复无音频通道开启通道音频后无法播放的bug

修复点播接口真的收到视频后回复
This commit is contained in:
648540858
2020-10-13 18:55:42 +08:00
parent f9ab13a145
commit fbdad00cdb
6 changed files with 193 additions and 79 deletions

View File

@@ -124,6 +124,18 @@
play: function(streamInfo, deviceId, channelId, hasAudio) {
console.log(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;
}
console.log("111")
console.log(this.hasaudio)
this.ssrc = streamInfo.ssrc;
this.deviceId = deviceId;
this.channelId = channelId;