-1

I am writing a video player, then I find that android.media.MediaPlayer just cannot play the video because it cannot decode the video file. The amazing thing is that I tried to play a mp4 file in my device for many times, it didn't succed, then I change a video it succeed to play video.

So, If I want to play most of the video files, what choice do I have?

roger
  • 9,063
  • 20
  • 72
  • 119

1 Answers1

2

To play formats with no built in support on android, you can use external media libraries:

Open Source:

  1. LibVLC (Plays most formats, a little buggy) : https://github.com/mstorsjo/vlc-android
  2. LibFFMPEG (Will require some extra rendering code) : https://github.com/guardianproject/android-ffmpeg

Commercial:

  1. Vitamio (Plays stuff easily) : https://www.vitamio.org/en/

All of these are native (c/c++) components. So, these will require NDK build and JNI binding in order to be used. More importantly, make sure to initialize and release native players according to your View life cycle.

S.D.
  • 29,290
  • 3
  • 79
  • 130