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

This code example shows how to use the following methods: isPlaying, release, stop
            throw new RuntimeException("Couldn't load music");
        } 
    } 
 
    public void dispose() { 
        if (mediaPlayer.isPlaying())
            mediaPlayer.stop();
        mediaPlayer.release();
    } 
 
    public boolean isLooping() { 
        return mediaPlayer.isLooping();
    } 
 
    public boolean isPlaying() { 
        return mediaPlayer.isPlaying();
    } 
 
    public boolean isStopped() { 
        return !isPrepared;
Full Snippet Info
8
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: isPlaying
			mediaPlayer.setVolume(volume * globalVolume, volume * globalVolume);
		} 
	} 
 
	private boolean mayKeepSong(String fileName) {
		return (fileName.equals(currentTrack) && mediaPlayer.isPlaying());
	} 
 
	public void play(String fileName, float volume, float speed, boolean loop) {
		if (mediaPlayer != null) {
			if (mayKeepSong(fileName)) {
				return; 
			} else { 
				mediaPlayer.stop();
			} 
		} 
		currentTrack = fileName;
 
		float streamVolume = manager.getStreamVolume(AudioManager.STREAM_MUSIC);
		streamVolume /= manager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
Full Snippet Info
8
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: isPlaying, release, stop
	/** 
	 * Get rid of the music 
	 */ 
	public void dispose() { 
		 
		if (mediaPlayer.isPlaying()) {
			 
			mediaPlayer.stop();
		} 
		 
		mediaPlayer.release();
	} 
 
	/** 
	 * Called internal 
	 *  
	 * @param MediaPlayer mediaPlayer 
	 */ 
	public void onCompletion(MediaPlayer mediaPlayer) {
		 
Full Snippet Info
8
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: isPlaying, stop
    } 
  } 
   
  @Override 
  public void onPause() { 
    if (player.isPlaying()) {
      player.stop();
    } 
     
    super.onPause(); 
  } 
   
  public void onPrepared(MediaPlayer player) {
    player.start();
  } 
} 
Full Snippet Info
9
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: isPlaying
	} 
 
	public void testGetMediaPlayer() { 
		MediaPlayer mediaPlayer = SoundManager.getInstance().getMediaPlayer();
		assertNotNull("SoundManager failed to return a MediaPlayer", mediaPlayer);
		assertFalse("SoundManager provided a MediaPlayer that was already playing", mediaPlayer.isPlaying());
	} 
 
	public void testClear() { 
		SoundManager soundManager = SoundManager.getInstance();
		soundManager.clear();
		assertEquals("SoundManager was destroyed when calling clear", soundManager, SoundManager.getInstance());
 
		MediaPlayer mediaPlayer = SoundManager.getInstance().getMediaPlayer();
		assertNotNull("SoundManager failed to return a MediaPlayer after clear", mediaPlayer);
		assertFalse("SoundManager provided a MediaPlayer that was already playing", mediaPlayer.isPlaying());
	} 
 
	public void testPauseAndResume() throws IllegalStateException, IOException, InterruptedException { 
		final String soundFilePath = soundFile.getAbsolutePath();
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related MediaPlayer isPlaying Questions & Answers:

Other MediaPlayer isPlaying Examples

88:					// check for already playing
89:					if(mp.isPlaying()){
90:						if(mp!=null){
91:							mp.pause();
92:							// Changing button image to play button

Read More

isPlaying Method Overview
Checks whether the MediaPlayer is playing.
See Code Examples for other Android MediaPlayer Methods: