This article is a walkthrough of enabling smooth streaming of media over IIS and then streaming over a Silverlight client. There is very good documentation available in the official IIS site that provides a better understanding of smooth streaming. So I am not covering the theoretical concepts of smooth streaming in this article. However I have shown step by step how to enable smooth streaming of media over IIS, then to stream over a Silvelight client.Essentially there are four majors steps you need to do:
<UserControl x:Class="SilverlightStreaming.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:strmmedia="http://schemas.microsoft.com/smf/2010/xaml/player" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <StackPanel Orientation="Vertical"> <TextBlock Text="Streaming Media from IIS on Silverlight" Height="22" Width="266" FontSize="12" Foreground="Blue"/> <strmmedia:SMFPlayer Name="strmPlayer" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Stretch" Height="261" Width="395"/> </StackPanel> </Grid></UserControl> Step 6:We need to write some code on the page load to create a play list of streamed media to be played in the player. Mainpage.xaml .csusing System;using System.Windows.Controls;using Microsoft.SilverlightMediaFramework.Core.Media;namespace SilverlightStreaming{ public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); PlaylistItem item = new PlaylistItem(); item.MediaSource = new Uri("http://dhananjay-pc:7654/wildlife.ism/manifest"); item.DeliveryMethod = Microsoft.SilverlightMediaFramework.Plugins.Primitives.DeliveryMethods.AdaptiveStreaming; strmPlayer.Playlist.Add(item); strmPlayer.Play(); } }} Step 7:Before pressing F5 to run the application, make sure you have put a ClientAccessPolicy.xml file in the D:\StreamdMedia location or the Physical path of IIS website streaming the media to avoid a cross-domain problem. Press F5 to run the application.These were what all required to smooth stream media from IIS and play in Silverlight client. I hope this article was useful. I am looking very forward for your comments on the article. Thanks for reading.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: