Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ android {

defaultConfig {
applicationId "InfinityLoop1309.NewPipeEnhanced"
minSdk 21
// media3 1.9+ requires API 23 (media3-session). Bumped from 21 -> drops Android 5.0/5.1.
minSdk 23
//noinspection ExpiredTargetSdkVersion
targetSdk 33
versionCode 1100
Expand Down Expand Up @@ -137,7 +138,7 @@ ext {
androidxRoomVersion = '2.4.2'
androidxWorkVersion = '2.10.2'

exoPlayerVersion = '2.18.7'
media3Version = '1.10.1'
googleAutoServiceVersion = '1.0.1'
groupieVersion = '2.10.0'
markwonVersion = '4.6.2'
Expand Down Expand Up @@ -271,8 +272,14 @@ dependencies {
implementation "com.squareup.okhttp3:okhttp:3.12.13"

// Media player
implementation "com.google.android.exoplayer:exoplayer:${exoPlayerVersion}"
implementation "com.google.android.exoplayer:extension-mediasession:${exoPlayerVersion}"
implementation "androidx.media3:media3-exoplayer:${media3Version}"
implementation "androidx.media3:media3-exoplayer-dash:${media3Version}"
implementation "androidx.media3:media3-exoplayer-hls:${media3Version}"
implementation "androidx.media3:media3-exoplayer-smoothstreaming:${media3Version}"
implementation "androidx.media3:media3-datasource:${media3Version}"
implementation "androidx.media3:media3-ui:${media3Version}"
implementation "androidx.media3:media3-session:${media3Version}"
implementation "androidx.media3:media3-common:${media3Version}"

// Metadata generator for service descriptors
compileOnly "com.google.auto.service:auto-service-annotations:${googleAutoServiceVersion}"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/schabi/newpipe/error/ErrorInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.schabi.newpipe.error

import android.os.Parcelable
import androidx.annotation.StringRes
import com.google.android.exoplayer2.ExoPlaybackException
import androidx.media3.exoplayer.ExoPlaybackException
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import org.schabi.newpipe.R
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
import androidx.fragment.app.FragmentManager;
import androidx.preference.PreferenceManager;

import com.google.android.exoplayer2.PlaybackException;
import com.google.android.exoplayer2.PlaybackParameters;
import androidx.media3.common.PlaybackException;
import androidx.media3.common.PlaybackParameters;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.tabs.TabLayout;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;

import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.PlaybackException;
import androidx.media3.common.C;
import androidx.media3.exoplayer.ExoPlaybackException;
import androidx.media3.common.PlaybackException;

import org.schabi.newpipe.R;
import org.schabi.newpipe.databinding.ListRadioIconItemBinding;
Expand All @@ -29,9 +29,9 @@
import java.util.Map;
import java.util.function.Supplier;

import static com.google.android.exoplayer2.PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW;
import static com.google.android.exoplayer2.PlaybackException.ERROR_CODE_DECODING_FAILED;
import static com.google.android.exoplayer2.PlaybackException.ERROR_CODE_UNSPECIFIED;
import static androidx.media3.common.PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW;
import static androidx.media3.common.PlaybackException.ERROR_CODE_DECODING_FAILED;
import static androidx.media3.common.PlaybackException.ERROR_CODE_UNSPECIFIED;

/**
* Outsourced logic for crashing the player in the {@link VideoDetailFragment}.
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import java.util.List;

import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;
import static com.google.android.exoplayer2.Player.REPEAT_MODE_ALL;
import static com.google.android.exoplayer2.Player.REPEAT_MODE_ONE;
import static androidx.media3.common.Player.REPEAT_MODE_ALL;
import static androidx.media3.common.Player.REPEAT_MODE_ONE;
import static org.schabi.newpipe.player.PlayerService.ACTION_CLOSE;
import static org.schabi.newpipe.player.PlayerService.ACTION_FAST_FORWARD;
import static org.schabi.newpipe.player.PlayerService.ACTION_FAST_REWIND;
Expand Down Expand Up @@ -269,19 +269,19 @@ private NotificationCompat.Action getAction(

case NotificationConstants.SMART_REWIND_PREVIOUS:
if (player.getPlayQueue() != null && player.getPlayQueue().size() > 1) {
return getAction(player, R.drawable.exo_notification_previous,
return getAction(player, R.drawable.exo_icon_previous,
R.string.exo_controls_previous_description, ACTION_PLAY_PREVIOUS);
} else {
return getAction(player, R.drawable.exo_controls_rewind,
return getAction(player, R.drawable.exo_icon_rewind,
R.string.exo_controls_rewind_description, ACTION_FAST_REWIND);
}

case NotificationConstants.SMART_FORWARD_NEXT:
if (player.getPlayQueue() != null && player.getPlayQueue().size() > 1) {
return getAction(player, R.drawable.exo_notification_next,
return getAction(player, R.drawable.exo_icon_next,
R.string.exo_controls_next_description, ACTION_PLAY_NEXT);
} else {
return getAction(player, R.drawable.exo_controls_fastforward,
return getAction(player, R.drawable.exo_icon_fastforward,
R.string.exo_controls_fastforward_description, ACTION_FAST_FORWARD);
}

Expand All @@ -303,10 +303,10 @@ private NotificationCompat.Action getAction(
|| player.getCurrentState() == Player.STATE_PREFLIGHT
|| player.getCurrentState() == Player.STATE_BLOCKED
|| player.getCurrentState() == Player.STATE_BUFFERING) {
return getAction(player, R.drawable.exo_notification_pause,
return getAction(player, R.drawable.exo_icon_pause,
R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE);
} else {
return getAction(player, R.drawable.exo_notification_play,
return getAction(player, R.drawable.exo_icon_play,
R.string.exo_controls_play_description, ACTION_PLAY_PAUSE);
}

Expand All @@ -324,10 +324,10 @@ private NotificationCompat.Action getAction(

case NotificationConstants.SHUFFLE:
if (player.getPlayQueue() != null && player.getPlayQueue().isShuffled()) {
return getAction(player, R.drawable.exo_controls_shuffle_on,
return getAction(player, R.drawable.exo_icon_shuffle_on,
R.string.exo_controls_shuffle_on_description, ACTION_SHUFFLE);
} else {
return getAction(player, R.drawable.exo_controls_shuffle_off,
return getAction(player, R.drawable.exo_icon_shuffle_off,
R.string.exo_controls_shuffle_off_description, ACTION_SHUFFLE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.google.android.exoplayer2.PlaybackParameters;
import androidx.media3.common.PlaybackParameters;

import org.schabi.newpipe.R;
import org.schabi.newpipe.databinding.ActivityPlayerQueueControlBinding;
Expand Down Expand Up @@ -553,17 +553,17 @@ private void onStateChanged(final int state) {

private void onPlayModeChanged(final int repeatMode, final boolean shuffled) {
switch (repeatMode) {
case com.google.android.exoplayer2.Player.REPEAT_MODE_OFF:
case androidx.media3.common.Player.REPEAT_MODE_OFF:
queueControlBinding.controlRepeat
.setImageResource(R.drawable.exo_controls_repeat_off);
.setImageResource(R.drawable.exo_icon_repeat_off);
break;
case com.google.android.exoplayer2.Player.REPEAT_MODE_ONE:
case androidx.media3.common.Player.REPEAT_MODE_ONE:
queueControlBinding.controlRepeat
.setImageResource(R.drawable.exo_controls_repeat_one);
.setImageResource(R.drawable.exo_icon_repeat_one);
break;
case com.google.android.exoplayer2.Player.REPEAT_MODE_ALL:
case androidx.media3.common.Player.REPEAT_MODE_ALL:
queueControlBinding.controlRepeat
.setImageResource(R.drawable.exo_controls_repeat_all);
.setImageResource(R.drawable.exo_icon_repeat_all);
break;
}

Expand Down
Loading