朝中措 · 崇福寺道中,归寄佑之弟, 辛弃疾 ,宋代, 篮舆袅袅破重冈,玉笛两红妆。
这里都愁酒尽,那边正和诗忙。
为谁醉倒,为谁归去,都莫思量。
白水东边篱落,斜阳欲下牛羊。
// 状态1:音频正在播放 → 暂停
if (audio && !audio.paused) {
audio.pause();
btn.innerText = "朗读";
btn.style.backgroundColor = '';
btn.style.color = '#000';
return;
}
// 状态2:音频已暂停 → 尝试继续播放,加catch兜底
if (audio && audio.paused) {
audio.play().then(()=>{
btn.innerText = "暂停";
btn.style.backgroundColor = 'green';
btn.style.color = 'white';
}).catch(e=>{
console.error("续播失败Safari限制:",e);
alert("苹果浏览器续播受限,将重新生成音频");
audio = null;
btn.innerText = "朗读";
btn.style.backgroundColor = '';
btn.style.color = '#000';
})
return;
}
|