windows-phone-7 - 从通用音量控制检测应用程序启动

标签 windows-phone-7 deep-linking windows-phone-7.1 background-agents universal-volume-control

我有一个针对芒果设备的应用程序,它通过 BackgroundAudioAgent 播放音乐。因此,它与通用音量控制 (UVC) 集成。

有没有办法通过点击 UVC 中的艺术家详细信息来检测应用程序何时启动?

或者,有没有办法为 UVC 设置深层链接以使用?

我想要这样,当应用程序通过 UVC 启动时,我可以将用户带到“正在播放”页面,而不是主页面。

更新
这也会影响从音乐和视频中心中正在播放的磁贴启动应用程序,因为 BackgroundAudioPlayer 会自动与中心的这一部分集成。

最佳答案

使用 MediaHistory Zune Hub 集成解决了这个问题。它还通过了 RC SDK 中的 Marketplace Test Kit 功能测试步骤,因此这是一个好兆头。

如果从MSDN上的例子开始,从GetNextTrack()调用以下代码和 GetPreviousTrack()在后台音频代理中意味着当您单击 UVC 或 Zune Now Playing 时,您可以取回您在此处指定的导航查询字符串......

    private AudioTrack ChangeTrack()
    {
        AudioTrack track = _playList[currentTrackNumber];

        IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
        Stream s = isoStore.OpenFile("ApplicationIcon.png", FileMode.Open);

        MediaHistoryItem nowPlaying = new MediaHistoryItem();
        nowPlaying.Title = "Background Audio is playing!";
        nowPlaying.ImageStream = s;
        nowPlaying.PlayerContext.Add("keyString", track.Title);
        MediaHistory.Instance.NowPlaying = nowPlaying;

        return track;
    }

关于windows-phone-7 - 从通用音量控制检测应用程序启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7159900/

相关文章:

c# - 自定义列表的 indexof 函数

c# - XmlConvert.ToDateTime Windows Phone 7

c# - WP7 中的 HttpWebRequest 超时

windows-phone-7 - Windows Phone 7 中的推送通知问题

具有深度链接的 iOS 9 搜索功能

android - 如何使用 branch.io 显示排行榜(每周重置一次)

android - Google App Indexing 页面查看记录是否在本地工作?

audio - 检测麦克风/耳机?

c# - 如何在 Windows Phone 7.1 中打开文件?