Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试了几个代码,但没有一个起作用。传统的播放音频标签也不起作用。我想简单地在 html 页面上嵌入背景音频,我不想看到播放器图形。我想我需要Javascript。我需要一个以“将这段代码添加到 html 文件的标题部分”开头的代码帮助。
答案是你不能这样做,没有用户操作。
您使用 JavaScript 查看的普通脚本不会在 ios 设备上自动播放。您需要有一个用户操作,例如开始播放音频的单击开始按钮。