从通用音量控制检测应用程序启动 [英] Detect application launch from Universal Volume Control

本文介绍了从通用音量控制检测应用程序启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have an application, targeting mango devices, which plays music via a BackgroundAudioAgent. As such it integrates with the universal volume control (UVC).

是否有一种方法可以通过在UVC中点击艺术家的详细信息来检测何时启动该应用程序?

Is there a way to detect when the application is launched by tapping the artists details in the UVC?

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

Alternatively, is there a way to set a deep link for the UVC to use?

我想要这样做,以便在通过UVC启动应用程序时将用户带到正在播放"页面,而不是主页.

I want this so that I can take the user to the "Now playing" page, rather than the main page, when the app is launched via the UVC.

更新
这也会影响从音乐与应用"中当前正在播放的磁贴中启动应用程序视频集线器作为BackgroundAudioPlayer会自动与集线器的这一部分集成.

Update
This also affects launching the app from the now playing tile in the Music & Video hub as the BackgroundAudioPlayer automatically integrates with this part of the hub.

推荐答案

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

Using MediaHistory Zune Hub integration solves this problem. It also passes the Marketplace Test Kit capability test step in the RC SDK, so that’s a good sign.

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

If you start from the example on MSDN, calling the following code from GetNextTrack() and GetPreviousTrack() in the background audio agent means that when you click UVC or Zune Now Playing you can get back the navigation query string you specify here…

    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;
    }

这篇关于从通用音量控制检测应用程序启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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