3

Is there a way this can be accomplished?

I might have a solution from this answer:

You can also grab YouTube videos as MP4, hopefully that expands your player options. You can look into DirectShow CF for playback functionality, or host some other player in your app that supports MP4 or FLV.

Trying to play it back through IE mobile won't work, as the version necessary of the Flash plug-in with video playback support isn't available (last time I checked).

To get the MP4 file make a request to this URL:

"http://www.youtube.com/get_video?video_id=" + videoID + "&t=" + token + "&fmt=18"

To get the FLV use this:

"http://www.youtube.com/get_video?video_id=" + videoID + "&t=" + token

To get the Token call this:

"http://www.youtube.com/api2_rest?method=youtube.videos.get_video_token&video_id=" + videoID

I wrote an app that would grab a playlist of YouTube videos and sync them up with my PocketPC, I used TCPMP with the Flash add-on to playback the video (externally from my app). Although MP4 also worked on the PPC, I stuck to FLVs because at the time some videos on YouTube were not available as MP4. I wouldn't be concerned about this now.

Sadly my PPC broke, now I'm doing something similar on my iPhone but I had to switch completely to the MP4 format. VLC's FLV playback on the iPhone was too jerky for me.

Playing YouTube videos in a Windows Mobile application

Community
  • 1
  • 1
WinFXGuy
  • 1,527
  • 7
  • 26
  • 47
  • I saw some examples online that play youtube videos in Silverlight, but all of them are OOB applications. I need a solution for in browser application. – WinFXGuy Dec 27 '10 at 03:11

2 Answers2

0

It's not possible to play a YouTube video natively in Silverlight (and I don't think it will ever be). The closest thing you can do is use the JS interface and this'll fire up the devices native video player (if it's a mobile device) or play using Flash.

You can steal the FLV feeds, but that's very bad and you shouldn't do that!

Ahmed Nuaman
  • 12,662
  • 15
  • 55
  • 87
-1

You can solve the issue by using a media element. A media element can play a audio or video or both. See here for more details. http://msdn.microsoft.com/en-us/library/bb980132%28v=vs.95%29.aspx

Harish
  • 228
  • 1
  • 7