流音频运行欠锁 [英] Streaming audio running underlock

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

问题描述

我正在尝试使用以下方法在锁定屏幕下播放流音频PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;使用简单的 mp3 文件一切正常,但流式音频(如网络广播)停止播放.如何解决这个问题?

I am trying to play streaming audio under lock screen using PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; With simple mp3 file everything works, but streaming audio (like internet radio) stops playing. How to resolve this problem?

更新:我发现了问题.我使用这样的链接:mms://212.235.5.168/102fm?ext=.mp3 并且问题更改为 mms://212.235.5.168/102fm/File.mp3 解决了这个问题.因此,所有末尾带有查询字符串的链接都将在锁定状态下停止播放.

Update: I found the problem. I use my links like this: mms://212.235.5.168/102fm?ext=.mp3 and that the problem changing to mms://212.235.5.168/102fm/File.mp3 solved the problem. So all links that have query string at the end stop playing under lock.

推荐答案

我也在直播 Icecast 直播,这对我有用:

Hi I'm also streaming live Icecast stream, and this works for me:

MessageBoxResult res = MessageBox.Show(Constants.MSG_LOCKED_BODY, Constants.MSG_LOCKED_TITLE, MessageBoxButton.OKCancel);

        if (res == MessageBoxResult.OK) {
            PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
        }

我正在通过 Global App 成员 MediaElement 进行流式传输,也许您应该试试这个...

I'm streaming via MediaElement which is Global App member, maybe you should try this...

<Application.Resources>
    <MediaElement
    x:Key='mediaElement' Volume='1' AutoPlay='True'/>
</Application.Resources>

这篇关于流音频运行欠锁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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