private void btnClose_Click(object sender, RoutedEventArgs e) { MediaState state = _player.MediaState; Pause(); double position = _player.Position.TotalSeconds; double volume = _player.Volume; _player.Close(); _sourcePlayer = null; this.Visibility = Visibility.Collapsed; CloseAction(position, state, volume); }
public void CopyState(VideoPlayerControl player, double volume, bool copySource) { if (copySource) { VideoPlayerElement.Source = player.VideoPlayerElement.Source; } Volume = volume; MediaState = player.MediaState; Title = player.Title; FileName = player.FileName; IsFlipHorizontally = player.IsFlipHorizontally; Zoom = player.Zoom; VerticalOffset = player.VerticalOffset; Position = player.Position; }
public void ShowWithControl(VideoPlayerControl player, double volume) { if (_sourcePlayer != null) { throw new Exception("Invalid call"); } _sourcePlayer = player; _player.CopyState(player, volume, true); _player.RestoreMediaState(player.MediaState, player.Position); this.Visibility = Visibility.Visible; _player.FitWidth(false); thumbnails.StartCreateThumbnailsFromVideoFile(player); _player.btnMaximize.IsEnabled = false; }
public void StartCreateThumbnailsFromVideoFile(VideoPlayerControl playerSrc) { if (string.IsNullOrWhiteSpace(playerSrc.FileName)) { return; } try { _selectedPosition = playerSrc.Position.TotalSeconds; Images.Clear(); player.Source = new System.Uri(playerSrc.FileName); player.Play(); } catch (System.Exception err) { MessageBox.Show(err.ToString()); } }