Interface MediaInterface

All Known Implementing Classes:
VLCVideoPlayer.VLCMediaInterface

public interface MediaInterface
Behavior pertaining to the loading and playback of video media.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the handle of the currently loaded video.
    Get the factory that should be used to generate video handles for this player.
    boolean
    Check whether there is currently a video loaded.
    boolean
    load(VideoHandle handle)
    Load a video and prepare it for playback.
    default boolean
    load(String url)
     
    default boolean
    load(net.minecraft.util.Identifier id)
     
    boolean
    play(VideoHandle handle)
    Load a video and play it.
    default boolean
    play(String url)
     
    default boolean
    play(net.minecraft.util.Identifier id)
     
  • Method Details

    • load

      boolean load(VideoHandle handle)
      Load a video and prepare it for playback.
      Parameters:
      handle - Video handle.
      Returns:
      Success.
    • load

      default boolean load(String url) throws MalformedURLException, URISyntaxException
      Throws:
      MalformedURLException
      URISyntaxException
    • load

      default boolean load(net.minecraft.util.Identifier id)
    • play

      boolean play(VideoHandle handle) throws IllegalArgumentException
      Load a video and play it.
      Parameters:
      handle - Video handle.
      Returns:
      Success.
      Throws:
      IllegalArgumentException - If this this video player is incompatible with this handle. Use getHandle() to get a handle guarenteed to work with this player.
    • play

      default boolean play(String url) throws MalformedURLException
      Throws:
      MalformedURLException
    • play

      default boolean play(net.minecraft.util.Identifier id)
    • hasMedia

      boolean hasMedia()
      Check whether there is currently a video loaded.
      Returns:
      Is there a video loaded?
    • currentMedia

      Optional<VideoHandle> currentMedia()
      Get the handle of the currently loaded video. Note: most implementations will attempt to reverse-engineer the handle from the native player. If you need the original handle, keep track of it yourself.
      Returns:
      An optional with the handle.
    • getVideoHandleFactory

      VideoHandleFactory getVideoHandleFactory()
      Get the factory that should be used to generate video handles for this player.
      Returns:
      Video handle factory.