Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ private void checkSelectedDownload(final StoredDirectoryHelper mainStorage,
} else if (targetFile == null) {
// This part is called if:
// * the filename is not used in a pending/finished download
// * the file does not exists, create
// * the file does not exist, create

if (!mainStorage.mkdirs()) {
showFailedDialog(R.string.error_path_creation);
Expand Down
20 changes: 12 additions & 8 deletions app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ public final class Player implements PlaybackListener, Listener {
// Playback
//////////////////////////////////////////////////////////////////////////*/

// play queue might be null e.g. while player is starting
/**
* The play queue might be {@code null} e.g. while player is starting
*/
@Nullable
private PlayQueue playQueue;

Expand Down Expand Up @@ -230,8 +232,10 @@ public final class Player implements PlaybackListener, Listener {
private PlayerType playerType = PlayerType.MAIN;
private int currentState = STATE_PREFLIGHT;

// audio only mode does not mean that player type is background, but that the player was
// minimized to background but will resume automatically to the original player type
/**
* Audio-only mode does not mean that player type is background, but that the player was
* minimized to background and will change to the original player type automatically.
*/
private boolean isAudioOnly = false;
private boolean isPrepared = false;

Expand Down Expand Up @@ -934,7 +938,7 @@ public void onSuccess(@NonNull final coil3.Image result) {

private void onThumbnailLoaded(@Nullable final Bitmap bitmap) {
// Avoid useless thumbnail updates, if the thumbnail has not actually changed. Based on the
// thumbnail loading code, this if would be skipped only when both bitmaps are `null`, since
// thumbnail loading code, this would be skipped only when both bitmaps are `null`, since
// onThumbnailLoaded won't be called twice with the same nonnull bitmap by Coil's target.
if (currentThumbnail != bitmap) {
currentThumbnail = bitmap;
Expand Down Expand Up @@ -1522,7 +1526,7 @@ public void onPrepare() {
* <li>From {@link PlaybackException#ERROR_CODE_IO_INVALID_HTTP_CONTENT_TYPE BAD_IO} to
* {@link PlaybackException#ERROR_CODE_PARSING_MANIFEST_UNSUPPORTED UNSUPPORTED_FORMATS}:
* If the stream source is validated by the extractor but not recognized by the player,
* then we can try to recover playback by signalling an error on the {@link PlayQueue}.</li>
* then we can try to recover playback by signaling an error on the {@link PlayQueue}.</li>
* <li>For {@link PlaybackException#ERROR_CODE_TIMEOUT PLAYER_TIMEOUT},
* {@link PlaybackException#ERROR_CODE_IO_UNSPECIFIED MEDIA_SOURCE_RESOLVER_TIMEOUT} and
* {@link PlaybackException#ERROR_CODE_IO_NETWORK_CONNECTION_FAILED NO_NETWORK}:
Expand All @@ -1541,7 +1545,7 @@ public void onPrepare() {
*/
// Any error code not explicitly covered here are either unrelated to NewPipe use case
// (e.g. DRM) or not recoverable (e.g. Decoder error). In both cases, the player should
// shutdown.
// shut down.
@SuppressWarnings("SwitchIntDef")
@Override
public void onPlayerError(@NonNull final PlaybackException error) {
Expand Down Expand Up @@ -2241,7 +2245,7 @@ The current metadata may be null sometimes (for e.g. when using an unstable conn
reloadPlayQueueManager();
});

// Disable or enable video and subtitles renderers depending of the
// Disable or enable video and subtitles renderers depending on the
// videoAndSubtitlesEnabled value
trackSelector.setParameters(trackSelector.buildUponParameters()
.setTrackTypeDisabled(C.TRACK_TYPE_TEXT, !videoAndSubtitlesEnabled)
Expand Down Expand Up @@ -2354,7 +2358,7 @@ private boolean isLive() {
try {
return !exoPlayerIsNull() && simpleExoPlayer.isCurrentMediaItemDynamic();
} catch (final IndexOutOfBoundsException e) {
// Why would this even happen =(... but lets log it anyway, better safe than sorry
// Why would this even happen =(... but let's log it anyway, better safe than sorry
if (DEBUG) {
Log.d(TAG, "player.isCurrentWindowDynamic() failed: ", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* <p>
* If media requests are relative, the URI from which the manifest comes from (either the
* manifest URI (preferred) or the master URI (if applicable)) must be returned, otherwise the
* content will be not playable, as it will be an invalid URL, or it may be treat as something
* content will be not playable, as it will be an invalid URL, or it may be treated as something
* unexpected, for instance as a file for
* {@link com.google.android.exoplayer2.upstream.DefaultDataSource DefaultDataSource}s.
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class PopupPlayerGestureListener(

// -- Determine if the ClosingOverlayView (red X) has to be shown or hidden --
val showClosingOverlayView: Boolean = playerUi.isInsideClosingRadius(movingEvent)
// Check if an view is in expected state and if not animate it into the correct state
// Check if a view is in expected state and if not animate it into the correct state
if (binding.closingOverlay.isVisible != showClosingOverlayView) {
binding.closingOverlay.animate(showClosingOverlayView, 200)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public MediaItem getMediaItem() {
* <br><br>
* If the exception is not known, e.g. {@link java.net.UnknownHostException} or some
* other network issue, then no source info is refreshed and
* {@link #maybeThrowSourceInfoRefreshError()} be will triggered.
* {@link #maybeThrowSourceInfoRefreshError()} will be triggered.
* <br><br>
* Note that this method is called only once until {@link #releaseSourceInternal()} is called,
* so if no action is done in here, playback will stall unless
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface ManagedMediaSource extends MediaSource {
* {@link ManagedMediaSource}, then it should be replaced.
* @param isInterruptable specifies if this {@link ManagedMediaSource} potentially
* being played.
* @return whether this could be replaces
* @return whether this could be replaced
*/
boolean shouldBeReplacedWith(@NonNull PlayQueueItem newIdentity, boolean isInterruptable);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public interface PlaybackListener {
/**
* Called when the play queue can no longer be played or used.
* Currently, this means the play queue is empty and complete.
* Signals to the listener that it should shutdown.
* Signals to the listener that it should shut down.
* <p>
* May be called at any time.
* </p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

/**
* Prevent error message: 'Unrecoverable player error occurred'
* In case of rotation some users see this kind of an error which is preventable
* In case of rotation some users see this kind of error which is preventable
* having a Callback that handles the lifecycle of the surface.
* <p>
* How?: In case we are no longer able to write to the surface eg. through rotation/putting in
* background we set set a DummySurface. Although it it works on API >= 23 only.
* How?: In case we are no longer able to write to the surface e.g. through rotation/putting in
* background we set a DummySurface. Although it works on API >= 23 only.
* Result: we get a little video interruption (audio is still fine) but we won't get the
* 'Unrecoverable player error occurred' error message.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private synchronized void removeInternal(final int removeIndex) {
* to that of the target.
* If the moved item is not the currently playing and moves to an index <b>AFTER</b> the
* current playing index, then the current playing index is decremented.
* Vice versa if the an item after the currently playing is moved <b>BEFORE</b>.
* Vice versa if an item after the currently playing is moved <b>BEFORE</b>.
* </p>
*
* @param source the original index of the item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public void onBroadcastReceived(final Intent intent) {
//region Popup position and size

/**
* Check if {@link #popupLayoutParams}' position is within a arbitrary boundary
* Check if {@link #popupLayoutParams}' position is within an arbitrary boundary
* that goes from (0, 0) to (screenWidth, screenHeight).
* <p>
* If it's out of these boundaries, {@link #popupLayoutParams}' position is changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ public boolean isFullscreen() {

/**
* Update the play/pause button ({@link R.id.playPauseButton}) to reflect the action
* that will be performed when the button is clicked..
* that will be performed when the button is clicked.
* @param action the action that is performed when the play/pause button is clicked
*/
private void updatePlayPauseButton(final PlayButtonAction action) {
Expand Down
Loading