Skip to content

Commit 7f3da04

Browse files
committed
Added an "isYouTube" check to start of long click handler
1 parent 83357ca commit 7f3da04

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/ui/MainPlayerUi.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
44
import static org.schabi.newpipe.MainActivity.DEBUG;
55
import static org.schabi.newpipe.QueueItemMenuUtil.openPopupMenu;
6+
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
67
import static org.schabi.newpipe.ktx.ViewUtils.animate;
78
import static org.schabi.newpipe.player.Player.STATE_COMPLETED;
89
import static org.schabi.newpipe.player.Player.STATE_PAUSED;
@@ -61,6 +62,7 @@
6162
import org.schabi.newpipe.player.gesture.MainPlayerGestureListener;
6263
import org.schabi.newpipe.player.helper.PlaybackParameterDialog;
6364
import org.schabi.newpipe.player.helper.PlayerHelper;
65+
import org.schabi.newpipe.player.mediaitem.MediaItemTag;
6466
import org.schabi.newpipe.player.playqueue.PlayQueue;
6567
import org.schabi.newpipe.player.playqueue.PlayQueueAdapter;
6668
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
@@ -708,6 +710,12 @@ public void onItemClick(@NonNull final StreamSegmentItem item, final int seconds
708710

709711
@Override
710712
public void onItemLongClick(@NonNull final StreamSegmentItem item, final int seconds) {
713+
@Nullable final MediaItemTag currentMetadata = player.getCurrentMetadata();
714+
if (currentMetadata == null
715+
|| currentMetadata.getServiceId() != YouTube.getServiceId()) {
716+
return;
717+
}
718+
711719
final PlayQueueItem currentItem = player.getCurrentItem();
712720
if (currentItem != null) {
713721
String videoUrl = player.getVideoUrl();

0 commit comments

Comments
 (0)