Example usage for android.media MediaPlayer isLooping

List of usage examples for android.media MediaPlayer isLooping

Introduction

In this page you can find the example usage for android.media MediaPlayer isLooping.

Prototype

public native boolean isLooping();

Source Link

Document

Checks whether the MediaPlayer is looping or non-looping.

Usage

From source file:com.shahenlibrary.VideoPlayer.VideoPlayerView.java

@Override
public void onCompletion(MediaPlayer mp) {
    if (mp == null) {
        return;//  w  w  w. ja  v  a  2  s  . c o  m
    }
    Log.d(LOG_TAG, "onCompletion: isLooping " + mp.isLooping());
    if (mLooping) {
        Log.d(LOG_TAG, "onCompletion: seek to start at : " + videoStartAt);
        mp.seekTo(videoStartAt);
    }
}

From source file:com.mylovemhz.simplay.MusicService.java

@Override
public void onCompletion(MediaPlayer mp) {
    if (!mp.isLooping()) {
        currentState = State.COMPLETED;
        if (hasNext()) {
            next();/* w  w  w .j a  va  2s. c  o m*/
        } else {
            stop();
        }
    }
}

From source file:com.kasungunathilaka.sarigama.service.PlayerService.java

public void onCompletion(MediaPlayer mp) {
    localBroadcastManager.sendBroadcast(new Intent(HomeActivity.ON_COMPLETED));
    this.seekTo(0);
    if (mp.isLooping()) {
        setPlayPause();//from ww w .jav  a2  s  .c  o  m
        localBroadcastManager.sendBroadcast(new Intent(HomeActivity.ON_PREPARED));
    } else {
        next();
    }
}