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
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();
            } 
        } 
    } 
 
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: 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: 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: