Skip to content

Commit

Permalink
fix compile issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzhengfw committed Dec 3, 2021
1 parent 05621a0 commit 6cda639
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 55 deletions.
2 changes: 1 addition & 1 deletion demos/cast/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<application android:label="@string/application_name" android:icon="@mipmap/ic_launcher"
android:largeHeap="true" android:allowBackup="false">

<meta-data android:name="com.firework.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
<meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.firework.android.exoplayer2.ext.cast.DefaultCastOptionsProvider"/>

<activity android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion extensions/cast/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle"

dependencies {
api 'com.firework.android.gms:play-services-cast-framework:20.0.0'
api 'com.google.android.gms:play-services-cast-framework:20.0.0'
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
implementation project(modulePrefix + 'library-common')
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@
import com.firework.android.exoplayer2.util.MimeTypes;
import com.firework.android.exoplayer2.util.Util;
import com.firework.android.exoplayer2.video.VideoSize;
import com.firework.android.gms.cast.CastStatusCodes;
import com.firework.android.gms.cast.MediaInfo;
import com.firework.android.gms.cast.MediaQueueItem;
import com.firework.android.gms.cast.MediaStatus;
import com.firework.android.gms.cast.MediaTrack;
import com.firework.android.gms.cast.framework.CastContext;
import com.firework.android.gms.cast.framework.CastSession;
import com.firework.android.gms.cast.framework.SessionManager;
import com.firework.android.gms.cast.framework.SessionManagerListener;
import com.firework.android.gms.cast.framework.media.RemoteMediaClient;
import com.firework.android.gms.cast.framework.media.RemoteMediaClient.MediaChannelResult;
import com.firework.android.gms.common.api.PendingResult;
import com.firework.android.gms.common.api.ResultCallback;

import com.google.android.gms.cast.CastStatusCodes;
import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaQueueItem;
import com.google.android.gms.cast.MediaStatus;
import com.google.android.gms.cast.MediaTrack;
import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastSession;
import com.google.android.gms.cast.framework.SessionManager;
import com.google.android.gms.cast.framework.SessionManagerListener;
import com.google.android.gms.cast.framework.media.RemoteMediaClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.ResultCallback;
import com.google.common.collect.ImmutableList;
import java.util.List;
import org.checkerframework.checker.nullness.compatqual.NullableType;
Expand Down Expand Up @@ -413,12 +413,12 @@ public void setPlayWhenReady(boolean playWhenReady) {
setPlayerStateAndNotifyIfChanged(
playWhenReady, PLAY_WHEN_READY_CHANGE_REASON_USER_REQUEST, playbackState);
listeners.flushEvents();
PendingResult<MediaChannelResult> pendingResult =
PendingResult<RemoteMediaClient.MediaChannelResult> pendingResult =
playWhenReady ? remoteMediaClient.play() : remoteMediaClient.pause();
this.playWhenReady.pendingResultCallback =
new ResultCallback<MediaChannelResult>() {
new ResultCallback<RemoteMediaClient.MediaChannelResult>() {
@Override
public void onResult(MediaChannelResult mediaChannelResult) {
public void onResult(RemoteMediaClient.MediaChannelResult mediaChannelResult) {
if (remoteMediaClient != null) {
updatePlayerStateAndNotifyIfChanged(this);
listeners.flushEvents();
Expand Down Expand Up @@ -531,12 +531,12 @@ public void setPlaybackParameters(PlaybackParameters playbackParameters) {
playbackParameters.speed, MIN_SPEED_SUPPORTED, MAX_SPEED_SUPPORTED));
setPlaybackParametersAndNotifyIfChanged(actualPlaybackParameters);
listeners.flushEvents();
PendingResult<MediaChannelResult> pendingResult =
PendingResult<RemoteMediaClient.MediaChannelResult> pendingResult =
remoteMediaClient.setPlaybackRate(actualPlaybackParameters.speed, /* customData= */ null);
this.playbackParameters.pendingResultCallback =
new ResultCallback<MediaChannelResult>() {
new ResultCallback<RemoteMediaClient.MediaChannelResult>() {
@Override
public void onResult(MediaChannelResult mediaChannelResult) {
public void onResult(RemoteMediaClient.MediaChannelResult mediaChannelResult) {
if (remoteMediaClient != null) {
updatePlaybackRateAndNotifyIfChanged(this);
listeners.flushEvents();
Expand All @@ -556,12 +556,12 @@ public void setRepeatMode(@RepeatMode int repeatMode) {
// the local state will be updated to reflect the state reported by the Cast SDK.
setRepeatModeAndNotifyIfChanged(repeatMode);
listeners.flushEvents();
PendingResult<MediaChannelResult> pendingResult =
PendingResult<RemoteMediaClient.MediaChannelResult> pendingResult =
remoteMediaClient.queueSetRepeatMode(getCastRepeatMode(repeatMode), /* jsonObject= */ null);
this.repeatMode.pendingResultCallback =
new ResultCallback<MediaChannelResult>() {
new ResultCallback<RemoteMediaClient.MediaChannelResult>() {
@Override
public void onResult(MediaChannelResult mediaChannelResult) {
public void onResult(RemoteMediaClient.MediaChannelResult mediaChannelResult) {
if (remoteMediaClient != null) {
updateRepeatModeAndNotifyIfChanged(this);
listeners.flushEvents();
Expand Down Expand Up @@ -1101,7 +1101,7 @@ private void updateAvailableCommandsAndNotifyIfChanged() {
}

@Nullable
private PendingResult<MediaChannelResult> setMediaItemsInternal(
private PendingResult<RemoteMediaClient.MediaChannelResult> setMediaItemsInternal(
MediaQueueItem[] mediaQueueItems,
int startIndex,
long startPositionMs,
Expand All @@ -1127,15 +1127,15 @@ private PendingResult<MediaChannelResult> setMediaItemsInternal(
}

@Nullable
private PendingResult<MediaChannelResult> addMediaItemsInternal(MediaQueueItem[] items, int uid) {
private PendingResult<RemoteMediaClient.MediaChannelResult> addMediaItemsInternal(MediaQueueItem[] items, int uid) {
if (remoteMediaClient == null || getMediaStatus() == null) {
return null;
}
return remoteMediaClient.queueInsertItems(items, uid, /* customData= */ null);
}

@Nullable
private PendingResult<MediaChannelResult> moveMediaItemsInternal(
private PendingResult<RemoteMediaClient.MediaChannelResult> moveMediaItemsInternal(
int[] uids, int fromIndex, int newIndex) {
if (remoteMediaClient == null || getMediaStatus() == null) {
return null;
Expand All @@ -1149,7 +1149,7 @@ private PendingResult<MediaChannelResult> moveMediaItemsInternal(
}

@Nullable
private PendingResult<MediaChannelResult> removeMediaItemsInternal(int[] uids) {
private PendingResult<RemoteMediaClient.MediaChannelResult> removeMediaItemsInternal(int[] uids) {
if (remoteMediaClient == null || getMediaStatus() == null) {
return null;
}
Expand Down Expand Up @@ -1461,13 +1461,13 @@ public void onSessionResuming(CastSession castSession, String s) {
}
}

private final class SeekResultCallback implements ResultCallback<MediaChannelResult> {
private final class SeekResultCallback implements ResultCallback<RemoteMediaClient.MediaChannelResult> {

// We still call Listener#onSeekProcessed() for backwards compatibility with listeners that
// don't implement onPositionDiscontinuity().
@SuppressWarnings("deprecation")
@Override
public void onResult(MediaChannelResult result) {
public void onResult(RemoteMediaClient.MediaChannelResult result) {
int statusCode = result.getStatus().getStatusCode();
if (statusCode != CastStatusCodes.SUCCESS && statusCode != CastStatusCodes.REPLACED) {
Log.e(
Expand All @@ -1493,7 +1493,7 @@ private static final class StateHolder<T> {
* If {@link #value} is being masked, holds the result callback for the operation that triggered
* the masking. Or null if {@link #value} is not being masked.
*/
@Nullable public ResultCallback<MediaChannelResult> pendingResultCallback;
@Nullable public ResultCallback<RemoteMediaClient.MediaChannelResult> pendingResultCallback;

public StateHolder(T initialValue) {
value = initialValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
import android.util.SparseArray;
import androidx.annotation.Nullable;
import com.firework.android.exoplayer2.C;
import com.firework.android.gms.cast.MediaInfo;
import com.firework.android.gms.cast.MediaQueueItem;
import com.firework.android.gms.cast.MediaStatus;
import com.firework.android.gms.cast.framework.media.RemoteMediaClient;

import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaQueueItem;
import com.google.android.gms.cast.MediaStatus;
import com.google.android.gms.cast.framework.media.RemoteMediaClient;
import java.util.HashSet;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
import com.firework.android.exoplayer2.C;
import com.firework.android.exoplayer2.Format;
import com.firework.android.exoplayer2.util.Util;
import com.firework.android.gms.cast.CastStatusCodes;
import com.firework.android.gms.cast.MediaInfo;
import com.firework.android.gms.cast.MediaTrack;
import com.google.android.gms.cast.CastStatusCodes;
import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaTrack;


/** Utility methods for Cast integration. */
/* package */ final class CastUtils {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
package com.firework.android.exoplayer2.ext.cast;

import android.content.Context;
import com.firework.android.gms.cast.framework.CastOptions;
import com.firework.android.gms.cast.framework.OptionsProvider;
import com.firework.android.gms.cast.framework.SessionProvider;

import com.google.android.gms.cast.framework.CastOptions;
import com.google.android.gms.cast.framework.OptionsProvider;
import com.google.android.gms.cast.framework.SessionProvider;
import java.util.Collections;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
import com.firework.android.exoplayer2.C;
import com.firework.android.exoplayer2.MediaItem;
import com.firework.android.exoplayer2.util.Assertions;
import com.firework.android.gms.cast.MediaInfo;
import com.firework.android.gms.cast.MediaMetadata;
import com.firework.android.gms.cast.MediaQueueItem;

import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaMetadata;
import com.google.android.gms.cast.MediaQueueItem;
import java.util.HashMap;
import java.util.Iterator;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.firework.android.exoplayer2.ext.cast;

import com.firework.android.exoplayer2.MediaItem;
import com.firework.android.gms.cast.MediaQueueItem;
import com.google.android.gms.cast.MediaQueueItem;

/** Converts between {@link MediaItem} and the Cast SDK's {@link MediaQueueItem}. */
public interface MediaItemConverter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@
import com.firework.android.exoplayer2.Timeline;
import com.firework.android.exoplayer2.util.Assertions;
import com.firework.android.exoplayer2.util.MimeTypes;
import com.firework.android.gms.cast.MediaInfo;
import com.firework.android.gms.cast.MediaQueueItem;
import com.firework.android.gms.cast.MediaStatus;
import com.firework.android.gms.cast.framework.CastContext;
import com.firework.android.gms.cast.framework.CastSession;
import com.firework.android.gms.cast.framework.SessionManager;
import com.firework.android.gms.cast.framework.media.MediaQueue;
import com.firework.android.gms.cast.framework.media.RemoteMediaClient;
import com.firework.android.gms.common.api.PendingResult;
import com.firework.android.gms.common.api.ResultCallback;
import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaQueueItem;
import com.google.android.gms.cast.MediaStatus;
import com.google.android.gms.cast.framework.CastContext;
import com.google.android.gms.cast.framework.CastSession;
import com.google.android.gms.cast.framework.SessionManager;
import com.google.android.gms.cast.framework.media.MediaQueue;
import com.google.android.gms.cast.framework.media.RemoteMediaClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.ResultCallback;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down

0 comments on commit 6cda639

Please sign in to comment.