I would like to launch directly to the YouTube player on Windows Phone 7.
I tried using WebBrowserTask and giving a YouTube URL, it opens up the browser and brings me to a page with a thumbnail of the YouTube video, I need to click on the thumbnail before the video plays.
I like to skip the extra click. I like the user to click a button in my app, and it should play the video directly. Is there a way to do it?
Once you have the Youtube app installed, from within you application you can start the WebBrowserTask and do the follwing:
Regex Youtube = new Regex("youtu(?:\\.be|be\\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]+)");
Match youtubeMatch = Youtube.Match(YOUTUBE_VIDEO_URL);
string id = string.Empty;
if (youtubeMatch.Success)
id = youtubeMatch.Groups[1].Value;
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.URL = "vnd.youtube:"+ id +"?vndapp=youtube_mobile";
webBrowserTask.Show();
That should launch the browser, then automatically launch the Youtube App. Cheers!
Finally I've worked out a clean solution (without browser task, and no "double back key pressing"):
http://mytoolkit.codeplex.com/wikipage?title=YouTube
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With