我UIBackgroundModes在Info.plist中添加了一个属性,其数组条目为" audio",并添加了调用以设置音频会话:[session setCategory: AVAudioSessionCategoryPlayback error: &error];.
但是,我唯一的测试设备是iPod Touch 2G,它不支持多任务处理.我尝试过模拟器但是当我切换到Safari时音乐停止播放.但当我切换回我的应用程序时,歌曲继续播放到比离开应用程序时更远的位置.
它似乎继续在后台播放但我在使用其他应用程序(Safari)时没有听到我的应用程序的音频.
这是与ant build.xml一起使用的:
<mxmlc file="${module.main.dir}/main.mxml" keep-generated-actionscript="false" output="${module.output.dir}/main.swf" fork="${flex.fork}">
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<compiler.theme file="${FLEX_HOME}/frameworks/themes/Halo/halo.swc"/>
</mxmlc>
Run Code Online (Sandbox Code Playgroud)
我在项目>属性>编译器选项>附加编译器选项中尝试了以下值,但它们都没有工作:
-theme=PATH_TO/halo.swc
-compiler.theme=PATH_TO/halo.swc
-theme=file=PATH_TO/halo.swc
-compiler.theme.file=PATH_TO/halo.swc
-theme.file=PATH_TO/halo.swc
Run Code Online (Sandbox Code Playgroud)
谢谢.
目前我TimeUnit.MILLISECONDS.toSeconds(valueInMillis)用来检查两毫秒的值是否来自同一秒.你能为这项操作推荐更快的算法吗?
谢谢.