Package com.igrium.videolib.api.playback
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 TypeMethodDescriptionGet the handle of the currently loaded video.Get the factory that should be used to generate video handles for this player.boolean
hasMedia()
Check whether there is currently a video loaded.boolean
load
(VideoHandle handle) Load a video and prepare it for playback.default boolean
default boolean
load
(net.minecraft.util.Identifier id) boolean
play
(VideoHandle handle) Load a video and play it.default boolean
default boolean
play
(net.minecraft.util.Identifier id)
-
Method Details
-
load
Load a video and prepare it for playback.- Parameters:
handle
- Video handle.- Returns:
- Success.
-
load
-
load
default boolean load(net.minecraft.util.Identifier id) -
play
Load a video and play it.- Parameters:
handle
- Video handle.- Returns:
- Success.
- Throws:
IllegalArgumentException
- If this this video player is incompatible with this handle. UsegetHandle()
to get a handle guarenteed to work with this player.
-
play
- 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.
-