NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

App can't continue YouTube video that was paused some hours ago

Open JCU0 opened this issue 4 years ago • 20 comments

Checklist

  • [x] I am using the latest version - 0.20.10
  • [x] I checked, but didn't find any duplicates (open OR closed) of this issue in the repo.
  • [x] I have read the contribution guidelines given at https://github.com/TeamNewPipe/NewPipe/blob/HEAD/.github/CONTRIBUTING.md.
  • [x] This issue contains only one bug. I will open one issue for every bug report I want to file.

Steps to reproduce the bug

  1. Start a video to play
  2. Pause a video.
  3. Lock your device.
  4. Sleep and relax for some hours
  5. Unlock your device
  6. Try to resume a video (problem is here)
  7. Try to play another video (no problem)
  8. Try to go back to previously paused video via History, Playlists tab, etc (problem is here again)

Actual behaviour

A video is starting to play for up to a minute (pre-loaded part), then it is freezing in an infinite load loop. When you try to switch to another video and return to that one, it's still not playable. You need to force close and reload the app to be able to continue with that video.

Expected behavior

A video should continue to play smoothly until end.

JCU0 avatar Mar 02 '21 13:03 JCU0

This behavior happens even if paused in background mode. However this is not a new problem and has been observed in several last releases. Sometimes if there is enough of data queued up it could play for couple of seconds even a minute after this long pause , but as soon as it should fetch new data the play stops and stays like that forever.

It appears as if there was some kind of timer that overflows in this long pause and then it cannot start where it left off. Or the timestamp of the last queued data does not match current time thus unable to fetch new data from the source.

One workaround found is to stop the app, clear the storage cache in app settings, restart the app and via history restart the playback. However there is one big drawback to this action. It seems that the comments disappear completely after clearing the cache for all videos played afterwards. They sometimes resurface again after couple of day, but have not figured out what triggers this condition. But this is probably another bug issue that needs to be reported separately.

jonnyb49 avatar Mar 03 '21 07:03 jonnyb49

You can also just change the video quality to fix there current instance of the problem

XiangRongLin avatar Mar 05 '21 20:03 XiangRongLin

You can also just change the video quality to fix there current instance of the problem

And how to fix in background mode without having to force close the app and lose your current queue?

absurdlylongusername avatar Mar 05 '21 21:03 absurdlylongusername

I am still having this issue in 21.1. Now it won't even play buffered video and it seems newpipe thinks the video has ended since the icon changes to the "replay" arrow rather than the play triangle. Resuming is not possible and requires restarting the video. This also occurs very quickly. After pausing and locking the device it only needs to be locked for a few minutes before the video is unable to be resumed.

FlareHeart avatar Apr 10 '21 16:04 FlareHeart

I've been experiencing a similar issue for some releases (I can't tell for sure what ones). This may be related, so I'm reporting it here. Currently I am using version 0.21.13. Almost every time, when I pause a video, even for just a second, it displays the play triangle and I cannot resume it. Closing the video and reopening it fixes the issue (no need to restart the app), but it often happens that it is restarted from the beginning, instead of the last position (although the red indicator in the thumbnail showed it correctly until it was restarted). I can also confirm that this also happens in background mode. I could not find any indication on the conditions under which this issue presents, it seems random to me.

Ojd2000 avatar Nov 06 '21 18:11 Ojd2000

Here are some logs for this issue. I started this video yesterday, paused it, set the phone under Airplane mode for the night, and the next day exited Airplane mode and tried continue watching the same video which triggered a An error occurred, see notification toast where I could get the following logs

Exception

  • User Action: play stream
  • Request: Player error[type=0] occurred while playing https://www.youtube.com/watch?v=Wp0sXD3vy1E
  • Content Country: US
  • Content Language: en
  • App Language: en_CA
  • Service: YouTube
  • Version: 0.22.1
  • OS: Linux Android 7.1.2 - 25
Crash log

com.google.android.exoplayer2.ExoPlaybackException: Source error
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:580)
	at android.os.Handler.dispatchMessage(Handler.java:98)
	at android.os.Looper.loop(Looper.java:154)
	at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: com.google.android.exoplayer2.ParserException: Invalid NAL length
	at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.readSample(Mp4Extractor.java:605)
	at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:249)
	at com.google.android.exoplayer2.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:127)
	at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1049)
	at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:417)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
	at java.lang.Thread.run(Thread.java:761)


Lomanic avatar Feb 27 '22 14:02 Lomanic

