windows-phone-7 - WP7后台音频代理播放状态

标签 windows-phone-7 events audio agent

我读了instructions here about WP7 background audio player agent .我以为代理端只有 1 个未知事件和 1 个正在播放的事件

但是,当我在 OnPlayStateChanged 中记录事件时代理的,使用

System.Diagnostics.Debug.WriteLine(player.PlayerState.ToString();

播放新轨道时,我收到 2 个未知事件和 3 个正在播放事件

很奇怪,这是为什么呢?

P/S:我使用 MSDN 上的代码示例 How to: Play Background Audio for Windows Phone

最佳答案

感谢彼得托尔,我找到了原因

Due to the asynchronous nature of media playback, you should use the arguments to the OnPlayStateChanged callback to drive your logic. You shouldn’t need to query the player (that is mostly for the foreground app to display UI).

关于windows-phone-7 - WP7后台音频代理播放状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13026913/

相关文章:

c# - 如何访问 Windows Phone 7 中的联系人列表?

asp.net - 如何在 Windows Phone 中开发 Google map

video - mpegts 是如何工作的

c# - 我可以使用 NavigationContext.QueryString 设置参数吗? (Windows 手机)

c# - 如何创建其他可观察集合的可观察集合? MVVM 模式

vue.js - 如何在 Vue 中创建自定义 lodash throttle 事件修饰符?

用于传递具有继承层次结构的事件的 C++ 系统

javascript - 如何在 jQuery 中处理输入类型 = 文件的 onchange 事件?

python - 有什么方法可以在不将视频保存到本地的情况下从视频URL中提取音频吗?

audio - 使用MediaFoundationReader时出现COMException