Android ExoPlayer Using JNI/C++

Explayer fed via JNI

Android ExoPlayer Using JNI/C++

This is an oldie, but simple enough that you can create a new Android APK with ExoPlayer, update UI syntax for the 1 activiity, and include C++ support with the provided c++ file. I stopped writing ExoPlayer code, b/c I don’t do much UI, but it’s still top notch. 

I needed to connect ExoPlayer to my C++ video processing libraries. So I made this as a starting point while waiting for a better requirements definition… The demo will play a short video by using the (very extensible) ExoPlayer2 upstream.DataSource to read from something on the other side of the JNI. To make it simple and easy-to-read I included minimal code – just bare bones – there’s no error handling, efficiency, etc.

Here’s the Android Studio Project
Or, since its only a couple files, here is the Java file and the C++ file

 

If you’re simply looking into Android-based video players, I believe it even supports RTSP interleaved-tcp and probably much of WebRTC by the time this blog is read. Lower-level tooling you can look into are the Android Media NDKs (down thru OpenMaxAL), Gstreamer, FFMpeg, VLC, or search around github.