I too have this problem. I am now running 22.1,with previous releases changing the video resolution would allow the video to continue playing now with 22.1 this workaround does not help un the worst case I have had ( https://www.youtube.com/watch?v=rEOQMlICtpU ) I am not sure what sort of video stream is involved but for this case even clearing cache or restarting android did not make a difference. Eventually I managed to get out of it by playing another video some made a difference others did not. The "history" technique in the post above also seemed to work

wombatch avatar Mar 26 '22 03:03 wombatch

I run into this issue very often (see #8455 and the screen recording). Changing resolutions only sometimes helps solve the issue and once you close the video there's a NewPipe crash each time you try to start the video. Clearing the cache is the only workable solution at the moment.

I don't know how NewPipe works internally but it seems like NewPipe doesn't seem to do a "from scratch" refresh of a video when it hits an error like this, and it seems like doing a complete refresh and re-fetch of the video if this error is hit for the first time would solve these issues?

cyphar avatar May 29 '22 03:05 cyphar

Another workaround is to switch to the next video, wait for the next video to play, and then switch back to the original one. By doing this, no cache cleaning is required nor progress is lost, and it can play the next video normally

timsu92 avatar Jun 05 '22 16:06 timsu92

@TobiGr Since you were called head developer on this project many months ago, maybe we should try fixing this high priority issue that makes listening to music and viewing a video unpleasant and annoying for many people. Since the video won't reinitiate the connection again

onkq avatar Jun 07 '22 10:06 onkq

@onkq Don't ping specific team members unless you're already in a discussion about some feature or bug.

opusforlife2 avatar Jun 11 '22 18:06 opusforlife2

I am having this problem with Newpipe 0.23.0 on a Samsung Galaxy Note S10+, Android 12 and have had it in the past on other devices. Unfortunately now, none of the following work although they have in the past when the problem happened. It was trial and error among these options but one of them would eventually work.

  • Changing video resolution
  • Deleting video from watch history/reloading
  • Wipe cached metadata
  • Clear watch history
  • Delete playback positions
  • Try other app features including other videos and coming back
  • Force stop Newpipe/restart
  • Airplane mode on/off to force reconnection to the network
  • Reboot phone

I can download and watch the video in an external player but am hoping there's another way to work it in the app.

OldGuyInTheClub avatar Jul 05 '22 02:07 OldGuyInTheClub

Different logs for this issue, this is reproduceable.

Shortly after unlocking the phone from a multiple hour sleep.

Exception

  • User Action: play stream
  • Request: Player error[type=ERROR_CODE_IO_BAD_HTTP_STATUS] occurred while playing https://www.youtube.com/watch?v=JGRMd4vCeI0
  • Content Country: HU
  • Content Language: hu-HU
  • App Language: hu_HU
  • Service: YouTube
  • Version: 0.24.0
  • OS: Linux Android 8.1.0 - 27
Crash log

com.google.android.exoplayer2.ExoPlaybackException: Source error
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:632)
	at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:604)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:172)
	at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 403
	at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(YoutubeHttpDataSource.java:422)
	at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:258)
	at com.google.android.exoplayer2.upstream.TeeDataSource.open(TeeDataSource.java:52)
	at com.google.android.exoplayer2.upstream.cache.CacheDataSource.openNextSource(CacheDataSource.java:786)
	at com.google.android.exoplayer2.upstream.cache.CacheDataSource.open(CacheDataSource.java:599)
	at com.google.android.exoplayer2.upstream.StatsDataSource.open(StatsDataSource.java:84)
	at com.google.android.exoplayer2.source.chunk.ContainerMediaChunk.load(ContainerMediaChunk.java:124)
	at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:412)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
	at java.lang.Thread.run(Thread.java:764)


TypicalScenario avatar Oct 08 '22 09:10 TypicalScenario

0.27.6 on Samsung A70, Android 11 still affected by this issue.

nakic avatar Feb 08 '25 17:02 nakic

I still get this issue all the time on 0.28.0 -- crazy it isn't addressed by now. Even a 5-minute pause can be enough to then make a video unable to resume, and start from the beginning.

I don't even bother trying now: I swipe the app closed, go back in, tap History, tap the topmost video there (which will be the one I was last watching) and then it always resumes where I last was.

Surprised around four-and-a-half years after this ticket was first raised, this is still an issue?

dftf-stu avatar Sep 24 '25 19:09 dftf-stu

@dftf-stu, you can use a simpler workaround until it's resolved: press play, then when it starts, press skip to next video, when it starts press play previous video. It's better in that it preserves the playlist.

nakic avatar Sep 24 '25 19:09 nakic

@nakic: I rarely use playlists, I go to the "Subscriptions" page, then "All" and tap on a video, watch it, then tap back, close it and choose another video. So for me, there is no "Next" video lined-up.

But worth knowing for rare times I ever am watching something from "Watch Later" or using the "Play next" queue, thanks,

(I've read in other tickets about this issue apparently changing the video quality before tapping play to resume also works?)

dftf-stu avatar Sep 24 '25 20:09 dftf-stu

Never experienced it in native android app. But experience it in waydroid. But I don't need to pause it at all though it mostly occurs after pause (without waiting for a long time)

dustdfg avatar Nov 30 '25 18:11 dustdfg

how is this still a bug over 5 years later??? when are the devs going to address this issue

tyronetheqt avatar Dec 06 '25 13:12 tyronetheqt

how is this still a bug over 5 years later??? when are the devs going to address this issue

  1. They are making rewrite of the app
  2. Only rewrite is actively developed and main branch in the maintenance mode
  3. They've actually probably solved it in the new player (not incorporated in the main app currently)

So as a summary they are doing a good job. Be a bit more patient and maybe beta test rewrite nightly builds...

dustdfg avatar Dec 06 '25 14:12 dustdfg