@Override public void onLoadingChanged(boolean isLoading) { if (targetIsLoading == isLoading) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } });
@Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { if (targetPlaybackState == playbackState) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } });
@Override public void onTimelineChanged( Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) { if (expectedTimeline == null || timeline.equals(expectedTimeline)) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } };
@Override public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } });
@Override public void onSeekProcessed() { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } });
/** * Stops periodic updates of the {@link TextView}. Must be called from the application's main * thread. */ public final void stop() { if (!started) { return; } started = false; player.removeListener(this); textView.removeCallbacks(this); }
@Override public void onPlayerStateChanged(boolean playWhenReady, int playbackState) { if (targetPlaybackState == playbackState) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } });
@Override public void onSeekProcessed() { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } });
@Override public void onPositionDiscontinuity(@Player.DiscontinuityReason int reason) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } });
@Override public void onTimelineChanged( Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) { if (expectedTimeline == null || timeline.equals(expectedTimeline)) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } };
@Override public void onLoadingChanged(boolean isLoading) { if (targetIsLoading == isLoading) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } });
@Override protected void doActionAndScheduleNextImpl( final SimpleExoPlayer player, final DefaultTrackSelector trackSelector, final Surface surface, final HandlerWrapper handler, final ActionNode nextAction) { if (nextAction == null) { return; } Player.EventListener listener = new Player.EventListener() { @Override public void onTimelineChanged( Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) { if (expectedTimeline == null || timeline.equals(expectedTimeline)) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } }; player.addListener(listener); if (expectedTimeline != null && player.getCurrentTimeline().equals(expectedTimeline)) { player.removeListener(listener); nextAction.schedule(player, trackSelector, surface, handler); } }
@Override public void destroy() { isPreparing = true; isBuffering = false; updateStatus(IPlayer.STATE_END); mInternalPlayer.removeListener(mEventListener); mInternalPlayer.removeVideoListener(mVideoListener); mInternalPlayer.release(); }
@Override protected void doActionAndScheduleNextImpl( final SimpleExoPlayer player, final DefaultTrackSelector trackSelector, final Surface surface, final HandlerWrapper handler, final ActionNode nextAction) { if (nextAction == null) { return; } Player.EventListener listener = new Player.EventListener() { @Override public void onTimelineChanged( Timeline timeline, @Nullable Object manifest, @Player.TimelineChangeReason int reason) { if (expectedTimeline == null || timeline.equals(expectedTimeline)) { player.removeListener(this); nextAction.schedule(player, trackSelector, surface, handler); } } }; player.addListener(listener); if (expectedTimeline != null && player.getCurrentTimeline().equals(expectedTimeline)) { player.removeListener(listener); nextAction.schedule(player, trackSelector, surface, handler); } }
public void destroyPlayer() { if (DEBUG) Log.d(TAG, "destroyPlayer() called"); if (simpleExoPlayer != null) { simpleExoPlayer.removeListener(this); simpleExoPlayer.stop(); simpleExoPlayer.release(); } if (isProgressLoopRunning()) stopProgressLoop(); if (playQueue != null) playQueue.dispose(); if (audioReactor != null) audioReactor.dispose(); if (playbackManager != null) playbackManager.dispose(); if (mediaSessionManager != null) mediaSessionManager.dispose(); if (playQueueAdapter != null) { playQueueAdapter.unsetSelectedListener(); playQueueAdapter.dispose(); } }
/** * Stops periodic updates of the {@link TextView}. Must be called from the application's main * thread. */ public void stop() { if (!started) { return; } started = false; player.removeListener(this); textView.removeCallbacks(this); }
/** * Stops periodic updates of the {@link TextView}. Must be called from the application's main * thread. */ public void stop() { if (!started) { return; } started = false; player.removeListener(this); viewGroup.removeCallbacks(this); }
private void releaseResources(boolean releasePlayer) { if (releasePlayer && mExoPlayer != null) { mExoPlayer.release(); mExoPlayer.removeListener(mEventListener); mExoPlayer = null; mExoPlayerNullIsStopped = true; mPlayOnFocusGain = false; } }
@Override public void onDestroy() { pause(); exoPlayer.release(); exoPlayer.removeListener(this); if(telephonyManager != null) telephonyManager.listen(phoneStateListener, PhoneStateListener.LISTEN_NONE); notificationManager.cancelNotify(); mediaSession.release(); unregisterReceiver(becomingNoisyReceiver); super.onDestroy(); }
public void finish() { mVideoPlayer.setPlayWhenReady(false); mVideoPlayer.seekTo(0); mVideoPlayer.removeListener(this); mVideoPlayer.release(); getActivity().finish(); }