<UserControl
	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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:SSME="clr-namespace:Microsoft.Web.Media.SmoothStreaming;assembly=Microsoft.Web.Media.SmoothStreaming"
    xmlns:control="clr-namespace:SimpleSmoothStreaming"
    mc:Ignorable="d"
	x:Class="SimpleSmoothStreaming.MainPage"
    Loaded="UserControl_Loaded">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.Resources>
            <CollectionViewSource x:Name="BitRates" x:Key="bitrates">
            </CollectionViewSource>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.75*"/>
            <RowDefinition Height="0.25*"/>
        </Grid.RowDefinitions>
        <SSME:SmoothStreamingMediaElement AutoPlay="False" x:Name="SmoothPlayer" Grid.Row="0" Width="0" Height="0"  Margin="10,10,0,0" Background="White"/>
        <TextBlock x:Name="OutPut" Grid.Row="0" Width="auto" Height="auto" VerticalAlignment="Bottom" HorizontalAlignment="Center" TextWrapping="Wrap" FontSize="14" FontWeight="Bold"/>        
            <Grid x:Name="grid2" Grid.Row="1" Grid.Column="0" Margin="12,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="0.2*"/>
                <RowDefinition Height="0.2*"/>
                <RowDefinition Height="0.6*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.65*"/>
                <ColumnDefinition Width="0.35*"/>
            </Grid.ColumnDefinitions>

            <control:CustomSlider x:Name="SeekBar" MouseLeftButtonUp="SeekBar_MouseLeftButtonUp" MouseEnter="SeekBar_MouseEnter" MouseLeave="SeekBar_MouseLeave"  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"  Width="auto" IsEnabled="False" Style="{StaticResource SeekSlider}"/>
            
                <Canvas Width="auto" Grid.Row="1" Margin="0,5,0,0">
                <Button x:Name="RewButton" Content="Rew" Click="RewButton_Click" Canvas.Left="10" IsEnabled="False" Style="{StaticResource ButtonStyle1}"/>
                <Button x:Name="PauseButton" Content="Pause" Click="PauseButton_Click" Canvas.Left="50" IsEnabled="False" Style="{StaticResource ButtonStyle1}"/>
                
                <TextBlock Text="volume"  Canvas.Left="100"/>
                <Slider x:Name="VolumeBar" Maximum="10" ValueChanged="VolumeBar_ValueChanged" Width="200" Canvas.Left="150"/>
                <Image Source="fullscreen.png" x:Name="fullScreenButton" ToolTipService.ToolTip="Full Screen" MouseLeftButtonUp="Fullscreen_Click" Height="26" Width="26" Canvas.Left="366" Visibility="Collapsed"/>
            </Canvas>
            <StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="0" Width="auto" Margin="0,5,0,0">
                <TextBlock Text="Manifest:" FontWeight="Bold" Width="auto" HorizontalAlignment="Left" Margin="4,0,0,0"/>       
                <TextBox x:Name="ManifestURL" KeyDown="ManifestURL_KeyDown"  Text="http://localhost:1935/vod/sample.mp4/Manifest" Width="400"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,5">
                        <TextBlock Text="Limit Bitrate: " Visibility="{Binding Path=Visibility, ElementName=BWCombo,Mode=OneWay}" FontWeight="Bold" Margin="0,5,0,0"/>
                        <ComboBox x:Name="BWCombo" Width="auto" MinWidth="80" SelectionChanged="BWCombo_SelectionChanged" Visibility="Collapsed" ToolTipService.ToolTip="Limit Bitrate" Margin="0,4,0,5"/>
                        <TextBlock Text=" Current Bitrate: "  FontWeight="Bold" Width="auto" Margin="5,5,0,0"/>
                        <TextBlock x:Name="BitRate" Text="0" FontWeight="Bold" Width="auto" MinWidth="60" Margin="0,5,0,5"/>
                        <Button x:Name="PlayButton" Content="Play" Click="PlayButton_Click" IsEnabled="True" MinWidth="35" Style="{StaticResource ButtonStyle1}"/>
                    </StackPanel>    
                </StackPanel>
        </Grid>
    </Grid>
    
</UserControl>