Example usage for android.support.v4.media.session PlaybackStateCompat STATE_STOPPED

List of usage examples for android.support.v4.media.session PlaybackStateCompat STATE_STOPPED

Introduction

In this page you can find the example usage for android.support.v4.media.session PlaybackStateCompat STATE_STOPPED.

Prototype

int STATE_STOPPED

To view the source code for android.support.v4.media.session PlaybackStateCompat STATE_STOPPED.

Click Source Link

Document

State indicating this item is currently stopped.

Usage

From source file:com.murati.oszk.audiobook.playback.CastPlayback.java

@Override
public void stop(boolean notifyListeners) {
    mRemoteMediaClient.removeListener(mRemoteMediaClientListener);
    mPlaybackState = PlaybackStateCompat.STATE_STOPPED;
    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mPlaybackState);
    }//  www .  j ava 2 s.  c om
}

From source file:com.classiqo.nativeandroid_32bitz.playback.CastPlayback.java

@Override
public void stop(boolean notifyListeners) {
    mRemoteMediaClient.removeListener(mRemoteMediaClientListener);
    mState = PlaybackStateCompat.STATE_STOPPED;

    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mState);
    }/* w  w w . j a v a 2  s. co m*/
}

From source file:com.example.android.uamp.playback.CastPlayback.java

@Override
public void stop(boolean notifyListeners) {
    mRemoteMediaClient.removeListener(mRemoteMediaClientListener);
    mState = PlaybackStateCompat.STATE_STOPPED;
    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mState);
    }//from   www.  java 2  s.  c  om
}

From source file:com.example.chu.googleplaylibrary.playback.CastPlayback.java

@Override
public void stop(boolean notifyListeners) {
    VideoCastManager.getInstance().removeVideoCastConsumer(mCastConsumer);
    mState = PlaybackStateCompat.STATE_STOPPED;
    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mState);
    }// w ww . j a  v a  2  s  .  com
}

From source file:com.torrenttunes.android.CastPlayback.java

@Override
public void stop(boolean notifyListeners) {
    mCastManager.removeVideoCastConsumer(mCastConsumer);
    mState = PlaybackStateCompat.STATE_STOPPED;
    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mState);
    }//from  w w w.j  a va  2  s.c o  m
}

From source file:org.gateshipone.odyssey.playbackservice.managers.PlaybackServiceStatusHelper.java

/**
 * Stops the android mediasession.//from  w w  w. j a  va2  s. c  om
 */
public void stopMediaSession() {
    // Make sure to remove the old metadata.
    mMediaSession.setPlaybackState(
            new PlaybackStateCompat.Builder().setState(PlaybackStateCompat.STATE_STOPPED, 0, 0.0f).build());
    // Clear last track so that covers load again when resuming.
    mLastTrack = null;
    // Actual session disable.
    mMediaSession.setActive(false);
}

From source file:com.scooter1556.sms.android.playback.CastPlayback.java

@Override
public void stop(boolean notifyListeners) {
    Log.d(TAG, "stop()");

    playbackState = PlaybackStateCompat.STATE_STOPPED;

    if (notifyListeners && callback != null) {
        callback.onPlaybackStatusChanged(playbackState);
    }/*from   w ww .j av a 2 s  . c  om*/

    currentJobId = null;
}

From source file:com.classiqo.nativeandroid_32bitz.playback.LocalPlayback.java

@Override
public void stop(boolean notifyListeners) {
    mState = PlaybackStateCompat.STATE_STOPPED;

    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mState);
    }/* w w  w  . ja  va 2  s . com*/
    mCurrentPosition = getCurrentStreamPosition();
    giveUpAudioFocus();
    unregisterAudioNoisyReceiver();

    relaxResources(true);
}

From source file:com.classiqo.nativeandroid_32bitz.ui.BaseActivity.java

protected boolean shouldShowControls() {
    MediaControllerCompat mediaController = getSupportMediaController();

    if (mediaController == null || mediaController.getMetadata() == null
            || mediaController.getPlaybackState() == null) {
        return false;
    }// w w w  .  ja  v  a  2s .c o  m

    switch (mediaController.getPlaybackState().getState()) {
    case PlaybackStateCompat.STATE_ERROR:
    case PlaybackStateCompat.STATE_NONE:
    case PlaybackStateCompat.STATE_STOPPED:
        return false;
    default:
        return true;
    }
}

From source file:com.example.android.mediabrowserservice.Playback.java

public void stop(boolean notifyListeners) {
    mState = PlaybackStateCompat.STATE_STOPPED;
    if (notifyListeners && mCallback != null) {
        mCallback.onPlaybackStatusChanged(mState);
    }/*  w ww .j av a  2s . co  m*/
    mCurrentPosition = getCurrentStreamPosition();
    // Give up Audio focus
    giveUpAudioFocus();
    unregisterAudioNoisyReceiver();
    // Relax all resources
    relaxResources(true);
    if (mWifiLock.isHeld()) {
        mWifiLock.release();
    }
}