@Override public boolean isPlaying() { int playbackState = player.getPlaybackState(); return playbackState != Player.STATE_IDLE && playbackState != Player.STATE_ENDED && player.getPlayWhenReady(); }
private boolean shouldShowControllerIndefinitely() { if (player == null) { return true; } int playbackState = player.getPlaybackState(); return controllerAutoShow && (playbackState == Player.STATE_IDLE || playbackState == Player.STATE_ENDED || !player.getPlayWhenReady()); }
private void updateBuffering() { if (bufferingView != null) { boolean showBufferingSpinner = player != null && player.getPlaybackState() == Player.STATE_BUFFERING && (showBuffering == SHOW_BUFFERING_ALWAYS || (showBuffering == SHOW_BUFFERING_WHEN_PLAYING && player.getPlayWhenReady())); bufferingView.setVisibility(showBufferingSpinner ? View.VISIBLE : View.GONE); } }
private boolean isPlayingAd() { return player != null && player.isPlayingAd() && player.getPlayWhenReady(); }
private boolean isPlaying() { return player != null && player.getPlaybackState() != Player.STATE_ENDED && player.getPlaybackState() != Player.STATE_IDLE && player.getPlayWhenReady(); }
if (player.getPlayWhenReady()) { stringActions.add(ACTION_PAUSE); } else {
} else if (!player.getPlayWhenReady()) { adsManager.pause();
wasPlayWhenReady = player.getPlayWhenReady(); lastPlaybackState = player.getPlaybackState(); player.addListener(playerListener);
switch (keyCode) { case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE: controlDispatcher.dispatchSetPlayWhenReady(player, !player.getPlayWhenReady()); break; case KeyEvent.KEYCODE_MEDIA_PLAY:
&& !player.isPlayingAd() && !player.isCurrentWindowDynamic() && player.getPlayWhenReady() && player.getPlaybackState() == Player.STATE_READY) { builder
if (playbackState != Player.STATE_IDLE && playbackState != Player.STATE_ENDED) { long delayMs; if (player.getPlayWhenReady() && playbackState == Player.STATE_READY) { float playbackSpeed = player.getPlaybackParameters().speed; if (playbackSpeed <= 0.1f) {
reportError ? PlaybackStateCompat.STATE_ERROR : mapPlaybackState(player.getPlaybackState(), player.getPlayWhenReady()); if (customError != null) { builder.setErrorMessage(customError.first, customError.second);
if (playbackState != Player.STATE_ENDED) { playbackPositionMs = this.currentPlayer.getCurrentPosition(); playWhenReady = this.currentPlayer.getPlayWhenReady(); windowIndex = this.currentPlayer.getCurrentWindowIndex(); if (windowIndex != currentItemIndex) {
private void requestPlayPauseFocus() { boolean playing = player != null && player.getPlayWhenReady(); if (!playing && playButton != null) { playButton.requestFocus(); } else if (playing && pauseButton != null) { pauseButton.requestFocus(); } if (!playing && playButtonLandScape != null) { playButtonLandScape.requestFocus(); } else if (playing && pauseButtonLandScape != null) { pauseButtonLandScape.requestFocus(); } }
private void playOrPause() { System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1); mHits[mHits.length - 1] = SystemClock.uptimeMillis(); if (500 > (SystemClock.uptimeMillis() - mHits[0])) { controlDispatcher.dispatchSetPlayWhenReady(player, !player.getPlayWhenReady()); } }
private void updateBuffering() { if (bufferingView != null) { boolean showBufferingSpinner = showBuffering && player != null && player.getPlaybackState() == Player.STATE_BUFFERING && player.getPlayWhenReady(); bufferingView.setVisibility(showBufferingSpinner ? View.VISIBLE : View.GONE); } }
private boolean shouldShowControllerIndefinitely() { if (player == null) { return true; } int playbackState = player.getPlaybackState(); return controllerAutoShow && (playbackState == Player.STATE_IDLE || playbackState == Player.STATE_ENDED || !player.getPlayWhenReady()); }
private boolean isPlayingAd() { return player != null && player.isPlayingAd() && player.getPlayWhenReady(); }
@Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { if (playbackState != Player.STATE_IDLE && centerError != null && centerError.getVisibility() == VISIBLE) { centerError.setVisibility(GONE); } if (playbackState == Player.STATE_IDLE || playbackState == Player.STATE_BUFFERING) { removeCallbacks(hideAction); showUtilHideCalled(); showLoading(true); } else if (playbackState == Player.STATE_READY && player.getPlayWhenReady() || playbackState == Player.STATE_ENDED) { showLoading(false); hide(); } updatePlayPauseButton(); updateProgress(); }
public void updatePlayPauseIconView() { if (!isVisible() || iconPlayPauseView == null) { return; } boolean requestPlayPauseFocus; requestPlayPauseFocus = getPlayer() != null && getPlayer().getPlayWhenReady(); if(requestPlayPauseFocus){ setPauseStateIcon(); } else { setPlayStateIcon(); } }