Update speed of MediaPlayer.TimeChanged-Event
Posted: 20 Feb 2021 21:05
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:
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
}