Home » Launch Metrotube’s YouTube player from within your app
LAUNCH METROTUBE’S YOUTUBE PLAYER FROM WITHIN YOUR APP
We’ve implemented a custom ‘URI schema’ giving Windows Phone 8 developers the ability to take advantage of our YouTube playback experience.
Rather than passing your users onto m.youtube.com when they click on a YouTube link, you can use our URI to automatically launch Metrotube’s player.
Here are some of the awesome apps that you can expect to see integrating with Metrotube:
How to implement this within your app
Launch Metrotube via the following URI schema:
Video playback:
metrotube:VideoPage?VideoID={id}Search:
metrotube:SearchPage?Query={searchTerm}&Section;={Author/Video/Playlist}Launch App:
metrotube:MainPage
For example:
Windows.System.Launcher.LaunchUriAsync(new System.Uri(“metrotube:VideoPage?VideoID=V-4ORQaInzk”));
Alternatively, instead of the VideoID parameter, you can also use a Url parameter to pass in the video link (which needs to be url encoded) and leave it for us to parse.
For example:
Passing in the full video link for the video being launched in the previous example (http://www.youtube.com/watch?v=V-4ORQaInzk) can be achieved like this:
Windows.System.Launcher.LaunchUriAsync(new System.Uri(“metrotube:VideoPage?Url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DV-4ORQaInzk”));
To search for ‘soccer’ videos:
Windows.System.Launcher.LaunchUriAsync(new System.Uri(“metrotube:SearchPage?Query=Soccer”));
To search for an Author:
Windows.System.Launcher.LaunchUriAsync(new System.Uri(“metrotube:SearchPage?Query=WindowsPhone&Section;=Author”));
What happens if a user doesn’t have Metrotube installed?
If a user doesn’t have Metrotube installed, a popup will display prompting them that they need to install an app for the given task. Once actioned, they will be directed to the Windows Phone Store and Metrotube will be available for them to install.
We highly recommend that you give your users the option to choose how they wish to browse YouTube content as they may not want to install a dedicated app.
For example:
On initial attempt, give users the option to chose between m.youtube.com or Metrotube as the default browsing behavior.
It would also be a good idea to open up an option within your app’s setting screens and mention this can be changed at any time in the event the user changes their mind.
Further information on URI association can be found via msdn website
Otherwise, feel free to get in touch with directly and we’ll help you out!
DOWNLOAD