开发者

Detect application launch from Universal Volume Control

开发者 https://www.devze.com 2023-03-30 05:29 出处:网络
I have an application, targeting mango devices, which plays music via a BackgroundAudioAgent. As such it integrates with the universal volume control (UVC).

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

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

Alternatively, is there a way t开发者_如何学Goo set a deep link for the UVC to use?

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.

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.


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.

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号