Remove "Detail Page" open action from share dialog under certain circumstances
With the new application workflow and unified player, video detail page and video player are the same activity. So show only one of these options based on whether autoplay is enabled or not, and show both if using external player
This commit is contained in:
parent
ad3364671d
commit
0e5f85db95
4 changed files with 75 additions and 35 deletions
|
|
@ -28,6 +28,7 @@ import org.schabi.newpipe.extractor.stream.VideoStream;
|
|||
import org.schabi.newpipe.player.playqueue.PlayQueue;
|
||||
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
|
||||
import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
|
||||
import org.schabi.newpipe.util.ListHelper;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.text.DecimalFormat;
|
||||
|
|
@ -248,6 +249,18 @@ public final class PlayerHelper {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isAutoplayAllowedByUser(@NonNull final Context context) {
|
||||
switch (PlayerHelper.getAutoplayType(context)) {
|
||||
case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_NEVER:
|
||||
return false;
|
||||
case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_WIFI:
|
||||
return !ListHelper.isMeteredNetwork(context);
|
||||
case PlayerHelper.AutoplayType.AUTOPLAY_TYPE_ALWAYS:
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static SeekParameters getSeekParameters(@NonNull final Context context) {
|
||||
return isUsingInexactSeek(context) ? SeekParameters.CLOSEST_SYNC : SeekParameters.EXACT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue