private void OnVlcPlaying(object sender, VlcMediaPlayerPlayingEventArgs e) { myLblState.InvokeIfRequired(l => l.Text = "Playing"); myLblAudioCodec.InvokeIfRequired(l => l.Text = "Codec: "); myLblAudioChannels.InvokeIfRequired(l => l.Text = "Channels: "); myLblAudioRate.InvokeIfRequired(l => l.Text = "Rate: "); myLblVideoCodec.InvokeIfRequired(l => l.Text = "Codec: "); myLblVideoHeight.InvokeIfRequired(l => l.Text = "Height: "); myLblVideoWidth.InvokeIfRequired(l => l.Text = "Width: "); var mediaInformations = myVlcControl.GetCurrentMedia().TracksInformations; foreach (var mediaInformation in mediaInformations) { if (mediaInformation.Type == MediaTrackTypes.Audio) { myLblAudioCodec.InvokeIfRequired(l => l.Text += mediaInformation.CodecName); myLblAudioChannels.InvokeIfRequired(l => l.Text += mediaInformation.Audio.Channels); myLblAudioRate.InvokeIfRequired(l => l.Text += mediaInformation.Audio.Rate); } else if (mediaInformation.Type == MediaTrackTypes.Video) { myLblVideoCodec.InvokeIfRequired(l => l.Text += mediaInformation.CodecName); myLblVideoHeight.InvokeIfRequired(l => l.Text += mediaInformation.Video.Height); myLblVideoWidth.InvokeIfRequired(l => l.Text += mediaInformation.Video.Width); } } myCbxAspectRatio.InvokeIfRequired(c => { c.Text = myVlcControl.Video.AspectRatio; c.Enabled = true; }); }
internal void VlcControl_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { VlcControl control = (VlcControl)sender; Size size = new Size(-1, -1); Side side = (control == form.mediaViewerLeft.VlcControl) ? Side.Left : Side.Right; RichTextBox infoBox = (side == Side.Left) ? form.infoRichTextBoxLeft : form.infoRichTextBoxRight; VlcMedia media = control.GetCurrentMedia(); // Currently grabbing tracksinformation 0, could be wrong in some cases. size.Width = media.TracksInformations.Length > 0 ? (int)media.TracksInformations[0].Video.Width : -1; size.Height = media.TracksInformations.Length > 0 ? (int)media.TracksInformations[0].Video.Height : -1; if (size != new Size(-1, -1)) { // Update appropriate fileprint with the new found size, just incase it's needed later. (side == Side.Left ? inspectingDuplicate.fileprint1 : inspectingDuplicate.fileprint2).SetVideoSize(size); infoBox.Invoke(() => { if (!infoBox.Text.Contains("Width")) { infoBox.AppendText($"Duration: {media.Duration.Seconds}s\n"); ShowFileInfo(side, size, false); } }); } }
private void SetProgresMax(object sender, VlcMediaPlayerPlayingEventArgs e) { Invoke(new Action(() => { trackBarVideo.Value = trackBarVideo.Minimum; var vlc = (VlcControl)sender; if ((int)vlc.Length < 10000) { frecuenciaTrack = 100; } else if ((int)vlc.Length >= 10000 && (int)vlc.Length < 50000) { frecuenciaTrack = 200; } else { frecuenciaTrack = 400; } trackBarVideo.Maximum = ((int)vlc.Length - 1) / frecuenciaTrack; //a = (int)vlc.Length / 1000; // Length (s) //c = a / 60; // Length (m) //a = a % 60; // Length (s) //label1.Text = 0 + "/" + c + ":" + a; ObtenerDatosVideo(); RedimensionarVlcControl(); })); }
private void VlcMediaPlayer_OnPlaying(object sender, VlcMediaPlayerPlayingEventArgs e) { PlayerState = PlayerState.Plays; PlayerStateChanged?.Invoke(this, new PlayerStateChangedEventArgs { PlayerState = PlayerState }); }
private void VlcControl_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { if (file != null && !statisticsLoaded) { statisticsLoaded = true; statistic = Database.GetStatistic(file.FullName); } }
private void vlcControl1_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { Console.WriteLine("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------播放"); dSkinButton1.BeginInvoke(new EventHandler((ss, ee) => { dSkinButton1.Image = Properties.Resources.pause_normal; dSkinButton1.Invalidate(); })); }
private void SetProgressMax(object sender, VlcMediaPlayerPlayingEventArgs e) { Dispatcher.Invoke(new Action(() => { var vlc = (VlcMediaPlayer)sender; sldTimeline.Maximum = (int)vlc.Length; Console.WriteLine("Nome:" + timeline.SourceProvider.MediaPlayer.GetMedia().Title); Console.WriteLine("Duração (Lenght):" + (int)vlc.Length); //timeline.MediaPlayer.Playing -= new EventHandler<Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs>(SetProgressMax); timeline.SourceProvider.MediaPlayer.Playing -= new EventHandler <Vlc.DotNet.Core.VlcMediaPlayerPlayingEventArgs>(SetProgressMax); } )); }
/// <summary>The LibVLC Playing event handler</summary> /// <param name="sender">The object that triggered the event</param> /// <param name="e">The event arguments</param> private void VlcControl_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { TvCore.LogDebug("[.NET] VlcControl_Playing()"); ThreadPool.QueueUserWorkItem(state => { _currentMedia = vlcControl.GetCurrentMedia(); }); this.InvokeIfRequired(() => { playerStatusLabel.Text = Resources.TvForm_Playing; }); }
//Fire event when video starts private void SetProgressMax(object sender, VlcMediaPlayerPlayingEventArgs e) { if (_vlcControl1.InvokeRequired) { _vlcControl1.Invoke(new Action(() => { _videoView.trackBar1.Value = _videoView.trackBar1.Minimum; var vlc = (VlcControl)sender; _videoView.trackBar1.Maximum = (int)vlc.Length / 1000; a = (int)vlc.Length / 1000; // Length (s) c = a / 60; // Length (m) a = a % 60; // Length (s) _videoView.labelSeek.Text = 0 + "/" + c + ":" + a; })); } }
private void OnVlcPlaying(object sender, VlcMediaPlayerPlayingEventArgs e) { myLblState.InvokeIfRequired(l => l.Text = "Playing"); myLblAudioCodec.InvokeIfRequired(l => l.Text = "Codec: "); myLblAudioChannels.InvokeIfRequired(l => l.Text = "Channels: "); myLblAudioRate.InvokeIfRequired(l => l.Text = "Rate: "); myLblVideoCodec.InvokeIfRequired(l => l.Text = "Codec: "); myLblVideoHeight.InvokeIfRequired(l => l.Text = "Height: "); myLblVideoWidth.InvokeIfRequired(l => l.Text = "Width: "); var mediaInformations = myVlcControl.GetCurrentMedia().Tracks; foreach (var mediaInformation in mediaInformations) { if (mediaInformation.Type == MediaTrackTypes.Audio) { myLblAudioCodec.InvokeIfRequired(l => l.Text += FourCCConverter.FromFourCC(mediaInformation.CodecFourcc)); var audioTrack = mediaInformation.TrackInfo as AudioTrack; myLblAudioChannels.InvokeIfRequired(l => l.Text += audioTrack?.Channels.ToString() ?? "null"); myLblAudioRate.InvokeIfRequired(l => l.Text += audioTrack?.Rate.ToString() ?? "null"); } else if (mediaInformation.Type == MediaTrackTypes.Video) { myLblVideoCodec.InvokeIfRequired(l => l.Text += FourCCConverter.FromFourCC(mediaInformation.CodecFourcc)); var videoTrack = mediaInformation.TrackInfo as VideoTrack; myLblVideoHeight.InvokeIfRequired(l => l.Text += videoTrack?.Height.ToString() ?? "null"); myLblVideoWidth.InvokeIfRequired(l => l.Text += videoTrack?.Width.ToString() ?? "null"); } else if (mediaInformation.Type == MediaTrackTypes.Text) { myLblVideoCodec.InvokeIfRequired(l => l.Text += FourCCConverter.FromFourCC(mediaInformation.CodecFourcc)); var subtitleTrack = mediaInformation.TrackInfo as SubtitleTrack; myLblVideoHeight.InvokeIfRequired(l => l.Text += subtitleTrack?.Encoding); } } myCbxAspectRatio.InvokeIfRequired(c => { c.Text = myVlcControl.Video.AspectRatio; c.Enabled = true; }); }
private void myVlcControl_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { this.BeginInvokeIfRequired(_ => { if (myVlcControl == null) { return; } if (myVlcControl.MediaPlayer.Length == 0) { mainViewModel.VideoViewModel.CannotOpen = true; return; } loopShouldBePaused = false; sliderVideo.Maximum = myVlcControl.MediaPlayer.Length; mainViewModel.VideoViewModel.IsLoading = false; }); }
private void OnPlayingInternal(object sender, VlcMediaPlayerPlayingEventArgs e) { OnPlaying(); }
void MediaPlayer_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { _viewModel.State = LiveStreamPlayerState.Playing; }
private void PlayingEvent(object sender, VlcMediaPlayerPlayingEventArgs e) { MessageBox.Show("播放视频!"); }
private void vlcPlayer_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { _stopWatch.Start(); _lyricTimer.Start(); }
/// <summary> /// Event handler for player start playing. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void PlayerOnPlaying(object sender, VlcMediaPlayerPlayingEventArgs e) { Console.WriteLine(@"PlayerOnPlaying"); }
private void VlcMediaPlayer_Playing(object sender, VlcMediaPlayerPlayingEventArgs e) { isOpening = false; }
private void OnVlcPlaying(object sender, VlcMediaPlayerPlayingEventArgs e) { Id3GetTags(); }
/// 影片播放事件(此事件觸發不代表正在播放==) private void PlayingEventHandler(object sender, VlcMediaPlayerPlayingEventArgs e) { //Console.WriteLine("PlayingEventHandler"); this.VideoPlayerModel.Status = "Pause"; }
private void VideoPlaying(object sender, VlcMediaPlayerPlayingEventArgs e) { VideoMaxTime = videoView.MediaPlayer.Length; }