Java Code Examples for android.media.RemoteControlClient#PLAYSTATE_REWINDING

The following examples show how to use android.media.RemoteControlClient#PLAYSTATE_REWINDING . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MediaProviderDelegate.java    From Noyze with Apache License 2.0 6 votes vote down vote up
static int getStateFromPlayState(PlayState playState) {
    switch (playState) {
        case BUFFERING:
            return RemoteControlClient.PLAYSTATE_BUFFERING;
        case ERROR:
            return RemoteControlClient.PLAYSTATE_ERROR;
        case FAST_FORWARDING:
            return RemoteControlClient.PLAYSTATE_FAST_FORWARDING;
        case PAUSED:
            return RemoteControlClient.PLAYSTATE_PAUSED;
        case PLAYING:
            return RemoteControlClient.PLAYSTATE_PLAYING;
        case REWINDING:
            return RemoteControlClient.PLAYSTATE_REWINDING;
        case SKIPPING_BACKWARDS:
            return RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS;
        case SKIPPING_FORWARDS:
            return RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS;
        case STOPPED:
            return RemoteControlClient.PLAYSTATE_STOPPED;
        default:
            return RemoteControlClient.PLAYSTATE_ERROR;
    }
}
 
Example 2
Source File: PlaybackInfo.java    From Noyze with Apache License 2.0 6 votes vote down vote up
public boolean wasPlayingRecently() {
    switch (mState) {
        case RemoteControlClient.PLAYSTATE_PLAYING:
        case RemoteControlClient.PLAYSTATE_FAST_FORWARDING:
        case RemoteControlClient.PLAYSTATE_REWINDING:
        case RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS:
        case RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS:
        case RemoteControlClient.PLAYSTATE_BUFFERING:
            // actively playing or about to play
            return true;
        case RemoteControlClient.PLAYSTATE_STOPPED:
        case RemoteControlClient.PLAYSTATE_PAUSED:
        case RemoteControlClient.PLAYSTATE_ERROR:
            return ((SystemClock.elapsedRealtime() - mStateChangeTimeMs) < DISPLAY_TIMEOUT_MS);
        default:
            LOGE("PlaybackInfo", "Unknown playback state " + mState + " in wasPlayingRecently()");
            return false;
    }
}
 
Example 3
Source File: MediaProviderDelegate.java    From Noyze with Apache License 2.0 6 votes vote down vote up
static int getStateFromPlayState(PlayState playState) {
    switch (playState) {
        case BUFFERING:
            return RemoteControlClient.PLAYSTATE_BUFFERING;
        case ERROR:
            return RemoteControlClient.PLAYSTATE_ERROR;
        case FAST_FORWARDING:
            return RemoteControlClient.PLAYSTATE_FAST_FORWARDING;
        case PAUSED:
            return RemoteControlClient.PLAYSTATE_PAUSED;
        case PLAYING:
            return RemoteControlClient.PLAYSTATE_PLAYING;
        case REWINDING:
            return RemoteControlClient.PLAYSTATE_REWINDING;
        case SKIPPING_BACKWARDS:
            return RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS;
        case SKIPPING_FORWARDS:
            return RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS;
        case STOPPED:
            return RemoteControlClient.PLAYSTATE_STOPPED;
        default:
            return RemoteControlClient.PLAYSTATE_ERROR;
    }
}
 
Example 4
Source File: PlaybackInfo.java    From Noyze with Apache License 2.0 6 votes vote down vote up
public boolean wasPlayingRecently() {
    switch (mState) {
        case RemoteControlClient.PLAYSTATE_PLAYING:
        case RemoteControlClient.PLAYSTATE_FAST_FORWARDING:
        case RemoteControlClient.PLAYSTATE_REWINDING:
        case RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS:
        case RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS:
        case RemoteControlClient.PLAYSTATE_BUFFERING:
            // actively playing or about to play
            return true;
        case RemoteControlClient.PLAYSTATE_STOPPED:
        case RemoteControlClient.PLAYSTATE_PAUSED:
        case RemoteControlClient.PLAYSTATE_ERROR:
            return ((SystemClock.elapsedRealtime() - mStateChangeTimeMs) < DISPLAY_TIMEOUT_MS);
        default:
            LOGE("PlaybackInfo", "Unknown playback state " + mState + " in wasPlayingRecently()");
            return false;
    }
}
 
Example 5
Source File: Constants.java    From Noyze with Apache License 2.0 5 votes vote down vote up
public static boolean isRemoteControlPlaying(final int state) {
    switch (state) {
        case RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS:
        case RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS:
        case RemoteControlClient.PLAYSTATE_BUFFERING:
        case RemoteControlClient.PLAYSTATE_FAST_FORWARDING:
        case RemoteControlClient.PLAYSTATE_PLAYING:
        case RemoteControlClient.PLAYSTATE_REWINDING:
            return true;
    }

    return false;
}
 
Example 6
Source File: Constants.java    From Noyze with Apache License 2.0 5 votes vote down vote up
public static boolean isRemoteControlPlaying(final int state) {
    switch (state) {
        case RemoteControlClient.PLAYSTATE_SKIPPING_BACKWARDS:
        case RemoteControlClient.PLAYSTATE_SKIPPING_FORWARDS:
        case RemoteControlClient.PLAYSTATE_BUFFERING:
        case RemoteControlClient.PLAYSTATE_FAST_FORWARDING:
        case RemoteControlClient.PLAYSTATE_PLAYING:
        case RemoteControlClient.PLAYSTATE_REWINDING:
            return true;
    }

    return false;
}