fix: 网页播放audio获取到错误url无法播放时提醒用户 (#280)

This commit is contained in:
52fisher 2024-12-01 12:33:05 +08:00 committed by GitHub
parent 441fffd59e
commit 865b412fb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
});
});