Integration with Exoplayer (Android)

The Teltoo ExoPlayer library provides a way to create instances of MediaSource which can be directly used to call the prepare method of the ExoPlayer classes.

So to activate Teltoo, use the TeltooFactory class to create MediaSource instances instead of HlsMediaSourceDashMediaSource or SsMediaSource.

Teltoo Exoplayer library runs on the same process the application does. There are no other system processes launched by Teltoo SDK. Therefore, Teltoo will remain active, connected and seeding content as long as the player is playing the video stream. In other words, Teltoo lifecycle is tied to the MediaSource object.

Follow the steps below to complete the integration:

  1. Add the Teltoo Android repository and SDK dependency to the project build.gradle file, ie:
repositories { jcenter() google() maven { url "" } } dependencies { implementation 'com.teltoo:exoplayer:+' }
  1. Set the Teltoo ApiKey as a meta-data in the application manifest (AndroidManifest.xml):
  1. Set up the player

Create a TeltooExoplayer Factory:

TeltooExoplayer.Factory teltooFactory = new TeltooExoplayer.Factory(Context);

Create the MediaSource:

MediaSource teltooSource = teltooFactory.createMediaSource(Uri.parse(streamURL));

Prepare the ExoPlayer instance:


Optionally add a listener to receive Teltoo status information:

teltooFactory.addListener(new Teltoo.EventListener() {
        public void onError(String description) {
            Log.e (TAG, "TELTOO: error: "+description);
        public void onState(boolean connected) {
            Log.d (TAG, "TELTOO: connected: "+connected);
        public void onMessage(String message) {
            Log.d (TAG, "TELTOO: message: "+message);
        public void onStats(int connectedPeers, int totalBytesReceived, int p2pBytesReceived, int cacheBytes, int requestWithoutTeltoo) {
            Log.d (TAG, "TELTOO: stats: peers:"+connectedPeers+" p2p bytes:"+p2pBytesReceived);

Teltoo Android SDK is built using Android NDK, and it is compatible with all Android architectures. It is possible to create different application APK files for every architecture in order to reduce the application size. Check the link below or contact us for further information.

Want to know more?

Talk to an expert