Java Code Examples for com.google.android.gms.cast.framework.CastSession#isConnected()

The following examples show how to use com.google.android.gms.cast.framework.CastSession#isConnected() . 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: QueueDataProvider.java    From CastVideos-android with Apache License 2.0 5 votes vote down vote up
private RemoteMediaClient getRemoteMediaClient() {
    CastSession castSession = CastContext.getSharedInstance(mAppContext).getSessionManager()
            .getCurrentCastSession();
    if (castSession == null || !castSession.isConnected()) {
        Log.w(TAG, "Trying to get a RemoteMediaClient when no CastSession is started.");
        return null;
    }
    return castSession.getRemoteMediaClient();
}
 
Example 2
Source File: QueueListViewFragment.java    From CastVideos-android with Apache License 2.0 5 votes vote down vote up
private RemoteMediaClient getRemoteMediaClient() {
    CastSession castSession =
            CastContext.getSharedInstance(getContext()).getSessionManager()
                    .getCurrentCastSession();
    if (castSession != null && castSession.isConnected()) {
        return castSession.getRemoteMediaClient();
    }
    return null;
}
 
Example 3
Source File: StreamFragment.java    From Pocket-Plays-for-Twitch with GNU General Public License v3.0 4 votes vote down vote up
private boolean isCastConnected() {
    CastSession session = mCastContext != null ? mCastContext.getSessionManager().getCurrentCastSession() : null;
    return session != null && session.isConnected();
}
 
Example 4
Source File: QueueListViewActivity.java    From CastVideos-android with Apache License 2.0 4 votes vote down vote up
private RemoteMediaClient getRemoteMediaClient() {
    CastSession castSession = mCastContext.getSessionManager().getCurrentCastSession();
    return (castSession != null && castSession.isConnected())
            ? castSession.getRemoteMediaClient() : null;
}
 
Example 5
Source File: CastPlayback.java    From klingar with Apache License 2.0 4 votes vote down vote up
@Override public boolean isConnected() {
  CastSession castSession = CastContext.getSharedInstance(appContext).getSessionManager()
      .getCurrentCastSession();
  return castSession != null && castSession.isConnected();
}