Example usage for android.media.session PlaybackState PLAYBACK_POSITION_UNKNOWN

List of usage examples for android.media.session PlaybackState PLAYBACK_POSITION_UNKNOWN

Introduction

In this page you can find the example usage for android.media.session PlaybackState PLAYBACK_POSITION_UNKNOWN.

Prototype

long PLAYBACK_POSITION_UNKNOWN

To view the source code for android.media.session PlaybackState PLAYBACK_POSITION_UNKNOWN.

Click Source Link

Document

Use this value for the position to indicate the position is not known.

Usage

From source file:com.android.tv.MainActivity.java

private void setMediaSessionPlaybackState(boolean isPlaying) {
    PlaybackState.Builder builder = new PlaybackState.Builder();
    builder.setState(isPlaying ? PlaybackState.STATE_PLAYING : PlaybackState.STATE_STOPPED,
            PlaybackState.PLAYBACK_POSITION_UNKNOWN,
            isPlaying ? MEDIA_SESSION_PLAYING_SPEED : MEDIA_SESSION_STOPPED_SPEED);
    mMediaSession.setPlaybackState(builder.build());
}