Java Code Examples for org.chromium.chrome.browser.media.remote.RemoteVideoInfo.PlayerState#FINISHED
The following examples show how to use
org.chromium.chrome.browser.media.remote.RemoteVideoInfo.PlayerState#FINISHED .
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: ExpandedControllerActivity.java From delion with Apache License 2.0 | 6 votes |
@Override protected void onResume() { super.onResume(); if (mVideoInfo.state == PlayerState.FINISHED) finish(); if (mMediaRouteController == null) return; // Lifetime of the media element is bound to that of the {@link MediaStateListener} // of the {@link MediaRouteController}. RecordCastAction.recordFullscreenControlsShown( mMediaRouteController.getMediaStateListener() != null); mMediaRouteController.prepareMediaRoute(); ImageView iv = (ImageView) findViewById(R.id.cast_background_image); if (iv == null) return; Bitmap posterBitmap = mMediaRouteController.getPoster(); if (posterBitmap != null) iv.setImageBitmap(posterBitmap); iv.setImageAlpha(POSTER_IMAGE_ALPHA); }
Example 2
Source File: ExpandedControllerActivity.java From 365browser with Apache License 2.0 | 6 votes |
@Override protected void onResume() { super.onResume(); if (mVideoInfo.state == PlayerState.FINISHED) finish(); if (mMediaRouteController == null) return; // Lifetime of the media element is bound to that of the {@link MediaStateListener} // of the {@link MediaRouteController}. RecordCastAction.recordFullscreenControlsShown( mMediaRouteController.getMediaStateListener() != null); mMediaRouteController.prepareMediaRoute(); ImageView iv = (ImageView) findViewById(R.id.cast_background_image); if (iv == null) return; Bitmap posterBitmap = mMediaRouteController.getPoster(); if (posterBitmap != null) iv.setImageBitmap(posterBitmap); iv.setImageAlpha(POSTER_IMAGE_ALPHA); }
Example 3
Source File: ExpandedControllerActivity.java From AndroidChromium with Apache License 2.0 | 6 votes |
@Override protected void onResume() { super.onResume(); if (mVideoInfo.state == PlayerState.FINISHED) finish(); if (mMediaRouteController == null) return; // Lifetime of the media element is bound to that of the {@link MediaStateListener} // of the {@link MediaRouteController}. RecordCastAction.recordFullscreenControlsShown( mMediaRouteController.getMediaStateListener() != null); mMediaRouteController.prepareMediaRoute(); ImageView iv = (ImageView) findViewById(R.id.cast_background_image); if (iv == null) return; Bitmap posterBitmap = mMediaRouteController.getPoster(); if (posterBitmap != null) iv.setImageBitmap(posterBitmap); iv.setImageAlpha(POSTER_IMAGE_ALPHA); }
Example 4
Source File: ExpandedControllerActivity.java From AndroidChromium with Apache License 2.0 | 5 votes |
@Override public void onPlaybackStateChanged(PlayerState newState) { RemoteVideoInfo videoInfo = new RemoteVideoInfo(mVideoInfo); videoInfo.state = newState; setVideoInfo(videoInfo); scheduleProgressUpdate(); if (newState == PlayerState.FINISHED || newState == PlayerState.INVALIDATED) { // If we are switching to a finished state, stop the notifications. finish(); } }
Example 5
Source File: ExpandedControllerActivity.java From 365browser with Apache License 2.0 | 5 votes |
@Override public void onPlaybackStateChanged(PlayerState newState) { RemoteVideoInfo videoInfo = new RemoteVideoInfo(mVideoInfo); videoInfo.state = newState; setVideoInfo(videoInfo); scheduleProgressUpdate(); if (newState == PlayerState.FINISHED || newState == PlayerState.INVALIDATED) { // If we are switching to a finished state, stop the notifications. finish(); } }
Example 6
Source File: ExpandedControllerActivity.java From 365browser with Apache License 2.0 | 5 votes |
@Override public boolean dispatchKeyEvent(KeyEvent event) { int keyCode = event.getKeyCode(); if ((keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_VOLUME_UP) || mVideoInfo.state == PlayerState.FINISHED) { return super.dispatchKeyEvent(event); } return handleVolumeKeyEvent(mMediaRouteController, event); }
Example 7
Source File: RemoteMediaPlayerBridge.java From 365browser with Apache License 2.0 | 5 votes |
@Override public void onPlaybackStateChanged(PlayerState newState) { if (mNativeRemoteMediaPlayerBridge == 0) return; if (newState == PlayerState.FINISHED || newState == PlayerState.INVALIDATED) { nativeOnPlaybackFinished(mNativeRemoteMediaPlayerBridge); } else if (newState == PlayerState.PLAYING) { nativeOnPlaying(mNativeRemoteMediaPlayerBridge); } else if (newState == PlayerState.PAUSED) { mPauseRequested = false; nativeOnPaused(mNativeRemoteMediaPlayerBridge); } }
Example 8
Source File: AbstractMediaRouteController.java From AndroidChromium with Apache License 2.0 | 5 votes |
@VisibleForTesting void setPlayerStateForMediaItemState(int state) { PlayerState playerState = PlayerState.STOPPED; switch (state) { case MediaItemStatus.PLAYBACK_STATE_BUFFERING: playerState = PlayerState.LOADING; break; case MediaItemStatus.PLAYBACK_STATE_CANCELED: playerState = PlayerState.FINISHED; break; case MediaItemStatus.PLAYBACK_STATE_ERROR: playerState = PlayerState.ERROR; break; case MediaItemStatus.PLAYBACK_STATE_FINISHED: playerState = PlayerState.FINISHED; break; case MediaItemStatus.PLAYBACK_STATE_INVALIDATED: playerState = PlayerState.INVALIDATED; break; case MediaItemStatus.PLAYBACK_STATE_PAUSED: if (isAtEndOfVideo(getPosition(), getDuration())) { playerState = PlayerState.FINISHED; } else { playerState = PlayerState.PAUSED; } break; case MediaItemStatus.PLAYBACK_STATE_PENDING: playerState = PlayerState.PAUSED; break; case MediaItemStatus.PLAYBACK_STATE_PLAYING: playerState = PlayerState.PLAYING; break; default: break; } mRemotePlayerState = playerState; }
Example 9
Source File: RemoteMediaPlayerBridge.java From delion with Apache License 2.0 | 5 votes |
@Override public void onPlaybackStateChanged(PlayerState newState) { if (mNativeRemoteMediaPlayerBridge == 0) return; if (newState == PlayerState.FINISHED || newState == PlayerState.INVALIDATED) { nativeOnPlaybackFinished(mNativeRemoteMediaPlayerBridge); } else if (newState == PlayerState.PLAYING) { nativeOnPlaying(mNativeRemoteMediaPlayerBridge); } else if (newState == PlayerState.PAUSED) { mPauseRequested = false; nativeOnPaused(mNativeRemoteMediaPlayerBridge); } }
Example 10
Source File: ExpandedControllerActivity.java From AndroidChromium with Apache License 2.0 | 5 votes |
@Override public boolean dispatchKeyEvent(KeyEvent event) { int keyCode = event.getKeyCode(); if ((keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_VOLUME_UP) || mVideoInfo.state == PlayerState.FINISHED) { return super.dispatchKeyEvent(event); } return handleVolumeKeyEvent(mMediaRouteController, event); }
Example 11
Source File: RemoteMediaPlayerBridge.java From AndroidChromium with Apache License 2.0 | 5 votes |
@Override public void onPlaybackStateChanged(PlayerState newState) { if (mNativeRemoteMediaPlayerBridge == 0) return; if (newState == PlayerState.FINISHED || newState == PlayerState.INVALIDATED) { nativeOnPlaybackFinished(mNativeRemoteMediaPlayerBridge); } else if (newState == PlayerState.PLAYING) { nativeOnPlaying(mNativeRemoteMediaPlayerBridge); } else if (newState == PlayerState.PAUSED) { mPauseRequested = false; nativeOnPaused(mNativeRemoteMediaPlayerBridge); } }
Example 12
Source File: AbstractMediaRouteController.java From delion with Apache License 2.0 | 5 votes |
@VisibleForTesting void setPlayerStateForMediaItemState(int state) { PlayerState playerState = PlayerState.STOPPED; switch (state) { case MediaItemStatus.PLAYBACK_STATE_BUFFERING: playerState = PlayerState.LOADING; break; case MediaItemStatus.PLAYBACK_STATE_CANCELED: playerState = PlayerState.FINISHED; break; case MediaItemStatus.PLAYBACK_STATE_ERROR: playerState = PlayerState.ERROR; break; case MediaItemStatus.PLAYBACK_STATE_FINISHED: playerState = PlayerState.FINISHED; break; case MediaItemStatus.PLAYBACK_STATE_INVALIDATED: playerState = PlayerState.INVALIDATED; break; case MediaItemStatus.PLAYBACK_STATE_PAUSED: if (isAtEndOfVideo(getPosition(), getDuration())) { playerState = PlayerState.FINISHED; } else { playerState = PlayerState.PAUSED; } break; case MediaItemStatus.PLAYBACK_STATE_PENDING: playerState = PlayerState.PAUSED; break; case MediaItemStatus.PLAYBACK_STATE_PLAYING: playerState = PlayerState.PLAYING; break; default: break; } mRemotePlayerState = playerState; }
Example 13
Source File: AbstractMediaRouteController.java From 365browser with Apache License 2.0 | 5 votes |
@VisibleForTesting void setPlayerStateForMediaItemState(int state) { PlayerState playerState = PlayerState.STOPPED; switch (state) { case MediaItemStatus.PLAYBACK_STATE_BUFFERING: playerState = PlayerState.LOADING; break; case MediaItemStatus.PLAYBACK_STATE_CANCELED: playerState = PlayerState.FINISHED; break; case MediaItemStatus.PLAYBACK_STATE_ERROR: playerState = PlayerState.ERROR; break; case MediaItemStatus.PLAYBACK_STATE_FINISHED: playerState = PlayerState.FINISHED; break; case MediaItemStatus.PLAYBACK_STATE_INVALIDATED: playerState = PlayerState.INVALIDATED; break; case MediaItemStatus.PLAYBACK_STATE_PAUSED: if (isAtEndOfVideo(getPosition(), getDuration())) { playerState = PlayerState.FINISHED; } else { playerState = PlayerState.PAUSED; } break; case MediaItemStatus.PLAYBACK_STATE_PENDING: playerState = PlayerState.PAUSED; break; case MediaItemStatus.PLAYBACK_STATE_PLAYING: playerState = PlayerState.PLAYING; break; default: break; } mRemotePlayerState = playerState; }
Example 14
Source File: ExpandedControllerActivity.java From delion with Apache License 2.0 | 5 votes |
@Override public boolean dispatchKeyEvent(KeyEvent event) { int keyCode = event.getKeyCode(); if ((keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_VOLUME_UP) || mVideoInfo.state == PlayerState.FINISHED) { return super.dispatchKeyEvent(event); } return handleVolumeKeyEvent(mMediaRouteController, event); }
Example 15
Source File: AbstractMediaRouteController.java From AndroidChromium with Apache License 2.0 | 4 votes |
/** * Clear the current playing item (if any) but not the associated session. */ protected void clearItemState() { mRemotePlayerState = PlayerState.FINISHED; mDisplayedPlayerState = PlayerState.FINISHED; updateTitle(null); }
Example 16
Source File: AbstractMediaRouteController.java From AndroidChromium with Apache License 2.0 | 4 votes |
@Override public final boolean isBeingCast() { return (mIsPrepared && mRemotePlayerState != PlayerState.INVALIDATED && mRemotePlayerState != PlayerState.ERROR && mRemotePlayerState != PlayerState.FINISHED); }
Example 17
Source File: AbstractMediaRouteController.java From delion with Apache License 2.0 | 4 votes |
@Override public final boolean isBeingCast() { return (mIsPrepared && mRemotePlayerState != PlayerState.INVALIDATED && mRemotePlayerState != PlayerState.ERROR && mRemotePlayerState != PlayerState.FINISHED); }
Example 18
Source File: AbstractMediaRouteController.java From delion with Apache License 2.0 | 4 votes |
/** * Clear the current playing item (if any) but not the associated session. */ protected void clearItemState() { mRemotePlayerState = PlayerState.FINISHED; mDisplayedPlayerState = PlayerState.FINISHED; updateTitle(null); }
Example 19
Source File: AbstractMediaRouteController.java From 365browser with Apache License 2.0 | 4 votes |
/** * Clear the current playing item (if any) but not the associated session. */ protected void clearItemState() { mRemotePlayerState = PlayerState.FINISHED; mDisplayedPlayerState = PlayerState.FINISHED; updateTitle(null); }
Example 20
Source File: AbstractMediaRouteController.java From 365browser with Apache License 2.0 | 4 votes |
@Override public final boolean isBeingCast() { return (mIsPrepared && mRemotePlayerState != PlayerState.INVALIDATED && mRemotePlayerState != PlayerState.ERROR && mRemotePlayerState != PlayerState.FINISHED); }