MediaPlayer setOnVideoSizeChangedListener - 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 setOnVideoSizeChangedListener method.

This code example shows how to use the following methods:prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
This code example shows how to use the following methods:prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:prepare, setAudioStreamType, setDataSource, setDisplay, setOnVideoSizeChangedListener
     * Initializes the media player and prepares it for video playback 
     */ 
    private void prepareMediaPlayer() { 
        if (videoSource != null && mVideoPreview.getHolder().getSurface().isValid()) {
            try { 
                mMediaPlayer = new MediaPlayer();
                mMediaPlayer.setOnVideoSizeChangedListener(mVideoSizeListener);
                mMediaPlayer.setAudioStreamType(AudioManager.STREAM_RING); // Use ringer volume
                mMediaPlayer.setDataSource(getActivity(), videoSource);
                mMediaPlayer.setDisplay(mVideoPreview.getHolder());
                mMediaPlayer.prepare();
 
            } 
            catch (IOException e) {
                // TODO Auto-generated catch block 
                e.printStackTrace();
            } 
        } 
    } 
 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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) {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
This code example shows how to use the following methods:prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
This code example shows how to use the following methods:prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
This code example shows how to use the following methods:prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
    private void playVideo(Integer Media) {
        doCleanUp(); 
        try { 
            Log.d(TAG, "Path: " + path);
            // Create a new media player and set the listeners 
            mMediaPlayer = new MediaPlayer();
 
            try{ 
            	mMediaPlayer.setDataSource(path);
 
            }catch (IOException eio) {
                Log.e(TAG, "error: " + eio.getMessage() + " -- " +
            path, eio);
 
    		} 
            mMediaPlayer.setDisplay(holder);
            mMediaPlayer.prepare();
            mMediaPlayer.setOnBufferingUpdateListener(this);
            mMediaPlayer.setOnCompletionListener(this);
            mMediaPlayer.setOnPreparedListener(this);

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
This code example shows how to use the following methods:prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener

Related MediaPlayer setOnVideoSizeChangedListener Questions & Answers:

setOnVideoSizeChangedListener Method Overview
Register a callback to be invoked when the video size is known or updated.
See Code Examples for other Android MediaPlayer Methods: