I've previously hinted about this while testing 0.14.0rc3 before we occur recent NPE bug, cause Google ruined us!
Certain stream no longer have "Background" playback support and button, as I expected, background play seems like it's available for all streams (as it's not private or premium videos/sounds).
Even you can queue from search result, channel's list, share to, etc. it cannot be played and then throw the Failed to play this stream error message popup.
Also worst case happen while play multiple queue or from saved playlists, if next stream cannot preload, the current stream will be skip early and jump to next stream that still can play on background.
Brand: HTC
Model: one E9+ Dual Sim
Product Code: a55ml_dtul
Android version: 5.0.2 (Lollipop)
Trending content country: en-GB
Video Format: WebM
Audio Format: M4A
Main resolution: 720p60
Popup Resolution: 360p
Limit mobile data resolution: 240p
Disable gesture control
Disable remember popup size
Disable hold to append tip
Disable watched history
Disable search history
I have a custom playlist that have 6 videos in the list, but it's only play first 3 videos, rest of them was skipped and removed due to cannot retrieve background audio.
Note these videos below is Thai videos, you may need connect to Thai proxy/VPN before reproduce.
Some streams dont have playable audio only, however i fixed something where i broke the ability to play those streams in background. You are right we/I should fix this.
Having this issue with this video if you need more example cases: https://www.youtube.com/watch?v=UK3GNYuAcf0
Hello
I've got same issue with the app while listening to this video
https://m.youtube.com/watch?v=N-NIyjsSAzY
Can confirm this issue too on v14.1.
Seeing this too, it seems this happens often on music-related videos with few movement (think VGM), as I suppose YouTube bundles the video together as it won't cost too much extra. Using popup for now, but would be nice to see this fixed!
Furthermore, this issue also shows at the download popup - no audio download is present anymore.
@kowith337v0.14.1 shows the play in background feature for all the streams that you listed for me.
@theScrabi Sorry, but I've tried both videos from @no-boot-device and @Zedreeks, I still cannot play on background, is it possible because of ads insertion that preventing background playback to be happen for me or specific country?
The country might most certainly be the issue I guess.
I did sent log that captured from "Take bug report" shortcut to the E-mail address that found from contributing note, hope it can help to investigate.
@theScrabi I tried the links that said worked for you and they also do not show background playback for me. If I put any video without that option into a background playlist, the video gets skipped with a toast message saying "Unable to play this stream". Long pressing the video and tapping "Play background from here" gives a toast message that says "Recovering from player error". I also have some music related videos that before this version had the option available, and after this update now do not have option anymore. I think maybe this is not related to the country.
I agree what @kaikun97 said, I've tested 0.14.0rc2~rc3 before Google mess the player code/API and found previous versions (<=0.13.7) still have functions to play them, so I reverted to 0.13.5 because to avoiding cyclic results, after few days later Google messed player code again and then...
I'm facing this issue too.
It's probably because YouTube does not generate separate audio streams for videos with low view count (AFAIK separate audio streams get generated once the view count reaches ~4,000 views), so there is no play in background option available for such videos.
I don't think about it's depend on view count, subscriber count, whatever...
Can anyone try fork 0.13.5 and update NPE then rebuild (0.13.5.1 maybe) and test it out is it still can play on background or not, if yes it maybe a bug that start to happening from 0.14.0 onward...
@ritiek this is a new issue that is affecting videos not previously affected. The view count appears to be irrelevant (Some affected video I have looked at have view counts over 15,000). If this is a change in the backend with Youtube then a possible fix may be to play the audio component from the video stream if the direct audio stream is not available.
You guys are right. No background option for me with https://www.youtube.com/watch?v=CEsV2z1ymh8 on v0.14.1 either (2.6M views) where as youtube-dl downloads audio fine.
This song works for me in bg
Truth is, i removed the ability to use videostreams in background player with 0.14.0. This is due to a quick fix since some videos without audio only seemed to crash. @karyogamy You told me that background player could do that, but which video streams would work for it?
IIRC, since we are now ignoring segmented urls when extracting DASH files, the audio playback on some streams needs to be delegated to Exoplayer, which is capable of parsing and playing DASH files internally.
This means we need to either modify the extractor to return a DASH file in StreamInfo, so the AudioPlaybackResolver can recognize the stream and use it. We may also need to modify the background player itself, so it can select on which audio stream is played back. In this case, I assume we are going to choose the one with the best quality.
Otherwise, we can just change up AudioPlaybackResolver a bit to just play back the video stream in the background. This is suboptimal and should never be done, but if we want a quick solution, we can do this for now. In this case, I would just use the lowest quality setting just to save on bandwidth.
By the way, this is just an observation but I've never seen the segmented url fail for audio only streams, so maybe we can change the extractor to let them pass for now and test if there are streams that cannot be played on audio.
@justanidea for first 3 songs, yes, but the rest isn't...
Also you can try this playlist, entire list cannot play in background on my end.
https://www.youtube.com/playlist?list=PL_h4IoimLDtR1XayXb2y6s0OMsoggBt6d
This means we need to either modify the extractor to return a DASH file in StreamInfo, so the AudioPlaybackResolver can recognize the stream and use it.
As i said we had trouble with segmantet video streams. As you said we need to have a way to tell that there are streams that are segmented. And than inszead of having a url haveva selector that points to the tag in the dash file. What do you think?
We can return the dash file url in the extractor, just like how livestream is done. This way, the audio resolver would just play the stream in audio. But this means we need to implement a quality selector, so these dash videos can change quality. Otherwise, the current video resolver will treat it as a livestream and not provide a selector. This is a good idea in general, since this means we can also change livestream quality.
However, if we want to let the user download audio streams, we will need to parse the segmented audio url still. This should be fine though, since the resolver will take the dash file before it looks for an url to play.
So, I think we should still parse the segmented url to allow download. But also return the dash url, so the player resolver can play them instead of the invalid urls.
But this means we need to implement a quality selector, so these dash videos can change quality. Otherwise, the current video resolver will treat it as a livestream and not provide a selector.
Yes that should be done. With this selector we can later also filter out the streams that created the crashes in the first place :)
However, if we want to let the user download audio streams, we will need to parse the segmented audio url still.
But wouldn't that mean we would need to mux them as well? If so i would disable download for them at the beginning.
https://www.youtube.com/playlist?list=PLQNHYNv9IpSw_bS2Jke60RJ85Nx_CsgjP this playlist seems to have issues. If you hit the background button, it repeatedly said "failed to play steam" for every song in this album.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Any ETA for when this will be fixed?