Skip to content

Commit

Permalink
fix: 网页播放audio获取到错误url无法播放时提醒用户 (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
52fisher authored Dec 1, 2024
1 parent 441fffd commit 865b412
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xiaomusic/static/default/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,10 @@ $(function(){
var minutes = Math.floor(seconds / 60);
var remainingSeconds =Math.floor(seconds % 60);
return `${minutes.toString().padStart(2, '0')}:${remainingSeconds.toString().padStart(2, '0')}`;
}
}

$("audio").on("error", (e) => {
console.log('app.js:441 e.currentTarget.error.code,e.currentTarget.error.message', 'color: #007acc;', e.currentTarget.error.code,e.currentTarget.error.message);
alert(e.currentTarget.error.code==4 ? "无法打开媒体文件,XIAOMUSIC_HOSTNAME地址错误,请重新设置" : "在线播放失败,请截图反馈: "+e.currentTarget.error.message);
});
});

0 comments on commit 865b412

Please sign in to comment.