public void release() {
        if(mCurrentState == State.RELEASING || mCurrentState == State.RELEASED) {
            return;
        }

        mCurrentState = State.RELEASING;
        stop();
        releaseMediaExtractors();
        mCurrentState = State.RELEASED;

        // Listeners must not be invoked after the player is released so we clear them here
        // https://github.com/protyposis/MediaPlayer-Extended/issues/66
        mOnBufferingUpdateListener = null;
        mOnCompletionListener = null;
        mOnErrorListener = null;
        mOnInfoListener = null;
        mOnPreparedListener = null;
        mOnSeekCompleteListener = null;
        mOnSeekListener = null;
        mOnVideoSizeChangedListener = null;
    }
Stops the player and releases all resources (e.g. memory, codecs, event listeners). Once
the player instance is released, it cannot be used any longer.
Call this method as soon as you're finished using the player instance, and latest when
destroying the activity or fragment that contains this player. Not releasing the player can
lead to memory leaks.
MediaPlayer/src/main/java/net/protyposis/android/mediaplayer/MediaPlayer.java