Best code examples for MediaPlayer setOnVideoSizeChangedListener method (android.media.MediaPlayer.setOnVideoSizeChangedListener)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for MediaPlayer setOnVideoSizeChangedListener method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

MediaPlayer setOnVideoSizeChangedListener examples from Open Source projects
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
24:	mediaPlayer.prepare(); 
-
26:	mediaPlayer.setOnCompletionListener(this); 
27:	mediaPlayer.setOnSeekCompleteListener(this); 
28:	mediaPlayer.setOnPreparedListener(this); 
29:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
65:	mMediaPlayer = new MediaPlayer(); 
66:	mMediaPlayer.setDataSource(path); 
-
68:	mMediaPlayer.setDisplay(holder); 
69:	mMediaPlayer.prepare(); 
70:	mMediaPlayer.setOnBufferingUpdateListener(this); 
71:	mMediaPlayer.setOnCompletionListener(this); 
72:	mMediaPlayer.setOnPreparedListener(this); 
73:	mMediaPlayer.setOnVideoSizeChangedListener(this); 
74:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setDisplay, setOnVideoSizeChangedListener
142:	mMediaPlayer = new MediaPlayer(); 
143:	mMediaPlayer.setOnVideoSizeChangedListener(mVideoSizeListener); 
144:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_RING); // Use ringer volume 
145:	mMediaPlayer.setDataSource(getActivity(), videoSource); 
146:	mMediaPlayer.setDisplay(mVideoPreview.getHolder()); 
147:	mMediaPlayer.prepare(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener, setOnInfoListener, setOnPreparedListener
50:	mMediaPlayer = new MediaPlayer(); 
51:	mMediaPlayer.setOnBufferingUpdateListener(this); 
52:	mMediaPlayer.setOnCompletionListener(this); 
53:	mMediaPlayer.setOnErrorListener(this); 
54:	mMediaPlayer.setOnInfoListener(this); 
55:	mMediaPlayer.setOnPreparedListener(this); 
56:	mMediaPlayer.setOnSeekCompleteListener(this); 
57:	mMediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), assetDescriptor.getStartOffset(), assetDescriptor.getLength()); 
22:	mediaPlayer.prepare(); 
-
24:	mediaPlayer.setOnCompletionListener(this); 
25:	mediaPlayer.setOnSeekCompleteListener(this); 
26:	mediaPlayer.setOnPreparedListener(this); 
27:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
20:	mediaPlayer = new MediaPlayer(); 
-
22:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
25:	mediaPlayer.prepare(); 
-
27:	mediaPlayer.setOnCompletionListener(this); 
28:	mediaPlayer.setOnSeekCompleteListener(this); 
29:	mediaPlayer.setOnPreparedListener(this); 
30:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
24:	mediaPlayer.prepare(); 
-
26:	mediaPlayer.setOnCompletionListener(this); 
27:	mediaPlayer.setOnSeekCompleteListener(this); 
28:	mediaPlayer.setOnPreparedListener(this); 
29:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
58:	mMediaPlayer = new MediaPlayer(); 
-
61:	mMediaPlayer.setDataSource(path); 
-
68:	mMediaPlayer.setDisplay(holder); 
69:	mMediaPlayer.prepare(); 
70:	mMediaPlayer.setOnBufferingUpdateListener(this); 
71:	mMediaPlayer.setOnCompletionListener(this); 
72:	mMediaPlayer.setOnPreparedListener(this); 
73:	mMediaPlayer.setOnVideoSizeChangedListener(this); 
74:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
20:	mediaPlayer = new MediaPlayer(); 
-
22:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
25:	mediaPlayer.prepare(); 
-
27:	mediaPlayer.setOnCompletionListener(this); 
28:	mediaPlayer.setOnSeekCompleteListener(this); 
29:	mediaPlayer.setOnPreparedListener(this); 
30:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
24:	mediaPlayer.prepare(); 
-
26:	mediaPlayer.setOnCompletionListener(this); 
27:	mediaPlayer.setOnSeekCompleteListener(this); 
28:	mediaPlayer.setOnPreparedListener(this); 
29:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
24:	mediaPlayer.prepare(); 
-
26:	mediaPlayer.setOnCompletionListener(this); 
27:	mediaPlayer.setOnSeekCompleteListener(this); 
28:	mediaPlayer.setOnPreparedListener(this); 
29:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
24:	mediaPlayer.prepare(); 
-
26:	mediaPlayer.setOnCompletionListener(this); 
27:	mediaPlayer.setOnSeekCompleteListener(this); 
28:	mediaPlayer.setOnPreparedListener(this); 
29:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
53:	mMediaPlayer = new MediaPlayer(); 
54:	mMediaPlayer.setDataSource(path); 
55:	mMediaPlayer.setDisplay(holder); 
56:	mMediaPlayer.prepare(); 
57:	mMediaPlayer.setOnBufferingUpdateListener(this); 
58:	mMediaPlayer.setOnCompletionListener(this); 
59:	mMediaPlayer.setOnPreparedListener(this); 
60:	mMediaPlayer.setOnVideoSizeChangedListener(this); 
61:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
20:	mediaPlayer = new MediaPlayer(); 
-
22:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
25:	mediaPlayer.prepare(); 
-
27:	mediaPlayer.setOnCompletionListener(this); 
28:	mediaPlayer.setOnSeekCompleteListener(this); 
29:	mediaPlayer.setOnPreparedListener(this); 
30:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setOnCompletionListener, setOnPreparedListener, setOnSeekCompleteListener
19:	mediaPlayer = new MediaPlayer(); 
-
21:	mediaPlayer.setDataSource(assetDescriptor.getFileDescriptor(), 
-
24:	mediaPlayer.prepare(); 
-
26:	mediaPlayer.setOnCompletionListener(this); 
27:	mediaPlayer.setOnSeekCompleteListener(this); 
28:	mediaPlayer.setOnPreparedListener(this); 
29:	mediaPlayer.setOnVideoSizeChangedListener(this); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
129:	mMediaPlayer = new MediaPlayer(); 
130:	mMediaPlayer.setDataSource(path); 
131:	mMediaPlayer.setDisplay(holder); 
132:	mMediaPlayer.prepare(); 
133:	mMediaPlayer.setOnBufferingUpdateListener(this); 
134:	mMediaPlayer.setOnCompletionListener(this); 
135:	mMediaPlayer.setOnPreparedListener(this); 
136:	mMediaPlayer.setOnVideoSizeChangedListener(this); 
137:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setOnVideoSizeChangedListener
203:	player.setOnVideoSizeChangedListener(listener); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getDuration, prepare, setAudioStreamType, setDataSource, setDisplay
154:	mMediaPlayer = new MediaPlayer(); 
155:	mMediaPlayer.setDataSource(path); 
156:	mMediaPlayer.setDisplay(holder); 
157:	mMediaPlayer.prepare(); 
158:	mMediaPlayer.setOnBufferingUpdateListener(this); 
159:	mMediaPlayer.setOnCompletionListener(this); 
160:	mMediaPlayer.setOnPreparedListener(this); 
161:	mMediaPlayer.setOnVideoSizeChangedListener(this); 
162:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
163:	mSeekBar.setMax(mMediaPlayer.getDuration()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
56:	mp = new MediaPlayer(); 
-
58:	mp.setDataSource(vedioPath); 
-
60:	mp.setDisplay(sfHolder); 
61:	mp.setAudioStreamType(AudioManager.STREAM_MUSIC); 
-
65:	mp.prepare(); 
66:	mp.setOnBufferingUpdateListener(mpBufUpdListener); 
67:	mp.setOnCompletionListener(mpCompletListener); 
68:	mp.setOnPreparedListener(mpPrepListener); 
69:	mp.setOnVideoSizeChangedListener(mpVidSizeChgListener); 
70:	mp.start(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
247:	mMediaPlayer = new MediaPlayer(); 
248:	mMediaPlayer.setOnPreparedListener(mPreparedListener); 
249:	mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener); 
-
253:	mMediaPlayer.setOnCompletionListener(mCompletionListener); 
254:	mMediaPlayer.setOnErrorListener(mErrorListener); 
255:	mMediaPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener); 
-
257:	mMediaPlayer.setDataSource(mContext, mUri); 
258:	mMediaPlayer.setDisplay(mSurfaceHolder); 
259:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
260:	mMediaPlayer.setScreenOnWhilePlaying(true); 
261:	mMediaPlayer.prepareAsync(); 
Full Snippet Info
3
CodeRank
This code example shows how to use the following methods: prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
218:	mMediaPlayer = new MediaPlayer(); 
219:	mMediaPlayer.setOnPreparedListener(mPreparedListener); 
220:	mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener); 
-
224:	mMediaPlayer.setOnCompletionListener(mCompletionListener); 
225:	mMediaPlayer.setOnErrorListener(mErrorListener); 
226:	mMediaPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener); 
-
228:	mMediaPlayer.setDataSource(mContext, mUri); 
229:	mMediaPlayer.setDisplay(mSurfaceHolder); 
230:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
231:	mMediaPlayer.setScreenOnWhilePlaying(true); 
232:	mMediaPlayer.prepareAsync(); 
Full Snippet Info
3
CodeRank
This code example shows how to use the following methods: prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
218:	mMediaPlayer = new MediaPlayer(); 
219:	mMediaPlayer.setOnPreparedListener(mPreparedListener); 
220:	mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener); 
-
224:	mMediaPlayer.setOnCompletionListener(mCompletionListener); 
225:	mMediaPlayer.setOnErrorListener(mErrorListener); 
226:	mMediaPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener); 
-
228:	mMediaPlayer.setDataSource(mContext, mUri); 
229:	mMediaPlayer.setDisplay(mSurfaceHolder); 
230:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
231:	mMediaPlayer.setScreenOnWhilePlaying(true); 
232:	mMediaPlayer.prepareAsync(); 
Full Snippet Info
3
CodeRank
This code example shows how to use the following methods: prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
218:	mMediaPlayer = new MediaPlayer(); 
219:	mMediaPlayer.setOnPreparedListener(mPreparedListener); 
220:	mMediaPlayer.setOnVideoSizeChangedListener(mSizeChangedListener); 
-
224:	mMediaPlayer.setOnCompletionListener(mCompletionListener); 
225:	mMediaPlayer.setOnErrorListener(mErrorListener); 
226:	mMediaPlayer.setOnBufferingUpdateListener(mBufferingUpdateListener); 
-
228:	mMediaPlayer.setDataSource(mContext, mUri); 
229:	mMediaPlayer.setDisplay(mSurfaceHolder); 
230:	mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
231:	mMediaPlayer.setScreenOnWhilePlaying(true); 
232:	mMediaPlayer.prepareAsync(); 
Full Snippet Info
3
CodeRank
This code example shows how to use the following methods: getDuration, prepare, release, setAudioStreamType, setDataSource
257:	mp = new MediaPlayer(); 
258:	mp.setAudioStreamType(AudioManager.STREAM_MUSIC); 
-
260:	mp.setOnErrorListener(this); 
-
262:	mp.setDisplay(mHolder); 
-
265:	mp.setDataSource(path); 
-
271:	mp.prepare(); 
272:	Log.v(TAG, "Duration:  ===>" + mp.getDuration()); 
273:	mp.setOnBufferingUpdateListener(this); 
274:	mp.setOnCompletionListener(this); 
275:	mp.setOnVideoSizeChangedListener(this); 
276:	mp.setOnPreparedListener(this); 
-
289:	mp.stop(); 
290:	mp.release(); 
Full Snippet Info
3
CodeRank
Related MediaPlayer setOnVideoSizeChangedListener Questions & Answers:
MediaPlayer class can be used to control playback of audio/video files and streams. An example on how to use the methods in this class can be found in VideoView.

