Exemplo n.º 1
0
  @Override
  public void onClientConnected(String clientId) {
    mMessageHandler.sendClientMessageTo(
        clientId,
        "new_session",
        mMessageHandler.buildSessionMessage(),
        CastMessageHandler.INVALID_SEQUENCE_NUMBER);

    if (mMediaPlayer != null && !isApiClientInvalid()) mMediaPlayer.requestStatus(mApiClient);
  }
Exemplo n.º 2
0
  @Override
  public void updateSessionStatus() {
    if (isApiClientInvalid()) return;

    try {
      mApplicationStatus = Cast.CastApi.getApplicationStatus(mApiClient);
      mApplicationMetadata = Cast.CastApi.getApplicationMetadata(mApiClient);

      updateNamespaces();

      mMessageHandler.broadcastClientMessage(
          "update_session", mMessageHandler.buildSessionMessage());
    } catch (IllegalStateException e) {
      Log.e(TAG, "Can't get application status", e);
    }
  }
Exemplo n.º 3
0
 @Override
 public void onVolumeChanged() {
   mMessageHandler.onVolumeChanged();
 }