diff --git a/README.md b/README.md
index 6a563dfd8..15ba3d04b 100644
--- a/README.md
+++ b/README.md
@@ -20,15 +20,15 @@
## Screenshots
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_1.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_2.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_3.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_4.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_5.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_6.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_7.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_8.png)
-[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_9.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_01.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_02.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_03.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_04.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_05.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_06.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_07.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_08.png)
+[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_09.png)
[](fastlane/metadata/android/en-US/images/phoneScreenshots/shot_10.png)
[](fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_11.png)
[](fastlane/metadata/android/en-US/images/tenInchScreenshots/shot_12.png)
diff --git a/app/build.gradle b/app/build.gradle
index b507fd860..b385015f7 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,7 +6,7 @@ android {
defaultConfig {
applicationId "org.schabi.newpipe"
- minSdkVersion 15
+ minSdkVersion 19
targetSdkVersion 28
versionCode 69
versionName "0.14.2"
diff --git a/app/src/main/java/org/schabi/newpipe/RouterActivity.java b/app/src/main/java/org/schabi/newpipe/RouterActivity.java
index e22e2f474..b8941670f 100644
--- a/app/src/main/java/org/schabi/newpipe/RouterActivity.java
+++ b/app/src/main/java/org/schabi/newpipe/RouterActivity.java
@@ -542,8 +542,7 @@ public class RouterActivity extends AppCompatActivity {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
boolean isExtVideoEnabled = preferences.getBoolean(getString(R.string.use_external_video_player_key), false);
- boolean isExtAudioEnabled = preferences.getBoolean(getString(R.string.use_external_audio_player_key), false);
- boolean useOldVideoPlayer = PlayerHelper.isUsingOldPlayer(this);
+ boolean isExtAudioEnabled = preferences.getBoolean(getString(R.string.use_external_audio_player_key), false);;
PlayQueue playQueue;
String playerChoice = choice.playerChoice;
@@ -555,9 +554,6 @@ public class RouterActivity extends AppCompatActivity {
} else if (playerChoice.equals(videoPlayerKey) && isExtVideoEnabled) {
NavigationHelper.playOnExternalVideoPlayer(this, (StreamInfo) info);
- } else if (playerChoice.equals(videoPlayerKey) && useOldVideoPlayer) {
- NavigationHelper.playOnOldVideoPlayer(this, (StreamInfo) info);
-
} else {
playQueue = new SinglePlayQueue((StreamInfo) info);
diff --git a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
index 9ab40e81c..f5675dcb2 100644
--- a/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
+++ b/app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
@@ -73,7 +73,6 @@ import org.schabi.newpipe.local.history.HistoryRecordManager;
import org.schabi.newpipe.player.MainVideoPlayer;
import org.schabi.newpipe.player.PopupVideoPlayer;
import org.schabi.newpipe.player.helper.PlayerHelper;
-import org.schabi.newpipe.player.old.PlayVideoActivity;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
import org.schabi.newpipe.report.ErrorActivity;
@@ -921,7 +920,7 @@ public class VideoDetailFragment
.getBoolean(this.getString(R.string.use_external_video_player_key), false)) {
startOnExternalPlayer(activity, currentInfo, selectedVideoStream);
} else {
- openNormalPlayer(selectedVideoStream);
+ openNormalPlayer();
}
}
@@ -934,24 +933,13 @@ public class VideoDetailFragment
}
}
- private void openNormalPlayer(VideoStream selectedVideoStream) {
+ private void openNormalPlayer() {
Intent mIntent;
- boolean useOldPlayer = PlayerHelper.isUsingOldPlayer(activity) || (Build.VERSION.SDK_INT < 16);
- if (!useOldPlayer) {
- // ExoPlayer
- final PlayQueue playQueue = new SinglePlayQueue(currentInfo);
- mIntent = NavigationHelper.getPlayerIntent(activity,
- MainVideoPlayer.class,
- playQueue,
- getSelectedVideoStream().getResolution());
- } else {
- // Internal Player
- mIntent = new Intent(activity, PlayVideoActivity.class)
- .putExtra(PlayVideoActivity.VIDEO_TITLE, currentInfo.getName())
- .putExtra(PlayVideoActivity.STREAM_URL, selectedVideoStream.getUrl())
- .putExtra(PlayVideoActivity.VIDEO_URL, currentInfo.getUrl())
- .putExtra(PlayVideoActivity.START_POSITION, currentInfo.getStartPosition());
- }
+ final PlayQueue playQueue = new SinglePlayQueue(currentInfo);
+ mIntent = NavigationHelper.getPlayerIntent(activity,
+ MainVideoPlayer.class,
+ playQueue,
+ getSelectedVideoStream().getResolution());
startActivity(mIntent);
}
diff --git a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java
index b71976eda..d1b06c9c5 100644
--- a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java
@@ -98,35 +98,54 @@ public abstract class BasePlayer implements
Player.EventListener, PlaybackListener, ImageLoadingListener {
public static final boolean DEBUG = !BuildConfig.BUILD_TYPE.equals("release");
- @NonNull public static final String TAG = "BasePlayer";
+ @NonNull
+ public static final String TAG = "BasePlayer";
- @NonNull final protected Context context;
+ @NonNull
+ final protected Context context;
- @NonNull final protected BroadcastReceiver broadcastReceiver;
- @NonNull final protected IntentFilter intentFilter;
+ @NonNull
+ final protected BroadcastReceiver broadcastReceiver;
+ @NonNull
+ final protected IntentFilter intentFilter;
- @NonNull final protected HistoryRecordManager recordManager;
+ @NonNull
+ final protected HistoryRecordManager recordManager;
- @NonNull final protected CustomTrackSelector trackSelector;
- @NonNull final protected PlayerDataSource dataSource;
+ @NonNull
+ final protected CustomTrackSelector trackSelector;
+ @NonNull
+ final protected PlayerDataSource dataSource;
- @NonNull final private LoadControl loadControl;
- @NonNull final private RenderersFactory renderFactory;
+ @NonNull
+ final private LoadControl loadControl;
+ @NonNull
+ final private RenderersFactory renderFactory;
- @NonNull final private SerialDisposable progressUpdateReactor;
- @NonNull final private CompositeDisposable databaseUpdateReactor;
+ @NonNull
+ final private SerialDisposable progressUpdateReactor;
+ @NonNull
+ final private CompositeDisposable databaseUpdateReactor;
/*//////////////////////////////////////////////////////////////////////////
// Intent
//////////////////////////////////////////////////////////////////////////*/
- @NonNull public static final String REPEAT_MODE = "repeat_mode";
- @NonNull public static final String PLAYBACK_PITCH = "playback_pitch";
- @NonNull public static final String PLAYBACK_SPEED = "playback_speed";
- @NonNull public static final String PLAYBACK_SKIP_SILENCE = "playback_skip_silence";
- @NonNull public static final String PLAYBACK_QUALITY = "playback_quality";
- @NonNull public static final String PLAY_QUEUE_KEY = "play_queue_key";
- @NonNull public static final String APPEND_ONLY = "append_only";
- @NonNull public static final String SELECT_ON_APPEND = "select_on_append";
+ @NonNull
+ public static final String REPEAT_MODE = "repeat_mode";
+ @NonNull
+ public static final String PLAYBACK_PITCH = "playback_pitch";
+ @NonNull
+ public static final String PLAYBACK_SPEED = "playback_speed";
+ @NonNull
+ public static final String PLAYBACK_SKIP_SILENCE = "playback_skip_silence";
+ @NonNull
+ public static final String PLAYBACK_QUALITY = "playback_quality";
+ @NonNull
+ public static final String PLAY_QUEUE_KEY = "play_queue_key";
+ @NonNull
+ public static final String APPEND_ONLY = "append_only";
+ @NonNull
+ public static final String SELECT_ON_APPEND = "select_on_append";
/*//////////////////////////////////////////////////////////////////////////
// Playback
@@ -137,13 +156,18 @@ public abstract class BasePlayer implements
protected PlayQueue playQueue;
protected PlayQueueAdapter playQueueAdapter;
- @Nullable protected MediaSourceManager playbackManager;
+ @Nullable
+ protected MediaSourceManager playbackManager;
- @Nullable private PlayQueueItem currentItem;
- @Nullable private MediaSourceTag currentMetadata;
- @Nullable private Bitmap currentThumbnail;
+ @Nullable
+ private PlayQueueItem currentItem;
+ @Nullable
+ private MediaSourceTag currentMetadata;
+ @Nullable
+ private Bitmap currentThumbnail;
- @Nullable protected Toast errorToast;
+ @Nullable
+ protected Toast errorToast;
/*//////////////////////////////////////////////////////////////////////////
// Player
@@ -213,7 +237,8 @@ public abstract class BasePlayer implements
registerBroadcastReceiver();
}
- public void initListeners() {}
+ public void initListeners() {
+ }
public void handleIntent(Intent intent) {
if (DEBUG) Log.d(TAG, "handleIntent() called with: intent = [" + intent + "]");
@@ -297,7 +322,6 @@ public abstract class BasePlayer implements
databaseUpdateReactor.clear();
progressUpdateReactor.set(null);
- simpleExoPlayer = null;
}
/*//////////////////////////////////////////////////////////////////////////
@@ -425,13 +449,15 @@ public abstract class BasePlayer implements
if (!isProgressLoopRunning()) startProgressLoop();
}
- public void onBuffering() {}
+ public void onBuffering() {
+ }
public void onPaused() {
if (isProgressLoopRunning()) stopProgressLoop();
}
- public void onPausedSeek() {}
+ public void onPausedSeek() {
+ }
public void onCompleted() {
if (DEBUG) Log.d(TAG, "onCompleted() called");
@@ -602,19 +628,19 @@ public abstract class BasePlayer implements
/**
* Processes the exceptions produced by {@link com.google.android.exoplayer2.ExoPlayer ExoPlayer}.
* There are multiple types of errors:
- *
+ *
* {@link ExoPlaybackException#TYPE_SOURCE TYPE_SOURCE}:
- *
+ *
* {@link ExoPlaybackException#TYPE_UNEXPECTED TYPE_UNEXPECTED}:
* If a runtime error occurred, then we can try to recover it by restarting the playback
* after setting the timestamp recovery.
- *
+ *
* {@link ExoPlaybackException#TYPE_RENDERER TYPE_RENDERER}:
* If the renderer failed, treat the error as unrecoverable.
*
* @see #processSourceError(IOException)
* @see Player.EventListener#onPlayerError(ExoPlaybackException)
- * */
+ */
@Override
public void onPlayerError(ExoPlaybackException error) {
if (DEBUG) Log.d(TAG, "ExoPlayer - onPlayerError() called with: " +
@@ -900,8 +926,8 @@ public abstract class BasePlayer implements
if (DEBUG) Log.d(TAG, "onPlayPrevious() called");
/* If current playback has run for PLAY_PREV_ACTIVATION_LIMIT_MILLIS milliseconds,
- * restart current track. Also restart the track if the current track
- * is the first in a queue.*/
+ * restart current track. Also restart the track if the current track
+ * is the first in a queue.*/
if (simpleExoPlayer.getCurrentPosition() > PLAY_PREV_ACTIVATION_LIMIT_MILLIS ||
playQueue.getIndex() == 0) {
seekToDefault();
@@ -1010,8 +1036,8 @@ public abstract class BasePlayer implements
try {
metadata = (MediaSourceTag) simpleExoPlayer.getCurrentTag();
} catch (IndexOutOfBoundsException | ClassCastException error) {
- if(DEBUG) Log.d(TAG, "Could not update metadata: " + error.getMessage());
- if(DEBUG) error.printStackTrace();
+ if (DEBUG) Log.d(TAG, "Could not update metadata: " + error.getMessage());
+ if (DEBUG) error.printStackTrace();
return;
}
@@ -1075,7 +1101,9 @@ public abstract class BasePlayer implements
currentThumbnail;
}
- /** Checks if the current playback is a livestream AND is playing at or beyond the live edge */
+ /**
+ * Checks if the current playback is a livestream AND is playing at or beyond the live edge
+ */
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
public boolean isLiveEdge() {
if (simpleExoPlayer == null || !isLive()) return false;
@@ -1099,8 +1127,8 @@ public abstract class BasePlayer implements
} catch (@NonNull IndexOutOfBoundsException ignored) {
// Why would this even happen =(
// But lets log it anyway. Save is save
- if(DEBUG) Log.d(TAG, "Could not update metadata: " + ignored.getMessage());
- if(DEBUG) ignored.printStackTrace();
+ if (DEBUG) Log.d(TAG, "Could not update metadata: " + ignored.getMessage());
+ if (DEBUG) ignored.printStackTrace();
return false;
}
}
diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
index a36a0576c..f5c731ed9 100644
--- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
@@ -68,7 +68,6 @@ import org.schabi.newpipe.extractor.stream.VideoStream;
import org.schabi.newpipe.player.event.PlayerEventListener;
import org.schabi.newpipe.player.helper.LockManager;
import org.schabi.newpipe.player.helper.PlayerHelper;
-import org.schabi.newpipe.player.old.PlayVideoActivity;
import org.schabi.newpipe.player.resolver.MediaSourceTag;
import org.schabi.newpipe.player.resolver.VideoPlaybackResolver;
import org.schabi.newpipe.util.ListHelper;
@@ -80,7 +79,6 @@ import java.util.List;
import static org.schabi.newpipe.player.BasePlayer.STATE_PLAYING;
import static org.schabi.newpipe.player.VideoPlayer.DEFAULT_CONTROLS_DURATION;
import static org.schabi.newpipe.player.VideoPlayer.DEFAULT_CONTROLS_HIDE_TIME;
-import static org.schabi.newpipe.player.helper.PlayerHelper.isUsingOldPlayer;
import static org.schabi.newpipe.util.AnimationUtils.animateView;
/**
@@ -554,27 +552,17 @@ public final class PopupVideoPlayer extends Service {
if (DEBUG) Log.d(TAG, "onFullScreenButtonClicked() called");
setRecovery();
- Intent intent;
- if (!isUsingOldPlayer(getApplicationContext())) {
- intent = NavigationHelper.getPlayerIntent(
- context,
- MainVideoPlayer.class,
- this.getPlayQueue(),
- this.getRepeatMode(),
- this.getPlaybackSpeed(),
- this.getPlaybackPitch(),
- this.getPlaybackSkipSilence(),
- this.getPlaybackQuality()
- );
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- } else {
- intent = new Intent(PopupVideoPlayer.this, PlayVideoActivity.class)
- .putExtra(PlayVideoActivity.VIDEO_TITLE, getVideoTitle())
- .putExtra(PlayVideoActivity.STREAM_URL, getSelectedVideoStream().getUrl())
- .putExtra(PlayVideoActivity.VIDEO_URL, getVideoUrl())
- .putExtra(PlayVideoActivity.START_POSITION, Math.round(getPlayer().getCurrentPosition() / 1000f));
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- }
+ final Intent intent = NavigationHelper.getPlayerIntent(
+ context,
+ MainVideoPlayer.class,
+ this.getPlayQueue(),
+ this.getRepeatMode(),
+ this.getPlaybackSpeed(),
+ this.getPlaybackPitch(),
+ this.getPlaybackSkipSilence(),
+ this.getPlaybackQuality()
+ );
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
closePopup();
}
diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
index 16dffc3de..ac57666cc 100644
--- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
@@ -177,10 +177,6 @@ public class PlayerHelper {
return isBrightnessGestureEnabled(context, true);
}
- public static boolean isUsingOldPlayer(@NonNull final Context context) {
- return isUsingOldPlayer(context, false);
- }
-
public static boolean isRememberingPopupDimensions(@NonNull final Context context) {
return isRememberingPopupDimensions(context, true);
}
@@ -318,10 +314,6 @@ public class PlayerHelper {
return getPreferences(context).getBoolean(context.getString(R.string.brightness_gesture_control_key), b);
}
- private static boolean isUsingOldPlayer(@NonNull final Context context, final boolean b) {
- return getPreferences(context).getBoolean(context.getString(R.string.use_old_player_key), b);
- }
-
private static boolean isRememberingPopupDimensions(@NonNull final Context context, final boolean b) {
return getPreferences(context).getBoolean(context.getString(R.string.popup_remember_size_pos_key), b);
}
diff --git a/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java b/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java
deleted file mode 100644
index 092f82aad..000000000
--- a/app/src/main/java/org/schabi/newpipe/player/old/PlayVideoActivity.java
+++ /dev/null
@@ -1,369 +0,0 @@
-package org.schabi.newpipe.player.old;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.ActivityInfo;
-import android.content.res.Configuration;
-import android.media.AudioManager;
-import android.media.MediaPlayer;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatActivity;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.view.Display;
-import android.view.KeyEvent;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.WindowManager;
-import android.widget.Button;
-import android.widget.MediaController;
-import android.widget.ProgressBar;
-import android.widget.VideoView;
-
-import org.schabi.newpipe.R;
-
-/*
- * Copyright (C) Christian Schabesberger 2015