BackgroundAudioPlayer ScheduledActionService [英] BackgroundAudioPlayer ScheduledActionService

查看:76
本文介绍了BackgroundAudioPlayer ScheduledActionService的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对backgroundaudioplayer有疑问。我尝试在无线电应用程序中实现一个计时器,用户可以设置到期时间(5,10或30分钟),当计时器达到到期时间时,玩家必须停止。是否可以使用ScheduledActionService实现此



Gruß,Charly43

I have a question to backgroundaudioplayer. I try to implement a timer in a radio app where the user can set the expiration time (5, 10 or 30 minutes) and when the timer reached the expiration time the player must be stop. Is it possible to implement this with a ScheduledActionService


Gruß, Charly43

推荐答案

您需要多精确...?

How precise do you need to be...?

如果精确度不是很大,那么您的AudioPlayerAgent可以跟踪"到期"时间并简单地停止新的计划跟踪......

If precision is not a big deal then your AudioPlayerAgent could keep track of the 'expiration' time and simply stop scheduling new tracks...

为了获得更高的精确度,您可以在自定义的MediaStreamSource实现中执行类似操作...

For higher precision you may be able to do something similar in a custom MediaStreamSource implementation...

FYI:

基于时间的操作(如提醒和警报)不会运行您的代码(除非用户点击对话框以打开您的应用程序。)

Time based actions, like Reminder and Alarm, do not run your code (unless the user taps on the dialog to open your application.)

后台代理哪些运行代码,如PeriodicTask和ResourceIntensiveTask,不能使用BackgroundAudio API。

Background agents which do run code, like PeriodicTask and ResourceIntensiveTask, cannot use the BackgroundAudio API.


这篇关于BackgroundAudioPlayer ScheduledActionService的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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