MediaPlayer setOnInfoListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for MediaPlayer setOnInfoListener method.

This code example shows how to use the following methods: setOnInfoListener
        player.setOnErrorListener(listener);
    } 
 
    @Override 
    public void setOnInfoListener(OnInfoListener listener) {
        player.setOnInfoListener(listener);
    } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: prepareAsync, setDataSource, setOnCompletionListener, setOnErrorListener, setOnInfoListener
        throws java.io.IOException 
    { 
        Log.i(TAG, "AudioPlayerControl constructed with path " + path);
        this.path = path;
 
        player = new MediaPlayer();
        player.setDataSource(path);
 
        player.setOnPreparedListener(listenerActivity);
        player.setOnInfoListener(listenerActivity);
        player.setOnErrorListener(listenerActivity);
        player.setOnCompletionListener(listenerActivity);
        /* 
        player.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { 
                public void onCompletion(MediaPlayer mp) { 
                    Log.i(TAG, "AudioPlayerControl onCompletion called"); 
                    player.reset(); 
                } 
            }); 
        */ 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener, setOnInfoListener, setOnPreparedListener
    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) {
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: prepareAsync, setDataSource, setOnCompletionListener, setOnInfoListener, setOnPreparedListener
This code example shows how to use the following methods: setDisplay, setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener, setOnInfoListener

Related MediaPlayer setOnInfoListener Questions & Answers:

setOnInfoListener Method Overview
Register a callback to be invoked when an info/warning is available.
See Code Examples for other Android MediaPlayer Methods: