最小化Windows 10 Universal时背景音频停止播放 [英] Background audio stops playing when minimize windows 10 universal

查看:66
本文介绍了最小化Windows 10 Universal时背景音频停止播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用mediaElement为AudioCategory = BackgroundCapableMedia的音频输出创建了一个Windows 10广播应用程序,但是每当我最小化桌面或移动设备上的应用程序时,音频就会停止播放.那么,在最小化之后如何保持音频的活力呢?我发现的所有示例都是针对8.1 silverlight应用程序的

I created an radio app for windows 10 using mediaElement for audio output with AudioCategory = BackgroundCapableMedia but whenever I minimize the app on desktop or mobile the audio stops playing. So how do I keep the audio alive after I minimize? And all examples I find is for 8.1 silverlight applications

推荐答案

您需要实施一个后台任务,以在最小化您的应用程序时保持音频的活动.

You need to implement a Background Task to keep audio alive when your application is minimized.

您可以在github上找到针对Windows 10的示例.该项目分为3个部分(a/您的主应用程序b/后台任务和c/两个前两个项目之间共享的代码)

You can find a sample which targets Windows 10 on github. The project is splitted in 3 parts (a/ your main application b/ the background task and c/ code shared between the two first projects)

背景音频示例

此外,您可以在MSDN上找到与此样本相关的文档.

In addition, you can find documentation associated to this sample on MSDN.

背景音频

如果您需要其他信息,请告诉我.

Please let me know if you need additional information.

这篇关于最小化Windows 10 Universal时背景音频停止播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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