Page 1 of 1

Update speed of MediaPlayer.TimeChanged-Event

Posted: 20 Feb 2021 21:05
by DanielK117
is there a way to change the update speed of the LibVLCSharp MediaPlayer TimeChanged-Event?

I use this event to update the remaining playtime of my video. But this is too slow for my purpose. I would like to update the remaining time every 10ms. Is that possible?

My Code:

Code: Select all

private void InitMediaPlayer() { vlc = new LibVLC(true, ""); videoClipMediaPlayer = new MediaPlayer(vlc); videoClipMediaPlayer.TimeChanged += MediaPlayerTimeChanged; } private void MediaPlayerTimeChanged(object sender, MediaPlayerTimeChangedEventArgs e) { long RemainingTimeMS = videoClipMediaPlayer.Media.Duration - e.Time; RemainingPlayTime = new TimeSpan(0, 0, 0, 0, Convert.ToInt32(RemainingTimeMS)); // this is only called every 250 milliseconds }

Re: Update speed of MediaPlayer.TimeChanged-Event

Posted: 20 Feb 2021 22:20
by RĂ©mi Denis-Courmont
Well, you can extrapolate with whatever frequency you want. Not clear what you expect here.

Re: Update speed of MediaPlayer.TimeChanged-Event

Posted: 24 Feb 2021 01:31
by mfkl
is there a way to change the update speed of the LibVLCSharp MediaPlayer TimeChanged-Event?
I don't think so. Maybe the position changed event fires more often?

Re: Update speed of MediaPlayer.TimeChanged-Event

Posted: 24 Feb 2021 01:40
by mfkl