1

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()
ManoDestra
  • 6,325
  • 6
  • 26
  • 50
  • 1
    Hi. Welcome to SO. Please provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Andersnk Sep 12 '18 at 23:04

1 Answers1

1

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)

reden
  • 968
  • 7
  • 14
  • Hello, Thank you so much for guiding me. But, I am not able to Build a distribution in JMonkey. Can you help me with that as well? Thank you – Tasha Devgan Sep 15 '18 at 22:58
  • Did you check out the detailed post here? http://www.softwarepioneering.com/2016/12/playing-video-in-jmonkeyengine-3-using.html The first part handles building a maven project. – reden Sep 16 '18 at 07:32