mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-01-23 15:36:57 +00:00
Added an "isYouTube" check to start of long click handler
This commit is contained in:
parent
83357ca67e
commit
7f3da04fee
@ -3,6 +3,7 @@ package org.schabi.newpipe.player.ui;
|
|||||||
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||||
import static org.schabi.newpipe.MainActivity.DEBUG;
|
import static org.schabi.newpipe.MainActivity.DEBUG;
|
||||||
import static org.schabi.newpipe.QueueItemMenuUtil.openPopupMenu;
|
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.ktx.ViewUtils.animate;
|
||||||
import static org.schabi.newpipe.player.Player.STATE_COMPLETED;
|
import static org.schabi.newpipe.player.Player.STATE_COMPLETED;
|
||||||
import static org.schabi.newpipe.player.Player.STATE_PAUSED;
|
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.gesture.MainPlayerGestureListener;
|
||||||
import org.schabi.newpipe.player.helper.PlaybackParameterDialog;
|
import org.schabi.newpipe.player.helper.PlaybackParameterDialog;
|
||||||
import org.schabi.newpipe.player.helper.PlayerHelper;
|
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.PlayQueue;
|
||||||
import org.schabi.newpipe.player.playqueue.PlayQueueAdapter;
|
import org.schabi.newpipe.player.playqueue.PlayQueueAdapter;
|
||||||
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
|
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
|
||||||
@ -708,6 +710,12 @@ public final class MainPlayerUi extends VideoPlayerUi implements View.OnLayoutCh
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemLongClick(@NonNull final StreamSegmentItem item, final int seconds) {
|
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();
|
final PlayQueueItem currentItem = player.getCurrentItem();
|
||||||
if (currentItem != null) {
|
if (currentItem != null) {
|
||||||
String videoUrl = player.getVideoUrl();
|
String videoUrl = player.getVideoUrl();
|
||||||
|
Loading…
Reference in New Issue
Block a user