@Test public void noChangeIfPlayerStatusIsError() { PlaybackVolumeUpdater playbackVolumeUpdater = new PlaybackVolumeUpdater(); when(mediaPlayer.getPlayerStatus()).thenReturn(PlayerStatus.ERROR); FeedMedia feedMedia = mockFeedMedia(); when(mediaPlayer.getPlayable()).thenReturn(feedMedia); playbackVolumeUpdater.updateVolumeIfNecessary(mediaPlayer, FEED_ID, VolumeAdaptionSetting.OFF); verify(mediaPlayer, never()).pause(anyBoolean(), anyBoolean()); verify(mediaPlayer, never()).resume(); }
public void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId, VolumeAdaptionSetting volumeAdaptionSetting) { Playable playable = mediaPlayer.getPlayable(); if (playable instanceof FeedMedia) { updateFeedMediaVolumeIfNecessary(mediaPlayer, feedId, volumeAdaptionSetting, (FeedMedia) playable); } }
PlaybackVolumeUpdater { public void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId, VolumeAdaptionSetting volumeAdaptionSetting) { Playable playable = mediaPlayer.getPlayable(); if (playable instanceof FeedMedia) { updateFeedMediaVolumeIfNecessary(mediaPlayer, feedId, volumeAdaptionSetting, (FeedMedia) playable); } } }
PlaybackVolumeUpdater { public void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId, VolumeAdaptionSetting volumeAdaptionSetting) { Playable playable = mediaPlayer.getPlayable(); if (playable instanceof FeedMedia) { updateFeedMediaVolumeIfNecessary(mediaPlayer, feedId, volumeAdaptionSetting, (FeedMedia) playable); } }  }
PlaybackVolumeUpdater { public void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId, VolumeAdaptionSetting volumeAdaptionSetting) { Playable playable = mediaPlayer.getPlayable(); if (playable instanceof FeedMedia) { updateFeedMediaVolumeIfNecessary(mediaPlayer, feedId, volumeAdaptionSetting, (FeedMedia) playable); } }  void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId,
                                        VolumeAdaptionSetting volumeAdaptionSetting); }
PlaybackVolumeUpdater { public void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId, VolumeAdaptionSetting volumeAdaptionSetting) { Playable playable = mediaPlayer.getPlayable(); if (playable instanceof FeedMedia) { updateFeedMediaVolumeIfNecessary(mediaPlayer, feedId, volumeAdaptionSetting, (FeedMedia) playable); } }  void updateVolumeIfNecessary(PlaybackServiceMediaPlayer mediaPlayer, long feedId,
                                        VolumeAdaptionSetting volumeAdaptionSetting);  }