-
Notifications
You must be signed in to change notification settings - Fork 144
/
Player.xaml
206 lines (194 loc) · 9.17 KB
/
Player.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!--
// ******************************************************************
// Copyright (c) Microsoft. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE.
// ******************************************************************
-->
<Page
x:Class="BuildCast.Views.Player"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:a="using:AudioVisualizer"
xmlns:controls="using:BuildCast.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Loaded="Player_Loaded"
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
animations:Implicit.HideAnimations="{StaticResource DefaultPageHideAnimation}"
Unloaded="Player_Unloaded"
mc:Ignorable="d">
<Page.Resources>
<DataTemplate x:Key="RemoteSystemItems">
<Grid>
<TextBlock Text="{Binding DisplayName}" />
</Grid>
</DataTemplate>
<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
<ItemsWrapGrid Orientation="Vertical" />
</ItemsPanelTemplate>
</Page.Resources>
<Grid x:Name="playerPageGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid x:Name="contents" Margin="0,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="86" />
<RowDefinition Height="*" />
<RowDefinition Height="170" />
</Grid.RowDefinitions>
<!-- -Player is lower than header in z-order -->
<controls:CustomMediaPlayer x:Name="videoPlayer" Grid.Row="1" />
<Grid
x:Name="header"
Grid.Row="0"
Padding="25,30,6,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{ThemeResource SystemControlAcrylicElementBrush}"
animations:Implicit.ShowAnimations="{StaticResource DefaultTitleShowAnimations}">
<animations:Implicit.HideAnimations>
<animations:OpacityAnimation Duration="0:0:0.8" To="0"></animations:OpacityAnimation>
</animations:Implicit.HideAnimations>
<Image
x:Name="podimage"
Width="50"
Height="50"
HorizontalAlignment="Left"
VerticalAlignment="Center" />
<StackPanel
MaxHeight="50"
Margin="60,0,240,0"
VerticalAlignment="Center">
<TextBlock
x:Name="nowplayingtitle"
Style="{ThemeResource SubtitleTextBlockStyle}"
Text="{x:Bind _currentEpisode.Title}"
TextWrapping="WrapWholeWords" />
<TextBlock
x:Name="nowplayingsubtitle"
Style="{ThemeResource BodyTextBlockStyle}"
Text="{x:Bind _currentEpisode.Subtitle}"
TextWrapping="WrapWholeWords" />
</StackPanel>
<CommandBar
x:Name="commands"
Margin="0,0,0,0"
VerticalAlignment="Bottom"
Background="Transparent"
OverflowButtonVisibility="Collapsed">
<CommandBar.PrimaryCommands>
<AppBarButton
x:Name="bookmarkbutton"
AccessKey="B"
Click="Bookmark_click"
Label="Bookmark"
XYFocusDown="{x:Bind mtc}"
XYFocusRight="{x:Bind sharebutton}">
<AppBarButton.Icon>
<FontIcon FontFamily="/Assets/BCastMDL2.ttf#BuildCast MDL2 Assets" Glyph="" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton
x:Name="sharebutton"
AccessKey="S"
Click="Share_click"
Label="Ink Note"
XYFocusDown="{x:Bind mtc}"
XYFocusLeft="{x:Bind bookmarkbutton}">
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
</AppBarButton>
</CommandBar.PrimaryCommands>
</CommandBar>
</Grid>
<Grid
x:Name="playbackcontrolsholder"
Grid.Row="2"
Padding="24,8,24,0"
Background="{ThemeResource SystemControlAcrylicElementBrush}">
<animations:Implicit.ShowAnimations>
<animations:TranslationAnimation Duration="0:0:0.55" From="0,100,0" To="0"></animations:TranslationAnimation>
</animations:Implicit.ShowAnimations>
<animations:Implicit.HideAnimations>
<animations:OpacityAnimation Duration="0:0:0.8" To="0"></animations:OpacityAnimation>
</animations:Implicit.HideAnimations>
<controls:CustomMTC
x:Name="mtc"
RefreshRequested="{x:Bind ViewModel.RefreshRemoteSystems}"
RemoteSystemSelected="Mtc_RemoteSystemSelected"
RemoteSystems="{x:Bind ViewModel.RemoteSystems}"
XYFocusUp="{x:Bind bookmarkbutton}" />
</Grid>
<a:CustomVisualizer
x:Name="visualizer"
Grid.Row="2"
Height="48"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Draw="Visualizer_Draw" />
</Grid>
<ContentDialog
x:Name="RemoteControlPopup"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<ContentDialog
x:Name="BookmarkDialog"
Height="330"
Background="{ThemeResource AppBarBackgroundThemeBrush}"
BorderThickness="0,0,0,0"
CloseButtonText="Cancel"
PrimaryButtonCommand="{x:Bind AddBookmarkCommand}"
PrimaryButtonText="Add bookmark">
<ContentDialog.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
Margin="0,0,0,10"
Style="{StaticResource SubtitleTextBlockStyle}"
Text="Save bookmark" />
<TextBlock
Grid.Row="1"
Width="500"
Text="Notes" />
<TextBox
x:Name="bookmarkContent"
Grid.Row="2"
TextWrapping="Wrap" />
</Grid>
</ContentDialog.Content>
</ContentDialog>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="narrow">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="200" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="videoplay.(RelativePanel.Below)" Value="commands" />
<Setter Target="videoPlayer.(RelativePanel.AlignRightWithPanel)" Value="True" />
<Setter Target="videoPlayer.(RelativePanel.AlignLeftWithPanel)" Value="True" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Wide">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="videoPlayer.(RelativePanel.Below)" Value="commands" />
<Setter Target="videoPlayer.(RelativePanel.AlignRightWithPanel)" Value="True" />
<Setter Target="videoPlayer.(RelativePanel.AlignLeftWithPanel)" Value="True" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</Page>