HybridMediaPlayer

Additional

Language
Java
Version
1.2.5 (Apr 27, 2017)
Created
Nov 9, 2016
Updated
Apr 27, 2017
Owner
Mateusz Kaflowski (mkaflowski)
Contributor
Mateusz Kaflowski (mkaflowski)
1
Activity
Badge
Generate
Download
Source code

Advertising

HybridMediaPlayer

Android music player from URL. Uses ExoPlayer and MediaPlayer for lower APIs.

Installation

To use the library, first include it your project using Gradle

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

dependencies {
        compile 'com.github.mkaflowski:HybridMediaPlayer:1.x'
}

How to use

        HybridMediaPlayer mediaPlayer = HybridMediaPlayer.getInstance(context);
        mediaPlayer.setDataSource(url);
        mediaPlayer.prepare();

        mediaPlayer.setOnCompletionListener(this);
        mediaPlayer.setOnErrorListener(this);
        mediaPlayer.setOnPreparedListener(this);
        
        mediaPlayer.play();
        mediaPlayer.seekTo(1500);
        mediaPlayer.pause();
        
        mediaPlayer.release();