private void MediaPlayer_Playing(object sender, Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs e) { //1 is -1 ("disable") and second is whats in the main player for (int i = 2; i < VM.MainSource.MediaPlayer.Video.Tracks.Count; i++) { VlcVideoSourceProvider ctl = CreatePlayer(i); VM.AddVideoSource(ctl); ctl.MediaPlayer.Play(); } _ignoreVolumeValChange = true; Dispatcher.Invoke(() => volumeSlider.Value = VM.MainSource.MediaPlayer.Audio.Volume); _ignoreVolumeValChange = false; if (_pauseOnPlay) { Dispatcher.BeginInvoke(new Action(() => { Pause(this, null); timelineSlider.Value = 0; })); } _pauseOnPlay = false; VM.MainSource.MediaPlayer.Playing -= MediaPlayer_Playing; }
private void vlcplayer_Playing(object sender, Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs e) { SetTimerEnabled(true); if (this.Playing != null) { this.Invoke(Playing, this, e); } if (firstTimeToPlay) { var tracks = AudioTracks; if (defAudioTrackIndex > 0 && defAudioTrackIndex + 1 > tracks.Count) { int ti = tracks.Count == 0 ? 0 : tracks.Count - 1; AudioTrackIndex = ti; defAudioTrackIndex = ti; } if (this.MediaFirstTimeToPlay != null) { this.Invoke(MediaFirstTimeToPlay, this, new VlcMediaPlayerMediaChangedEventArgs(CurrentMedia)); } } firstTimeToPlay = false; }
private void MediaPlayer_Playing(object sender, Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs e) { this.VideoIsPlaying(); }