0
    public static final String TAG = DefMediaPlayer.class.getName();
 
    private MediaPlayer mMediaPlayer = null;
 
    protected DefMediaPlayer() { 
        mMediaPlayer = new MediaPlayer();
        mMediaPlayer.setOnBufferingUpdateListener(this);
        mMediaPlayer.setOnCompletionListener(this);
        mMediaPlayer.setOnErrorListener(this);
        mMediaPlayer.setOnInfoListener(this);
        mMediaPlayer.setOnPreparedListener(this);
        mMediaPlayer.setOnSeekCompleteListener(this);
        mMediaPlayer.setOnVideoSizeChangedListener(this);
    } 
 
    @Override 
    public long getCurrentPosition() { 
        try { 
            return mMediaPlayer.getCurrentPosition();
        } catch (IllegalStateException e) {
Connect your IDE to all the code out there  Get Codota for Java