Audio 如何使用firefox操作系统在后台播放音频?

Audio 如何使用firefox操作系统在后台播放音频?,audio,permissions,html5-audio,lockscreen,firefox-os,Audio,Permissions,Html5 Audio,Lockscreen,Firefox Os,在我的清单文件中,我在权限中添加了音频频道内容: "permissions": { "audio-channel-content":{"description":"Use the audio channel for the music player"} } 在我的index.html中,我有一个音频标记,如: <audio mozaudiochannel="content" preload="none" src="http://my-stream-url"></aud

在我的清单文件中,我在权限中添加了音频频道内容:

"permissions": {
    "audio-channel-content":{"description":"Use the audio channel for the music player"}
}
在我的index.html中,我有一个音频标记,如:

<audio mozaudiochannel="content" preload="none" src="http://my-stream-url"></audio>

我可以在2mn期间播放音频流:

  • 手机解锁时的第一个
  • 1分钟后,我的手机会自动锁定屏幕,并继续播放一分钟
锁定后是否可以播放此音频流超过1mn


提前感谢。

您的代码和权限块是正确的,我可以确认它在Firefox OS 1.1中工作。您还可以使用Javascript完成整个过程:

audio = new Audio();
audio.preload = 'none';
audio.mozAudioChannelType = 'content';

是因为wifi在屏幕关闭(自动锁定)后关闭


您正在使用gaia的开发版本吗?Wifi在产品版本中设置为始终连接。

我使用的是geeksphone peak,boot2Gecko 1.2.0.0-prerelease。我不知道手机上的wifi是否断开了锁定1.2.0.0-prerelease是一个开发版本。Boot2Gecko 1.2.0.0-prerelease是否等同于Firefox OS 1.2?