Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to play videos with LibGDX?

I want to put a video as my splash screen in Android, but I dont want to use the Android SDK, because I am using LibGDX and I am almost finished :/

share|improve this question
up vote 11 down vote accepted

Playing video with LibGDX has been defined as out of scope for the project. So no, you cannot play videos using LibGDX.

This does not preclude the possibility of writing code specific to Android to play videos though. It just means your application won't maintain the portability of LibGDX.

share|improve this answer
:( ok thanks for that answer :/ I suppose that I have to use Android SDK, thanks :) – Rudy_TM Jun 14 '12 at 16:01
I did it with Android :) I created a new Activity and a new Layout, and when the video finishes its playback, I start the activity that has the call to libGDX – Rudy_TM Jun 14 '12 at 17:17
Nice! That was fast, I guess it wasn't too hard to do after all. – Byte56 Jun 14 '12 at 17:18
@Rudy_TM please add this as the accepted answer -- that you got around it with a new Activity. That will help others who have the same question later. – ashes999 Jun 14 '12 at 17:34
It's pretty easy to write platform specific code in libgdx, so just because it doesn't support video out of the box doesn't mean it can't be done, as your answer implies. – Matsemann Jun 14 '12 at 17:46

As Byte56 said, in libGDX you cannot play videos :( so i did this:

I created a new activity "SplashScreen"

public class SplashScreen extends Activity implements OnCompletionListener
    public void onCreate(Bundle savedInstanceState)


        String fileName = "android.resource://"+  getPackageName() +"/raw/video";

         VideoView vv = (VideoView) this.findViewById(;


    public void onCompletion(MediaPlayer mp) 
        // TODO Auto-generated method stub
        Intent intent = new Intent(this, libgdx.class);

In the "onCompletion" method, I use the intent to call my new activity where the "initialize" call for the libGDX engine to work

And a new layout for the videoView

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
    android:orientation="horizontal" >

        android:layout_gravity="center" >


share|improve this answer
+1 Thanks for posting this answer, it will be helpful to future visitors. – Byte56 Jun 14 '12 at 17:56
You are welcome :) I spent two days trying different things XD and this was the last one :P – Rudy_TM Jun 14 '12 at 18:02
It's always the last one right? I guess because you stop looking after that :p. Also congrats on nearly being done! – Byte56 Jun 14 '12 at 18:05
hehe thanks :) XD – Rudy_TM Jun 14 '12 at 18:17
@G3tinmybelly in your manifest change your splash screen to the launcher activity instead of the MainActivity, – Rudy_TM Jun 24 '14 at 16:49

This is the way to play: libname is "indiespot-media-0.8.09.jar" which you can get here.

How to use:

  1. Download full zip
  2. Copy lib folder in the root of project (ffmpeg will be opened by lib with path ./lib/ffmpeg/ffmpeg@os postfix@)
player = new MoviePlayer(videoFile);
Texure playerTexture = new Texture(,, 
  Pixmap.Format.RGBA8888) {

  public void bind() {, player.textureHandle);
  1. use playerTexture as usual texture
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.