Merge pull request #4425 from vkay94/enqueue-stream

Replace specific enqueue options with one
This commit is contained in:
Stypox 2020-10-06 22:37:19 +02:00 committed by GitHub
commit 44e82217c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
61 changed files with 134 additions and 160 deletions

View file

@ -2094,6 +2094,10 @@ public class VideoPlayerImpl extends VideoPlayer
return popupLayoutParams;
}
public MainPlayer.PlayerType getPlayerType() {
return playerType;
}
public float getScreenWidth() {
return screenWidth;
}

View file

@ -6,8 +6,12 @@ import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.util.Log;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.PlaybackParameters;
import org.schabi.newpipe.App;
import org.schabi.newpipe.MainActivity;
import org.schabi.newpipe.extractor.stream.StreamInfo;
@ -31,6 +35,20 @@ public final class PlayerHolder {
private static MainPlayer playerService;
private static VideoPlayerImpl player;
/**
* Returns the current {@link MainPlayer.PlayerType} of the {@link MainPlayer} service,
* otherwise `null` if no service running.
*
* @return Current PlayerType
*/
@Nullable
public static MainPlayer.PlayerType getType() {
if (player == null) {
return null;
}
return player.getPlayerType();
}
public static void setListener(final PlayerServiceExtendedEventListener newListener) {
listener = newListener;
// Force reload data from service