Пример #1
0
        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);
                    }
                });
            }
        }
Пример #3
0
        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();
            }));
        }
Пример #4
0
 private void VlcMediaPlayer_OnPlaying(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     PlayerState = PlayerState.Plays;
     PlayerStateChanged?.Invoke(this, new PlayerStateChangedEventArgs
     {
         PlayerState = PlayerState
     });
 }
Пример #5
0
 private void VlcControl_Playing(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     if (file != null && !statisticsLoaded)
     {
         statisticsLoaded = true;
         statistic        = Database.GetStatistic(file.FullName);
     }
 }
Пример #6
0
 private void vlcControl1_Playing(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     Console.WriteLine("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------播放");
     dSkinButton1.BeginInvoke(new EventHandler((ss, ee) =>
     {
         dSkinButton1.Image = Properties.Resources.pause_normal;
         dSkinButton1.Invalidate();
     }));
 }
Пример #7
0
 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);
     }
                                  ));
 }
Пример #8
0
        /// <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;
            });
        }
Пример #9
0
 //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;
         }));
     }
 }
Пример #10
0
        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;
            });
        }
Пример #11
0
        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();
 }
Пример #13
0
 private void OnPlayingInternal(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     OnPlaying();
 }
Пример #14
0
 void MediaPlayer_Playing(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     _viewModel.State = LiveStreamPlayerState.Playing;
 }
Пример #15
0
 private void PlayingEvent(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     MessageBox.Show("播放视频!");
 }
Пример #16
0
 private void vlcPlayer_Playing(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     _stopWatch.Start();
     _lyricTimer.Start();
 }
Пример #17
0
 /// <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");
 }
Пример #18
0
 private void VlcMediaPlayer_Playing(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     isOpening = false;
 }
Пример #19
0
 private void OnVlcPlaying(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     Id3GetTags();
 }
Пример #20
0
 /// 影片播放事件(此事件觸發不代表正在播放==)
 private void PlayingEventHandler(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     //Console.WriteLine("PlayingEventHandler");
     this.VideoPlayerModel.Status = "Pause";
 }
Пример #21
0
 private void VideoPlaying(object sender, VlcMediaPlayerPlayingEventArgs e)
 {
     VideoMaxTime = videoView.MediaPlayer.Length;
 }