Topics covered here are: State Diagram Valid and Invalid States Permissions Register informational and error callbacks Developer Guides For more information about how to use MediaPlayer, read the Media Playback developer guide. State Diagram Playback control of audio/video files and streams is managed as a state machine. The following diagram shows the life cycle and the states of a MediaPlayer object driven by the supported playback control operations. The ovals represent the states a MediaPlayer object may reside in. The arcs represent the playback control operations that drive the object state transition. There are two types of arcs. The arcs with a single arrow head represent synchronous method calls, while those with a double arrow head represent asynchronous method calls.From this state diagram, one can...
setOnVideoSizeChangedListener Method Overview
Register a callback to be invoked when the video size is known or updated.
See Also
  • isLooping
    Checks whether the MediaPlayer is looping or non-looping.
  • isPlaying
    Checks whether the MediaPlayer is playing.
  • prepare
    Prepares the player for playback, synchronously.
  • prepareAsync
    Prepares the player for playback, asynchronously.
  • release
    Releases resources associated with this MediaPlayer object.
  • reset
    Resets the MediaPlayer to its uninitialized state.
  • seekTo
    Seeks to specified time position.
  • setDataSource
    Sets the data source (file-path or http/rtsp URL) to use.
  • setDisplay
    Sets the SurfaceHolder to use for displaying the video portion of the media.
  • setLooping
    Sets the player to be looping or non-looping.
  • setOnCompletionListener
    Register a callback to be invoked when the end of a media source has been reached during playback.
  • setOnErrorListener
    Register a callback to be invoked when an error has happened during an asynchronous operation.
  • setOnInfoListener
    Register a callback to be invoked when an info/warning is available.
  • setScreenOnWhilePlaying
    Control whether we should use the attached SurfaceHolder to keep the screen on while video playback is occurring.
  • setWakeMode
    Set the low-level power management behavior for this MediaPlayer.
  • start
    Starts or resumes playback.
  • stop
    Stops playback after playback has been stopped or paused.