VideoPage.xaml 4.68 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<Page
    x:Class="ms2_tester.VideoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:ms2_tester"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.BottomAppBar>
        <CommandBar x:Name="CommandBar">
            <AppBarButton x:Name="BackButton" Icon="Back" Label="Back" Click="BackButton_Click"/>
        </CommandBar>
    </Page.BottomAppBar>

16 17
    <ScrollViewer>
        <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
18 19
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
20
                <RowDefinition Height="*"/>
21 22
            </Grid.RowDefinitions>

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
            <Grid Grid.Row="0" HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <TextBlock x:Name="CameraLabel" Grid.Row="0" Grid.Column="0" Text="Camera:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="CameraComboBox" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8"/>
                <TextBlock x:Name="CodecLabel" Grid.Row="1" Grid.Column="0" Text="Codec:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="CodecComboBox" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8">
                    <ComboBoxItem Content="H264"/>
                    <ComboBoxItem Content="VP8" IsSelected="True"/>
                </ComboBox>
                <TextBlock x:Name="VideoSizeLabel" Grid.Row="2" Grid.Column="0" Text="Video size:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="VideoSizeComboBox" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8">
                    <ComboBoxItem Content="720P"/>
                    <ComboBoxItem Content="VGA"/>
                    <ComboBoxItem Content="CIF"/>
                    <ComboBoxItem Content="QVGA" IsSelected="True"/>
                    <ComboBoxItem Content="QCIF"/>
                </ComboBox>
                <TextBlock x:Name="FramerateLabel" Grid.Row="3" Grid.Column="0" Text="FPS:" VerticalAlignment="Center" Margin="8"/>
                <ComboBox x:Name="FramerateComboBox" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="8">
                    <ComboBoxItem Content="30"/>
                    <ComboBoxItem Content="25"/>
                    <ComboBoxItem Content="20"/>
                    <ComboBoxItem Content="15" IsSelected="True"/>
                    <ComboBoxItem Content="10"/>
                    <ComboBoxItem Content="5"/>
                </ComboBox>
                <TextBlock x:Name="BitrateLabel" Grid.Row="4" Grid.Column="0" Text="Bitrate:" VerticalAlignment="Center" Margin="8"/>
                <TextBox x:Name="BitrateTextBox" Grid.Row="4" Grid.Column="1" Margin="8" IsSpellCheckEnabled="False" IsTextPredictionEnabled="False" InputScope="Number" Text="1500"/>
                <ToggleButton x:Name="VideoToggleButton" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Content="Toggle video" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8" Checked="VideoToggleButton_Checked" Unchecked="VideoToggleButton_Checked"/>
            </Grid>
            <Grid Grid.Row="1" MaxHeight="320">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.5*"/>
                    <ColumnDefinition Width="0.5*"/>
                </Grid.ColumnDefinitions>
70

71 72 73
                <CaptureElement x:Name="LocalVideo" Stretch="Uniform" Grid.Column="0"/>
                <MediaElement x:Name="RemoteVideo" Stretch="Uniform" MediaFailed="RemoteVideo_MediaFailed" MediaEnded="RemoteVideo_MediaEnded" MediaOpened="RemoteVideo_MediaOpened" PartialMediaFailureDetected="RemoteVideo_PartialMediaFailureDetected" RateChanged="RemoteVideo_RateChanged" SizeChanged="RemoteVideo_SizeChanged" CurrentStateChanged="RemoteVideo_CurrentStateChanged" Grid.Column="1"/>
            </Grid>
74
        </Grid>
75
    </ScrollViewer>
76
</Page>