Remove Google Cast feature as it depends on GMS

This commit is contained in:
Javi Rueda 2020-12-28 11:06:03 +01:00
parent 0d54d81837
commit 02bbbb49fb
15 changed files with 0 additions and 79 deletions

View file

@ -95,7 +95,6 @@ dependencies {
implementation 'com.google.android.exoplayer:exoplayer-core:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.4'
implementation 'com.google.android.exoplayer:extension-cast:2.11.4'
implementation 'com.google.android.exoplayer:extension-mediasession:2.11.4'
implementation 'com.google.android:flexbox:2.0.1'

View file

@ -22,9 +22,6 @@
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.google.android.exoplayer2.ext.cast.DefaultCastOptionsProvider"/>
<meta-data android:name="wakelock" android:value="0"/>
<activity

View file

@ -55,12 +55,10 @@ import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.ext.cast.CastPlayer;
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector;
import com.google.android.exoplayer2.ui.PlayerNotificationManager;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.cache.Cache;
import com.google.android.gms.cast.framework.CastContext;
import com.google.android.material.snackbar.Snackbar;
import androidx.annotation.NonNull;
@ -237,8 +235,6 @@ public class MainActivity extends AppCompatActivity implements SdkStatusListener
public static SimpleExoPlayer appPlayer;
public static Cache playerCache;
public static boolean playerReassigned;
public CastContext castContext;
public static CastPlayer castPlayer;
public static int nowPlayingSource;
public static Claim nowPlayingClaim;
public static String nowPlayingClaimUrl;

View file

@ -169,7 +169,6 @@ public class FileViewFragment extends BaseFragment implements
private static final String DEFAULT_PLAYBACK_SPEED = "1x";
public static final String CDN_PREFIX = "https://cdn.lbryplayer.xyz";
private PlayerControlView castControlView;
private Player currentPlayer;
private boolean loadingNewClaim;
private boolean startDownloadPending;
@ -1127,13 +1126,6 @@ public class FileViewFragment extends BaseFragment implements
}
});
root.findViewById(R.id.player_toggle_cast).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
toggleCast();
}
});
PlayerView playerView = root.findViewById(R.id.file_view_exoplayer_view);
View playbackSpeedContainer = playerView.findViewById(R.id.player_playback_speed);
TextView textPlaybackSpeed = playerView.findViewById(R.id.player_playback_speed_label);
@ -1716,16 +1708,6 @@ public class FileViewFragment extends BaseFragment implements
return;
}
// View management.
if (currentPlayer == MainActivity.appPlayer) {
//localPlayerView.setVisibility(View.VISIBLE);
castControlView.hide();
((ImageView) getView().findViewById(R.id.player_image_cast_toggle)).setImageResource(R.drawable.ic_cast);
} else /* currentPlayer == castPlayer */ {
castControlView.show();
((ImageView) getView().findViewById(R.id.player_image_cast_toggle)).setImageResource(R.drawable.ic_cast_connected);
}
// Player state management.
long playbackPositionMs = C.TIME_UNSET;
int windowIndex = C.INDEX_UNSET;
@ -2668,19 +2650,6 @@ public class FileViewFragment extends BaseFragment implements
}
}
private void toggleCast() {
if (!MainActivity.castPlayer.isCastSessionAvailable()) {
showError(getString(R.string.no_cast_session_available));
return;
}
if (currentPlayer == MainActivity.appPlayer) {
setCurrentPlayer(MainActivity.castPlayer);
} else {
setCurrentPlayer(MainActivity.appPlayer);
}
}
private void onDownloadAborted() {
downloadInProgress = false;

View file

@ -1,11 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M21,3L3,3c-1.1,0 -2,0.9 -2,2v3h2L3,5h18v14h-7v2h7c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM1,18v3h3c0,-1.66 -1.34,-3 -3,-3zM1,14v2c2.76,0 5,2.24 5,5h2c0,-3.87 -3.13,-7 -7,-7zM1,10v2c4.97,0 9,4.03 9,9h2c0,-6.08 -4.93,-11 -11,-11z"/>
</vector>

View file

@ -1,11 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#FFFFFF"
android:alpha="0.8">
<path
android:fillColor="#FF000000"
android:pathData="M1,18v3h3c0,-1.66 -1.34,-3 -3,-3zM1,14v2c2.76,0 5,2.24 5,5h2c0,-3.87 -3.13,-7 -7,-7zM19,7L5,7v1.63c3.96,1.28 7.09,4.41 8.37,8.37L19,17L19,7zM1,10v2c4.97,0 9,4.03 9,9h2c0,-6.08 -4.93,-11 -11,-11zM21,3L3,3c-1.1,0 -2,0.9 -2,2v3h2L3,5h18v14h-7v2h7c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2z"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

View file

@ -77,24 +77,6 @@
app:tint="@color/white" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/player_toggle_cast"
android:clickable="true"
android:background="?attr/selectableItemBackground"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:visibility="gone">
<ImageView
android:id="@+id/player_image_cast_toggle"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerInParent="true"
android:src="@drawable/ic_cast"
app:tint="@color/white" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/player_playback_speed"
android:background="?attr/selectableItemBackground"