Xxathyx / MediaPlayer

Allows you to play and use various medias such as videos on Minecraft.
GNU General Public License v3.0
4 stars 0 forks source link

MediaPlayer

MediaPlayer

Allows you to play and use various medias such as videos on Minecraft.

Allows you to play and use various medias such as videos with audio on Minecraft (1.7-1.21). For better performance, set network-compression-threshold to -1 in server.properties

Videos : https://youtu.be/LYVOkX7uQ5M

Livestreams : https://youtu.be/swcMQTto5rI

How to use MediaPlayer API

First of all, you need to add MediaPlayer.jar plugin as a library in your Java project, and add it as a plugin into you server plugin folder.

Brows into plugin informations with MediaPlayerAPI class :

First step : import fr.xxathyx.mediaplayer.api.MediaPlayerAPI;

Then call getPlugin method in order to gain access to live running plugin informations.

A player interacts with a screen, use the PlayerInteractScreenEvent to detect it :

You will need to : import fr.xxathyx.mediaplayer.api.listeners.PlayerInteractScreenEvent

Then you can access informations such as the screen that as been touched with getScreen, the player itself : getPlayer and the click location with getCursorX, getCursorY.

Notice that those integers represent the real location of the click according to the size of the content displayed insed it.

How to have audio :

In order to have audio, users must simply set their 'Server Resource Pack' to Prompt or Enabled.

When everyone is ready you can type vid start to run the video, to force starting without waiting for everyone to be ready you can type vid start anyways.