CastPlayer extends BasePlayer { @Override public boolean getPlayWhenReady() { return playWhenReady.value; } CastPlayer(CastContext castContext); @Nullable PendingResult<MediaChannelResult> loadItem(MediaQueueItem item, long positionMs); @Nullable PendingResult<MediaChannelResult> loadItems(
      MediaQueueItem[] items, int startIndex, long positionMs, @RepeatMode int repeatMode); @Nullable PendingResult<MediaChannelResult> addItems(MediaQueueItem... items); @Nullable PendingResult<MediaChannelResult> addItems(int periodId, MediaQueueItem... items); @Nullable PendingResult<MediaChannelResult> removeItem(int periodId); @Nullable PendingResult<MediaChannelResult> moveItem(int periodId, int newIndex); @Nullable MediaQueueItem getItem(int periodId); boolean isCastSessionAvailable(); void setSessionAvailabilityListener(@Nullable SessionAvailabilityListener listener); @Override @Nullable AudioComponent getAudioComponent(); @Override @Nullable VideoComponent getVideoComponent(); @Override @Nullable TextComponent getTextComponent(); @Override @Nullable MetadataComponent getMetadataComponent(); @Override Looper getApplicationLooper(); @Override void addListener(EventListener listener); @Override void removeListener(EventListener listener); @Override @Player.State int getPlaybackState(); @Override @PlaybackSuppressionReason int getPlaybackSuppressionReason(); @Override @Nullable ExoPlaybackException getPlaybackError(); @Override void setPlayWhenReady(boolean playWhenReady); @Override boolean getPlayWhenReady(); @Override void seekTo(int windowIndex, long positionMs); @Override void setPlaybackParameters(@Nullable PlaybackParameters playbackParameters); @Override PlaybackParameters getPlaybackParameters(); @Override void stop(boolean reset); @Override void release(); @Override int getRendererCount(); @Override int getRendererType(int index); @Override void setRepeatMode(@RepeatMode int repeatMode); @Override @RepeatMode int getRepeatMode(); @Override void setShuffleModeEnabled(boolean shuffleModeEnabled); @Override boolean getShuffleModeEnabled(); @Override TrackSelectionArray getCurrentTrackSelections(); @Override TrackGroupArray getCurrentTrackGroups(); @Override Timeline getCurrentTimeline(); @Override int getCurrentPeriodIndex(); @Override int getCurrentWindowIndex(); @Override long getDuration(); @Override long getCurrentPosition(); @Override long getBufferedPosition(); @Override long getTotalBufferedDuration(); @Override boolean isPlayingAd(); @Override int getCurrentAdGroupIndex(); @Override int getCurrentAdIndexInAdGroup(); @Override boolean isLoading(); @Override long getContentPosition(); @Override long getContentBufferedPosition();  }
@Test public void testPlayWhenReady_changesOnStatusUpdates() { assertThat(castPlayer.getPlayWhenReady()).isFalse(); when(mockRemoteMediaClient.isPaused()).thenReturn(false); remoteMediaClientListener.onStatusUpdated(); verify(mockListener).onPlayerStateChanged(true, Player.STATE_IDLE); assertThat(castPlayer.getPlayWhenReady()).isTrue(); }