Friday, September 9, 2011

Streaming media wp7


<phone:PhoneApplicationPage

x:Class="WindowsPhoneApplication10.MainPage"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"

xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

xmlns:Core="clr-namespace:Microsoft.SilverlightMediaFramework.Core;assembly=Microsoft.SilverlightMediaFramework.Core.Phone"

xmlns:Media="clr-namespace:Microsoft.SilverlightMediaFramework.Core.Media;assembly=Microsoft.SilverlightMediaFramework.Core.Phone"

mc:Ignorable="d" d:DesignWidth="780" d:DesignHeight="460"

FontFamily="{StaticResource PhoneFontFamilyNormal}"

FontSize="{StaticResource PhoneFontSizeNormal}"

Foreground="{StaticResource PhoneForegroundBrush}"

SupportedOrientations="Landscape" Orientation="LandscapeLeft"

shell:SystemTray.IsVisible="True">

<Grid x:Name="LayoutRoot" Background="Transparent">

<Grid.RowDefinitions>

<RowDefinition Height="99"/>

<RowDefinition Height="361*"/>

Grid.RowDefinitions>

<StackPanel x:Name="TitlePanel" Margin="12,17,0,54">

<TextBlock x:Name="ApplicationTitle" Text="FREE Earth Televsion F.E.T." Style="{StaticResource PhoneTextNormalStyle}" Height="31" />

<TextBlock x:Name="PageTitle" Text="Free Earth Television" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Height="10" />

StackPanel>

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

<Core:SMFPlayer Width="Auto" Name="nigelplayer" IsControlStripVisible="False" Margin="0,-99,23,6" VolumeLevel="1" HorizontalAlignment="Stretch">

<Core:SMFPlayer.Playlist>

<Media:PlaylistItem DeliveryMethod="Streaming" MediaSource="resources/FreeEarthZuneFormat.wmv"/>

<Media:PlaylistItem DeliveryMethod="AdaptiveStreaming" MediaSource="http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/bbbwp7/big buck bunny.ism/manifest"/>

Core:SMFPlayer.Playlist>

Core:SMFPlayer>

Grid>

<Button Content="UP" Grid.RowSpan="2" Height="72" HorizontalAlignment="Left" Margin="215,0,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />

<Button Content="Down" Height="72" HorizontalAlignment="Left" Margin="419,0,0,0" Name="button2" VerticalAlignment="Top" Width="160" Click="button2_Click" />

<TextBlock Height="44" HorizontalAlignment="Left" Margin="9,51,0,0" Name="textBlock1" Text="Channel:" VerticalAlignment="Top" Width="736" FontFamily="Segoe WP Black" FontSize="28" />

Grid>

phone:PhoneApplicationPage>


C Sharp Code navigating through the playlists


ApplicationTitle.Text = "Channel: " + currentchannel.ToString();



// going to an integer value seems to work better than utilizing go to previous or go to next NIGEL

// go to the next play list item

nigelplayer.GoToPlaylistItem(currentchannel);

//myplayer.GoToPreviousPlaylistItem();

// myplayer.Playlist.Add. new Uri("Resources/highlights2.wmv", UriKind.RelativeOrAbsolute);

textBlock1.Text = nigelplayer.CurrentPlaylistItem.MediaSource.ToString();



No comments:

Post a Comment