private async void playButton_Click(object sender, RoutedEventArgs e) { // Get URI if (player != null) { player.Close(); player = null; } Uri uri; try { uri = new Uri(sourceUrl.Text); } catch { rootPage.NotifyUser("Invalid URL given", NotifyType.ErrorMessage); return; } haveSetSource = true; player = new LiveDash.LiveDashPlayer(); if (haveSetLiveOffset) { player.DesiredLiveOffset(liveOffset); } await player.Initialize(uri, mediaElement); // Clear the status block when you press play rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { if (player != null) { player.Close(); player = null; } haveSetSource = false; }