MediaElement doesn’t play MP4 Streams on Windows Phone 7

I was little bit disappointed as I saw that the latest Windows Phone Developer Tools CTP - April Refresh doesn’t bring much new stuff that I can play with (Microsoft.Phone Namespace stayed same, no new features, no Sensors in Emulator etc), so I took the Silverlight for Phone.

Silverlight is very powerful in Media Content, so I thought it would be cool if I play a little bit with Streaming Media … aaaaand of course if you are talking about Streaming Media, it is almost impossible not to think about YouTube.com.

So I used YouTube’s API to get the Direct Stream of some Video with following Parameters:

Video ID: j9F4QJK1wFs
Token: vjVQa1PpcFM_C7Hr7areyreHHzULy--u-F7-yaPsOCg%3D
Format: 18 (Video Download Format: MP4)

Gives the Stream URL of: http://www.youtube.com/get_video.php?video_id=j9F4QJK1wFs&t=vjVQa1PpcFM_C7Hr7areyreHHzULy--u-F7-yaPsOCg%3D&fmt=18 

Changed the Source of MediaContent Control as floowing:

playMedia.Source =
new Uri("http://www.youtube.com/get_video.php
?video_id=j9F4QJK1wFs
&t=vjVQa1PpcFM_C7Hr7areyreHHzULy--u-F7-yaPsOCg%3D
&fmt=18"
, UriKind.Absolute);

Sadly but true, current release of Silverlight for Windows Phone April CTP is not showing anything on the Phone Emulator. The same Code/Source on normal Silverlight for Desktop is working perfectly and very fast!
If you change the Source and set some .wmv file (lets say from Channel9), it works like a charm.

I just hope this will change in next Releases or at least on the Release version of Windows Phone 7 Series …


Posted May 17 2010, 10:32 AM by Armin Kalajdzija
developers.de is a .Net Community Blog powered by daenet GmbH.