在 Mobile Safari 上自动播放音频文件 [英] Autoplay an Audio File on Mobile Safari

查看:54
本文介绍了在 Mobile Safari 上自动播放音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个小型系统仪表板网络应用程序,其中包含警报通知.我在移动 Safari 上使用它已经有一段时间了,但最近想在闹钟通知中添加音频,以便我可以轻松知道何时有闹钟,而且我没有直接看显示屏.

I've got a little system dashboard web app that I've written, replete with alarm notifications. I've had it working for quite some time on mobile safari, but recently wanted to add audio to the alarm notifications to allow me to easily know when there are alarms and I'm not looking directly at the display.

警报通知是通过(相对)不断轮询的 ajax 请求填充的,如果存在警报,该请求会拉入并显示警报横幅.我也想添加一个自动播放的闹钟"声音,但没有为 Safari Mobile 添加骰子.

The alarm notifications are populated through a (relatively) constantly polling ajax request that pulls in and displays an alarm banner if alarms are present. I wanted to add an auto-playing 'alarm' sound as well, but no dice for Safari Mobile.

我尝试过使用 HTML5 和嵌入对象,但无济于事.Apple 文档确实声明您不能自动播放音频文件,必须通过用户操作激活它以节省带宽.

I've tried using HTML5 and embedded objects with no avail. The Apple documentation does state that you can't auto-play an audio file and it must be activated through user action to conserve bandwidth.

有没有人在 WLAN 设置中找到解决方法?

Has anyone found a way around this in a WLAN setting?

推荐答案

我想这是不可能的,事实上,我希望如此.不适合您,我相信您会出于好目的使用它,但我真的不希望允许网站自动播放音频文件.

I guess that it's impossible, in fact, I hope so. Not for you, I'm sure that you'll use it for a good purpose, but I really don't want allow sites to auto-play audio files.

哦,我想起来了……Flash 可以做到!

Oh, I remember something... It's possible with Flash!

这篇关于在 Mobile Safari 上自动播放音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