我读了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/