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

This code example shows how to use the following methods: isLooping, isPlaying, pause, seekTo
		} 
	} 
	 
	public void stop() throws IOException 
	{ 
		if ( mp.isLooping() || mp.isPlaying() )
		{ 
			state = INVALID;
			mp.pause();
			mp.seekTo(0);
		} 
	} 
	 
	public void loop() throws IOException 
	{ 
		invokePlay( true ); 
	} 
	 
	public void unload() throws IOException 
	{ 
Full Snippet Info
10
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: isLooping, prepare, release, setDataSource, setLooping
 
    public static boolean isLooping(String filePath) {        
        MediaPlayer mp = null;
         
        try { 
            mp = new MediaPlayer();
            if (mp.isLooping()) {
                Log.v(TAG, "MediaPlayer.isLooping() returned true after ctor");
                return false; 
            } 
            mp.setDataSource(filePath);
            mp.prepare();
 
            mp.setLooping(true);
            if (!mp.isLooping()) {
                Log.v(TAG, "MediaPlayer.isLooping() returned false after setLooping(true)");
                return false; 
            } 
             
            mp.setLooping(false);

7
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: isLooping, isPlaying, prepare, reset, setDataSource
	} 
 
	private void playNotesound() { 
		try { 
			MediaPlayer mp = getMediaPlayer();
			if (mp.isPlaying() || mp.isLooping()) {
				mp.stop();
			} 
			mp.reset();
			FileInputStream fis = new FileInputStream(getCacheDir() + "/note.mid");
			mp.setDataSource(fis.getFD());
			mp.prepare();
			mp.start();
			fis.close();
		} catch (Exception e) {
			e.printStackTrace();
		} 
	} 
 
	private void setupListeners() { 
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: isLooping, isPlaying, prepare, stop
    public void start() { 
        player.start();
    } 
 
    public void stop() { 
        if (player.isLooping() && player.isPlaying()) {
            player.stop();
            try { 
                player.prepare();
            } catch (final IllegalStateException e) {
                Logger.debug("AndroidSounds.stop()", e.getMessage());
            } catch (final IOException e) {
                Logger.debug("AndroidSounds.stop()", e.getMessage());
            } 
        } 
    } 
 
    public void startLoop() { 
        player.setLooping(true);
        player.start();
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: isLooping, isPlaying, pause, seekTo
		} 
	} 
	 
	public void stop() throws IOException 
	{ 
		if ( mp.isLooping() || mp.isPlaying() )
		{ 
			state = INVALID;
			mp.pause();
			mp.seekTo(0);
		} 
	} 
	 
	public void loop() throws IOException 
	{ 
		invokePlay( true ); 
	} 
	 
	public void unload() throws IOException 
	{ 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related MediaPlayer isLooping Questions & Answers:

isLooping Method Overview
Checks whether the MediaPlayer is looping or non-looping.
See Code Examples for other Android MediaPlayer Methods: