Play video on JMonkeyEngine

105 views Asked by At

I am doing game development using JMonkeyEngine and I have created an introduction video (.mp4). I want to play it at the start before the game starts but I am unable to play the video and can only listen the audio for a few seconds. Below is the code I am using to play the music.

Media media = new Media("file:/Users/t/Desktop/Presentation1_1.mp4");
    MediaPlayer mp;
    mp= new MediaPlayer(media);
    mp.volumeProperty();
    mp.play()
1

There are 1 answers

2
reden On

There is no built in function to play video in jMonkeyEngine3.

I faced the same problem once and built a bridge for using VLCj (VideoLAN) in jMonkeyEngine3. It's available here (self-plug warning): https://github.com/neph1/jme3-vlcj

(Beware the GPL license)