Class MediaListPlayer


  • public final class MediaListPlayer
    extends Object
    Implementation of a media list player.

    A media list player can be used with an embedded media player (without this a native video window will be opened when video is played).

    The native media list player will automatically deal properly with media that has subitems (like YouTube movies), so simply adding an ordinary MRL/URL is all that is needed for such media.

    • Constructor Detail

      • MediaListPlayer

        public MediaListPlayer​(uk.co.caprica.vlcj.binding.internal.libvlc_instance_t libvlcInstance)
        Create a new media list player.
        Parameters:
        libvlcInstance - libvlc instance
    • Method Detail

      • userData

        public Object userData()
        Get the user data associated with the media player.
        Returns:
        user data
      • userData

        public void userData​(Object userData)
        Set user data to associate with the media player.
        Parameters:
        userData - user data
      • submit

        public void submit​(Runnable r)
        Submit a task for asynchronous execution.

        This is useful in particular for event handling code as native events are generated on a native event callback thread and it is not allowed to call back into LibVLC from this callback thread. If you do, either the call will be ineffective, strange behaviour will happen, or a fatal JVM crash may occur.

        To mitigate this, those tasks can be offloaded from the native thread, serialised and executed using this method.

        Parameters:
        r - task to execute
      • release

        public void release()
        Release the media player, freeing all associated (including native) resources.
      • mediaListPlayerInstance

        public uk.co.caprica.vlcj.binding.internal.libvlc_media_list_player_t mediaListPlayerInstance()
        Provide access to the native media player instance.

        This is exposed on the interface as an implementation side-effect, ordinary applications are not expected to use this.

        Returns:
        media player instance