 
                    
                     
                MapEngine Media Extension
 
MapEngine Media Extension serves as an additional extension library for the MapEngine platform. This module enhances the system's capabilities by providing application programming interfaces for video playback and streaming content broadcasting.
Core Features
The extension's technological foundation is built upon JavaCV from bytedeco utilizing FFmpeg for multimedia data decoding. During server startup, the required JavaCV, JavaCPP and FFmpeg libraries are automatically downloaded and added to the classpath. The intelligent download system determines necessary components based on the operating system and processor architecture.
Key functional characteristics:
- Runtime dependency auto-download
- Media content decoding using FFmpeg
Native Library Loading
The following GIF animation demonstrates the native library loading process during server startup:

Live Streaming on Maps
Example of live streaming via RTMP protocol on a 7×4 map array. The stream source features 1920×1080 resolution at 20 frames per second, broadcast through OBS Studio.
Usage Instructions
The MapMediaExt module must be added as a dependency in the plugin.yml file, regardless of the project's build system.
Maven Configuration
<repositories>
    <repository>
        <id>tjcserver</id>
        <url>https://repo.thejocraft.net/releases/</url>
    </repository>
</repositories><dependencies>
    <dependency>
        <groupid>de.pianoman911</groupid>
        <artifactid>mapengine-mediaext</artifactid>
        <version>1.1.2</version>
        <scope>provided</scope>
    </dependency>
</dependencies>Gradle Configuration (Groovy)
repositories {
    maven {
        url = 'https://repo.thejocraft.net/releases/'
        name = 'tjcserver'
    }
}
dependencies {
    compileOnly 'de.pianoman911:mapengine-mediaext:1.1.2'
}Gradle Configuration (Kotlin)
repositories {
    maven("https://repo.thejocraft.net/releases/") {
        name = "tjcserver"
    }
}
dependencies {
    compileOnly("de.pianoman911:mapengine-mediaext:1.1.2")
}Practical Example
public class Bar {
    public void foo(IMapDisplay display, URI streamUri) {
        // create a drawing area for the display
        IDrawingSpace space = plugin.mapEngine().pipeline().drawingSpace(display);
        // add all online players as receivers
        space.ctx().receivers().addAll(Bukkit.getOnlinePlayers());
        // create a new frame source with 10-frame buffer and scaling enabled
        FFmpegFrameSource source = new FFmpegFrameSource(streamUri, 10, space, true);
        // start the decoding process
        source.start(); 
    }
}More detailed usage examples can be found in the MapEngine examples repository.
Project Building
To build the project independently, follow these steps:
- Clone the repository (git clone https://github.com/TheJoCraftNET/MapEngine-MediaExtension.git)
- Navigate to the created directory (cd MapEngine-MediaExtension)
- Build the JAR file (./gradlew buildfor Linux/MacOS,gradlew buildfor Windows)
The compiled plugin file will be located in the build → libs directory.
