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

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

MediaPlayer setScreenOnWhilePlaying examples from Open Source projects
This code example shows how to use the following methods: prepare, setAudioStreamType, setDataSource, setScreenOnWhilePlaying
28:	mPlayer = new MediaPlayer(); 
-
32:	mPlayer.setScreenOnWhilePlaying(true); 
33:	mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); 
-
35:	mPlayer.setDataSource(mPath.toString()); 
36:	mPlayer.prepare(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: prepare, setDataSource, setDisplay, setOnCompletionListener, setOnErrorListener
123:	mMediaPlayer = new MediaPlayer(); 
124:	mMediaPlayer.setOnPreparedListener(mPreparedListener); 
-
126:	mMediaPlayer.setOnCompletionListener(mCompletionListener); 
127:	mMediaPlayer.setOnErrorListener(mErrorListener); 
128:	mMediaPlayer.setDataSource(mContext, mUri); 
129:	mMediaPlayer.setDisplay(mSurfaceHolder); 
130:	mMediaPlayer.setScreenOnWhilePlaying(true); 
131:	mMediaPlayer.prepare(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setDisplay, setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener, setOnInfoListener
52:	player = new MediaPlayer(); 
-
54:	player.setDisplay(holder); 
55:	player.setScreenOnWhilePlaying(true); 
56:	player.setOnPreparedListener(this); 
57:	player.setOnBufferingUpdateListener(this); 
58:	player.setOnErrorListener(this); 
59:	player.setOnCompletionListener(this); 
60:	player.setOnInfoListener(this); 
61:	player.setOnSeekCompleteListener(this); 
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: setScreenOnWhilePlaying
186:	mMediaPlayer.setScreenOnWhilePlaying(screenOn); 
Full Snippet Info
5
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: setScreenOnWhilePlaying
98:	player.setScreenOnWhilePlaying(screenOn); 
Full Snippet Info
4
CodeRank
Related MediaPlayer setScreenOnWhilePlaying Questions & Answers:
setScreenOnWhilePlaying Method Overview
Control whether we should use the attached SurfaceHolder to keep the screen on while video playback is occurring.
See Also