Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videos begin in the paused state #6179

Closed
4 tasks done
dbenjaminmiller opened this issue Apr 26, 2021 · 7 comments · Fixed by #6266
Closed
4 tasks done

Videos begin in the paused state #6179

dbenjaminmiller opened this issue Apr 26, 2021 · 7 comments · Fixed by #6266
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)

Comments

@dbenjaminmiller
Copy link

Checklist

Steps to reproduce the bug

Go to play a video.

Actual behaviour

Whether autoplay is on or off, the video begins in the paused position and must be manually begun. If autoplay is on, this means one tap (so, effectively, autoplay does not work). If autoplay is off, this means two taps.

Expected behavior

Videos should begin in the playing state.

Screenshots/Screen recordings

https://streamable.com/0pvyx1 / https://streamable.com/bknr08

Device info

  • Android version: 11
  • Device model: Sony Xperia 1ii
@dbenjaminmiller dbenjaminmiller added the bug Issue is related to a bug label Apr 26, 2021
@triallax
Copy link
Contributor

Introduced in 0.21.2; see #6052 (comment).

@triallax triallax reopened this Apr 26, 2021
@triallax triallax added the player Issues related to any player (main, popup and background) label Apr 26, 2021
@Redirion
Copy link
Member

could this PR have caused the regression? #5929

@SameenAhnaf
Copy link
Collaborator

SameenAhnaf commented Apr 30, 2021

Strange enough. But if a user switches to full screen, video begins to start.

Also, main player cannot recognise if buffering icon was pressed or not. Video always stays paused at the beginning.

@opusforlife2
Copy link
Collaborator

But it a user switches to full screen, video begins to start.

Only when the full screen video is landscape. If it's a portrait video, then the video stays paused even on tapping the full screen button.

@SameenAhnaf
Copy link
Collaborator

@opusforlife2 I hardly watch portrait videos. So, I didn't notice that. Thanks for noting that.

@litetex
Copy link
Member

litetex commented May 10, 2021

Code analysis
(I didn't debug the app, just analysed the code, might be completely wrong 😉)

There might be a problem here:
https://github.com/TeamNewPipe/NewPipe/pull/5929/files#diff-68cd2f051cf461f1cee8f97ab4a793ab90276943eed26f8f1baf5105948b2b5eL709-R709

Before the PR was merged (and released with v0.21.2) when simpleExoPlayer.getPlayWhenReady() was called and it resolved to true, it would start the video by calling the play()-method.

However now playPause() is called which - when I interpret the code correctly - does exactly the opposite:
It will check if the video is playing (through the "new" method getPlayWhenReady()) and then - when this resolves to true - call stop() (and not like before start), therefore stopping the video and showing you the pause-button.


Additional information
Related method of ExoPlayer: https://exoplayer.dev/doc/reference-v1/com/google/android/exoplayer/ExoPlayer.html#getPlayWhenReady--

The problems seem to originate from that comment:
#5929 (comment)

The original implementation of the above method was done with #4562 / 2a2c82e#diff-0f3387a41d6eb8b505889ac6fe5a85f9b63f0f02d2d32aea1a6a69aa5cc7fa2aL263-R265


Effects
The code changes of #5929 also affects all players that are not a AudioPlayer or a PopupPlayer:
https://github.com/TeamNewPipe/NewPipe/pull/5929/files#diff-68cd2f051cf461f1cee8f97ab4a793ab90276943eed26f8f1baf5105948b2b5eL695-L703

So if you use one of these two, the video should start normally. (Which I could reproduce for the popup player on my smartphone)

Note: The problem only seems to appear when the option "History and cache>Resume playback" is set to off

@litetex
Copy link
Member

litetex commented May 11, 2021

I submitted a PullRequest, which should fix the problem.

In the meantime you can try enable "History and cache>Resume playback" and check if this fixes the problem :)

Redirion pushed a commit that referenced this issue May 12, 2021
* Fixed player not automatically playing

Should also fix #6179

* Added comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants