<Page x:Class="ForzaUI.Scenes.Anthem.A_VideoPlayer"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      mc:Ignorable="d"
      xmlns:local="clr-namespace:ForzaUI"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <Page.Resources>
        <ResourceDictionary>
            <Color x:Key="A_BackgroundColor">#FF000000</Color>
        </ResourceDictionary>
    </Page.Resources>

    <Grid Style="{StaticResource A_Style_FrameworkElement_FadeOnlyTransition_0}">
        <Grid x:Name="LayoutRoot" Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="VisualStateGroup">
                    <VisualState x:Name="PostVideoLoading">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BackgroundFader">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>

                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Spinner">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
                                <EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="1"/>
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Hidden">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Video">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                            </DoubleAnimationUsingKeyFrames>

                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Spinner">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                            </DoubleAnimationUsingKeyFrames>

                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BackgroundFader">
                                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
        
            <!-- Video -->
            <MediaElement x:Name="Video" Style="{StaticResource A_Style_ScreenSize}" />

            <local:FZMaterial x:Name="BackgroundFader" Style="{StaticResource A_Style_ScreenSize}" Opacity="0.0" Color="{StaticResource A_BackgroundColor}" />
            <ProgressBar x:Name="Spinner" Style="{StaticResource A_Style_Progressbar_Loading_SmallSpinner}" Opacity="0.0"/>
        </Grid>

        <ContentControl x:Name="BottomBar"  Style="{StaticResource A_Style_ButtonBar}" Visibility="{Binding IsSkippable, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}">
            <ContentControl x:Name="DefaultHelpPanel"
                            local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Skip}"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>
        
    </Grid>
</Page>
