Skip to content

Commit 58bd118

Browse files
authored
Merge pull request #72 from fossmium/fix-leaving-video-crash
Fixes #71 crashing when leaving video early
2 parents ea7618c + 5830ad7 commit 58bd118

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

OneDrive-Cloud-Player/ViewModels/VideoPlayerPageViewModel.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ public Visibility VisibilityNextMediaBtn
193193
}
194194
}
195195

196+
private bool isBackBtnEnabled = false;
197+
198+
public bool IsBackBtnEnabled
199+
{
200+
get { return isBackBtnEnabled; }
201+
set
202+
{
203+
isBackBtnEnabled = value;
204+
OnPropertyChanged();
205+
}
206+
}
207+
196208
/// <summary>
197209
/// Gets the media player
198210
/// </summary>
@@ -287,9 +299,7 @@ await App.Current.UIDispatcher.RunAsync(CoreDispatcherPriority.High, () =>
287299
{
288300
MediaPlayer.VolumeChanged -= UpdateInitialVolume;
289301
MediaVolumeLevel = (int)App.Current.UserSettings.Values["MediaVolume"];
290-
291-
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + ": UpdateInitialVolume: e.Volume: " + e.Volume);
292-
Debug.WriteLine(DateTime.Now.ToString("hh:mm:ss.fff") + ": UpdateInitialVolume: Setting to: " + MediaVolumeLevel);
302+
IsBackBtnEnabled = true;
293303
});
294304
}
295305

OneDrive-Cloud-Player/Views/VideoPlayerPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@
459459
HorizontalAlignment="Center" VerticalAlignment="Center"
460460
Margin="0,0,0,0" Width="50" Height="50"
461461
Command="{Binding StopMediaCommand}"
462+
IsEnabled="{Binding IsBackBtnEnabled}"
462463
Background="Transparent">
463464
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph="&#xEB97;"/>
464465
</Button>

0 commit comments

Comments
 (0)