Example usage for android.media RemoteControlClient PLAYSTATE_PAUSED

List of usage examples for android.media RemoteControlClient PLAYSTATE_PAUSED

Introduction

In this page you can find the example usage for android.media RemoteControlClient PLAYSTATE_PAUSED.

Prototype

int PLAYSTATE_PAUSED

To view the source code for android.media RemoteControlClient PLAYSTATE_PAUSED.

Click Source Link

Document

Playback state of a RemoteControlClient which is paused.

Usage

From source file:com.google.android.libraries.cast.companionlibrary.cast.VideoCastManager.java

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
private void updateRemoteControl(boolean playing) {
    if (!isFeatureEnabled(FEATURE_LOCKSCREEN)) {
        return;//w ww .ja  va  2 s  .  c o m
    }
    if (!isConnected()) {
        return;
    }
    try {
        if ((mRemoteControlClientCompat == null) && playing) {
            setUpRemoteControl(getRemoteMediaInformation());
        }
        if (mRemoteControlClientCompat != null) {
            int playState = isRemoteStreamLive() ? RemoteControlClient.PLAYSTATE_BUFFERING
                    : RemoteControlClient.PLAYSTATE_PLAYING;
            mRemoteControlClientCompat
                    .setPlaybackState(playing ? playState : RemoteControlClient.PLAYSTATE_PAUSED);
        }
    } catch (TransientNetworkDisconnectionException | NoConnectionException e) {
        LOGE(TAG, "Failed to set up RCC due to network issues", e);
    }
}