Remove RemotePlayer

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217708323
This commit is contained in:
aquilescanta 2018-10-18 08:56:36 -07:00 committed by Oliver Woodman
parent 50dd089794
commit 80e9c84a9e
4 changed files with 33 additions and 52 deletions

View File

@ -33,7 +33,7 @@ import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.Timeline.Period; import com.google.android.exoplayer2.Timeline.Period;
import com.google.android.exoplayer2.ext.cast.CastPlayer; import com.google.android.exoplayer2.ext.cast.CastPlayer;
import com.google.android.exoplayer2.ext.cast.MediaItem; import com.google.android.exoplayer2.ext.cast.MediaItem;
import com.google.android.exoplayer2.ext.cast.RemotePlayer; import com.google.android.exoplayer2.ext.cast.SessionAvailabilityListener;
import com.google.android.exoplayer2.source.ConcatenatingMediaSource; import com.google.android.exoplayer2.source.ConcatenatingMediaSource;
import com.google.android.exoplayer2.source.ExtractorMediaSource; import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.source.MediaSource; import com.google.android.exoplayer2.source.MediaSource;
@ -52,7 +52,7 @@ import java.util.ArrayList;
/** Manages players and an internal media queue for the ExoPlayer/Cast demo app. */ /** Manages players and an internal media queue for the ExoPlayer/Cast demo app. */
/* package */ class DefaultReceiverPlayerManager /* package */ class DefaultReceiverPlayerManager
implements EventListener, RemotePlayer.SessionAvailabilityListener, PlayerManager { implements EventListener, SessionAvailabilityListener, PlayerManager {
private static final String USER_AGENT = "ExoCastDemoPlayer"; private static final String USER_AGENT = "ExoCastDemoPlayer";
private static final DefaultHttpDataSourceFactory DATA_SOURCE_FACTORY = private static final DefaultHttpDataSourceFactory DATA_SOURCE_FACTORY =

View File

@ -53,8 +53,8 @@ import java.util.concurrent.CopyOnWriteArraySet;
* *
* <p>The behavior of this class depends on the underlying Cast session, which is obtained from the * <p>The behavior of this class depends on the underlying Cast session, which is obtained from the
* Cast context passed to {@link #CastPlayer}. To keep track of the session, {@link * Cast context passed to {@link #CastPlayer}. To keep track of the session, {@link
* #isCastSessionAvailable()} can be queried and {@link RemotePlayer.SessionAvailabilityListener} * #isCastSessionAvailable()} can be queried and {@link SessionAvailabilityListener} can be
* can be implemented and attached to the player. * implemented and attached to the player.
* *
* <p>If no session is available, the player state will remain unchanged and calls to methods that * <p>If no session is available, the player state will remain unchanged and calls to methods that
* alter it will be ignored. Querying the player state is possible even when no session is * alter it will be ignored. Querying the player state is possible even when no session is
@ -88,7 +88,7 @@ public final class CastPlayer extends BasePlayer {
// Listeners. // Listeners.
private final CopyOnWriteArraySet<EventListener> listeners; private final CopyOnWriteArraySet<EventListener> listeners;
private RemotePlayer.SessionAvailabilityListener sessionAvailabilityListener; private SessionAvailabilityListener sessionAvailabilityListener;
// Internal state. // Internal state.
private CastTimeline currentTimeline; private CastTimeline currentTimeline;
@ -257,9 +257,9 @@ public final class CastPlayer extends BasePlayer {
/** /**
* Sets a listener for updates on the cast session availability. * Sets a listener for updates on the cast session availability.
* *
* @param listener The {@link RemotePlayer.SessionAvailabilityListener}. * @param listener The {@link SessionAvailabilityListener}.
*/ */
public void setSessionAvailabilityListener(RemotePlayer.SessionAvailabilityListener listener) { public void setSessionAvailabilityListener(SessionAvailabilityListener listener) {
sessionAvailabilityListener = listener; sessionAvailabilityListener = listener;
} }

View File

@ -1,45 +0,0 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer2.ext.cast;
import com.google.android.exoplayer2.Player;
/** A {@link Player} for playing media remotely using the Google Cast framework. */
public interface RemotePlayer extends Player {
/** Listener of changes in the cast session availability. */
interface SessionAvailabilityListener {
/** Called when a cast session becomes available to the player. */
void onCastSessionAvailable();
/** Called when the cast session becomes unavailable. */
void onCastSessionUnavailable();
}
/** Returns whether a cast session is available. */
boolean isCastSessionAvailable();
/**
* Sets a listener for updates on the cast session availability.
*
* @param listener The {@link SessionAvailabilityListener}.
*/
void setSessionAvailabilityListener(SessionAvailabilityListener listener);
/** Returns the {@link MediaItemQueue} associated to this player. */
MediaItemQueue getMediaItemQueue();
}

View File

@ -0,0 +1,26 @@
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer2.ext.cast;
/** Listener of changes in the cast session availability. */
public interface SessionAvailabilityListener {
/** Called when a cast session becomes available to the player. */
void onCastSessionAvailable();
/** Called when the cast session becomes unavailable. */
void onCastSessionUnavailable();
}