首页 > 解决方案 > Safari 浏览器 audio.play() 不工作

问题描述

我正在使用以下音频标签<audio id="player"></audio>,并且在 jquery 中我使用过
var player = document.getElementById('player'); player.src ='/ajax.php'; player.play();

Safari 浏览器显示以下错误且未播放音频。Unhandaled promise Rejection: NotSupportedError: The Operation is not supported

我已经搜索了这个,但没有得到任何适当的解决方案。有谁知道解决方案?提前致谢。

标签: javascriptjqueryiossafarihtml5-audio

解决方案


请检查静音设置。

  Unmute, if it is set to mute.
  https://support.apple.com/kb/PH21463?locale=en_US

推荐阅读