From 7f3da04fee98479f2fea17e5afebbeee73146358 Mon Sep 17 00:00:00 2001 From: Daniel M Date: Sun, 30 Oct 2022 13:48:03 +1100 Subject: [PATCH] Added an "isYouTube" check to start of long click handler --- .../java/org/schabi/newpipe/player/ui/MainPlayerUi.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java b/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java index 4f00bcf12..248104738 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java +++ b/app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java @@ -3,6 +3,7 @@ package org.schabi.newpipe.player.ui; import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import static org.schabi.newpipe.MainActivity.DEBUG; import static org.schabi.newpipe.QueueItemMenuUtil.openPopupMenu; +import static org.schabi.newpipe.extractor.ServiceList.YouTube; import static org.schabi.newpipe.ktx.ViewUtils.animate; import static org.schabi.newpipe.player.Player.STATE_COMPLETED; import static org.schabi.newpipe.player.Player.STATE_PAUSED; @@ -61,6 +62,7 @@ import org.schabi.newpipe.player.gesture.BasePlayerGestureListener; import org.schabi.newpipe.player.gesture.MainPlayerGestureListener; import org.schabi.newpipe.player.helper.PlaybackParameterDialog; import org.schabi.newpipe.player.helper.PlayerHelper; +import org.schabi.newpipe.player.mediaitem.MediaItemTag; import org.schabi.newpipe.player.playqueue.PlayQueue; import org.schabi.newpipe.player.playqueue.PlayQueueAdapter; import org.schabi.newpipe.player.playqueue.PlayQueueItem; @@ -708,6 +710,12 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh @Override public void onItemLongClick(@NonNull final StreamSegmentItem item, final int seconds) { + @Nullable final MediaItemTag currentMetadata = player.getCurrentMetadata(); + if (currentMetadata == null + || currentMetadata.getServiceId() != YouTube.getServiceId()) { + return; + } + final PlayQueueItem currentItem = player.getCurrentItem(); if (currentItem != null) { String videoUrl = player.getVideoUrl();