Update speed of MediaPlayer.TimeChanged-Event

This forum is about all development around libVLC.
DanielK117
New Cone
New Cone
Posts: 6
Joined: 20 Feb 2021 20:56

Update speed of MediaPlayer.TimeChanged-Event

Postby DanielK117 » 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:

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 }

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Update speed of MediaPlayer.TimeChanged-Event

Postby Rémi Denis-Courmont » 20 Feb 2021 22:20

Well, you can extrapolate with whatever frequency you want. Not clear what you expect here.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Update speed of MediaPlayer.TimeChanged-Event

Postby mfkl » 24 Feb 2021 01:31

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?
https://mfkl.github.io

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: Update speed of MediaPlayer.TimeChanged-Event

Postby mfkl » 24 Feb 2021 01:40

https://mfkl.github.io


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 21 guests