Today the Smooth Streaming Client was updated to also work for the Windows Phone 7 and looking in to video streaming for an upcoming project this was indeed very good news. (Lets just hope the Silverlight Media Framework will be upgraded as well!) The first test I did was to check how easy it would be to at least add and view a streaming file in Windows Phone 7.
In my case I wanted to check if it was possible to play in a mixed view, not only a full screen video view. So I created a simple application with both a video and some surrounding text. Looking something like the image to the right, with live video in the small player.
First things first, download the client software from the above link and install it. After that add a reference to Microsoft.Web.Media.SmoothStreaming and add the reference in the XAML as well:
xmlns:ss="clr-namespace:Microsoft.Web.Media.SmoothStreaming;
assembly=Microsoft.Web.Media.SmoothStreaming"
The its just a matter of adding the SmoothStreamingMediaElement in the code and point the SmoothStreamingSource to a smooth streaming video source. However, here comes a little problem (that a proper prototype would have solved, hrm, Microsoft). The emulator doesn't support that many codecs, even if the phones will support a lot. But a normal SD quality VMA encoded smooth streaming source did the trick for me. The MSDN documentation has most of the information needed to get it right. My final bits an pieces for the smooth streaming media element lookes like this:
<ss:SmoothStreamingMediaElement
AutoPlay="True"
SmoothStreamingSource="http://<server>/<file>.ism/Manifest"
Height="98" />
Of course the [server] and [file] content should be set to something you have access to. The biggest problem for me was to get hold of an appropriate stream source, luckily for me (as I didn’t have the time to set one up myself nut it shouldn’t be that hard) I was able to use a stream from an internal project just to test things out.
As soon as I get my hands on the real hardware I will try it with Big Buck Bunny…
// Håkan Reis