Can Xbox music deep links redirect to the windows 8 music player?

276 Views Asked by At

I'm specifically working with Xbox music deep and the windows 8 music player, but I think this a more general question of redirection from browser to app. I am building deep links to xbox music based on the instructions here: http://msdn.microsoft.com/en-us/library/dn546675.aspx When I click on a link like this: http://music.xbox.com/Track/768E1306-0100-11DB-89CA-0019B92A3933?action=play I would expect that if I am on windows 8 and have the music app installed it would go their rather than in the browser (or that it would redirect). At minimum I'd like to be able to open to the same browser window each time I click on a link. It looks like itunes does something closer to what I'd like by using a target="itunes_store" in the link (it opens in the browser but then asks to open the itunes app) but I don't see anything similar document by xbox music.

Here's what I'm seeing:

I can paste a link like the one above into IE's address bar (either desktop or the win8 app) and it will ask me if I want to open the music app, this also works if I click on the link within another windows8 app like the mail application or if I launch using Windows.System.Launcher.LaunchUriAsync from my own windows 8 application.

However, if I click on the same link in a web page it brings up the web version of xbox music with the "Try Xbox Music" banner, which I can then click to bring me to the windows 8 application. At that point IE seems to cache some state because any subsequent links that I click go directly to the web version without the banner, and furthermore pasting into the address bar or launching from another winodows8 application now brings me to the web version. Closing down all instances of the browser gets me back to the original state.

The web version of the xbox music application is pretty slick, but I'd like to understand how to get application version to open consistently if at all possible. Is there a different protocol for linking to content to be opened in a windows 8 application? Is there a reason that I get a different behavior from a link typed into the address bar of IE vs. clicking on a link with the same URL (I played with target options, but didn’t find one that got me to the message to open the application).

2

There are 2 best solutions below

8
On

The link works fine for me on Windows 8. Are you sure you have the app installed properly?

Instead of putting it in a browser, you might try using a button and calling Windows.System.Launcher.LaunchUriAsync(new Uri(yourUrl));

Alternatively, you might try using my Xbox.Music library on NuGet (http://www.nuget.org/packages/xbox.music), as I think it handles this for you.

HTH!

0
On

It looks like the xbox music team has updated the deep link api to include a specific target attribute, which solves the problem. By adding target=app to the link above I am consistently being redirected to the application. So the 'fixed' version of my example url is:

http://music.xbox.com/Track/768E1306-0100-11DB-89CA-0019B92A3933?action=play&target=app