0

I didn't find any event handlers like SeekCompleted build in VLC.MediaElement. I check if seek has completed using following dirty code. Is there any better way to do this?

//SET SEEK POSITION
VLCMediaPlayerElement.Position = Position;

//WAIT UNTIL SEEK HAS BEEN COMPLETED
while (VLCMediaPlayerElement.Position == Position)
    {
        await Task.Delay(1);
    } 
Weissu
  • 409
  • 3
  • 15
  • 1
    This looks like a 3rd party library, not from Microsoft or VLC team, you should provide the download link to the library, or nuget package name, or GitHub repository. – kennyzx Oct 29 '18 at 04:52
  • [VLC.MediaElement](https://github.com/kakone/VLC.MediaElement) uses [libvlcx](https://www.nuget.org/packages/libVLCX/) which is the VideoLAN official C++/CX libvlc wrapper – mfkl Nov 03 '18 at 10:21

2 Answers2

0

Try the Buffering and/or SeekableChanged events from https://code.videolan.org/videolan/vlc-winrt/blob/master/modules/libvlcppcx/EventManagerCX.hpp if you can access those.

mfkl
  • 1,914
  • 1
  • 11
  • 21
0

I get one good solution. It is possible to use RegisterPropertyChangedCallbackto create handler. Like following:

var Token = vlcMediaElement.RegisterPropertyChangedCallback(VLC.MediaElement.PositionProperty, PositionHasChanged_void);

In void PositionHasChanged_void() I can check if position is correct. If so I can unregister handler like this:

vlcMediaElement.UnregisterPropertyChangedCallback(VLC.MediaElement.PositionProperty,Token); 
Weissu
  • 409
  • 3
  • 15