优化播放程序,缩短播放加载时间

This commit is contained in:
Lawrence
2020-11-07 16:54:42 +08:00
parent 366d57b2b3
commit f68cfd8de2
3 changed files with 54 additions and 43 deletions

View File

@@ -223,7 +223,7 @@ export default {
play: function (streamInfo, hasAudio) {
this.hasaudio = hasAudio;
// 根据媒体流信息二次判断
if (!!streamInfo.tracks && streamInfo.tracks.length > 0) {
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音频