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

This code example shows how to use the following methods:prepare, setAudioStreamType, setDataSource, setScreenOnWhilePlaying
	private FileHelper fileHelper;
 
	//////// ********* Constructor ********* ////////// 
	public AudioPlay(String id, Context _context,Boolean isFav) {
		mContext = _context;
		mPlayer = new MediaPlayer();
		fileHelper = new FileHelper();
		if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED)) {
			mPath = getFile(isFav,id);
			mPlayer.setScreenOnWhilePlaying(true);
			mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
			try { 
				mPlayer.setDataSource(mPath.toString());
				mPlayer.prepare();
			} catch (IllegalStateException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} 
		} else { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:prepare, setDataSource, setDisplay, setOnCompletionListener, setOnErrorListener
This code example shows how to use the following methods:setDisplay, setOnBufferingUpdateListener, setOnCompletionListener, setOnErrorListener, setOnInfoListener
This code example shows how to use the following methods:prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setScreenOnWhilePlaying
//        mMediaPlayer.setAudioStreamType(streamMusic); 
//    } 
 
    @Override 
    public void setScreenOnWhilePlaying(boolean screenOn) {
        mMediaPlayer.setScreenOnWhilePlaying(screenOn);
    } 
 
    @Override 
    public void enableLog(boolean enable) {
        // not support 
    } 
 
    @Override 
    public boolean isBufferingEnd() { 
        return true; 
    } 
 
    @Override 
    public void onBufferingUpdate(MediaPlayer mp, int percent) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:prepareAsync, setAudioStreamType, setDataSource, setDisplay, setOnBufferingUpdateListener
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setScreenOnWhilePlaying
        player.setWakeMode(context, mode);
    } 
 
    @Override 
    public void setScreenOnWhilePlaying(boolean screenOn) {
        player.setScreenOnWhilePlaying(screenOn);
    } 
 
    @Override 
    public int getVideoWidth() { 
        return player.getVideoWidth();
    } 
 
    @Override 
    public int getVideoHeight() { 
        return player.getVideoHeight();
    } 
 
    @Override 
    public boolean isPlaying() { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

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 Code Examples for other Android MediaPlayer Methods: