Class OneShotMediaPlayerEventListener

java.lang.Object
uk.co.caprica.vlcj.player.base.MediaPlayerEventAdapter
uk.co.caprica.vlcj.player.base.OneShotMediaPlayerEventListener
All Implemented Interfaces:
MediaPlayerEventListener
Direct Known Subclasses:
SynchronisedOneShotMediaPlayerEventListener

public abstract class OneShotMediaPlayerEventListener extends MediaPlayerEventAdapter
Base implementation for a component that supports "one-shot" event listeners, i.e. event listeners attached to a media player instance that will remove themselves when an event of interest is fired.

A sub-class should override methods to implement the desired event behaviour, and from one or other of those methods it should invoke done(MediaPlayer) to cause the listener to be removed.

If is the event method implementations that decide if/when the event listener should be removed, so it may not strictly be one received event only - for example if a listener were added to trigger when the playback time reached five seconds, there would be multiple intermediate time changed events fired before the target time were reached.

Note that by default, the following methods will be implemented to invoke done(MediaPlayer), this behaviour can be overriden by sub-classes: