Re:Play audio only on YouTube and save bandwidth
by pornel on Friday February 04, 2022 @09:42AM
(#30207302)
Could YouTube automatically omit video stream when the tab is in the background? DOM has visibilitychange/pagehide events.
[ Parent
| on HN ]
Re:Play audio only on YouTube and save bandwidth
by londons_explore on Friday February 04, 2022 @09:50AM
(#30207419)
If anyone in youtube management is aware of these events, they'll use them to make the playback automatically pause when the page is in the background and pop up a big message saying "Buy Youtube Premium to listen to your music while you do other things. First month half price!".
Re:Play audio only on YouTube and save bandwidth
by thunderarea on Friday February 04, 2022 @09:56AM
(#30207504)
Ha ha ha. I think that they know them. But in desktop there are many ways to change it with extensions or even browsers other than Chrome. So they don't give it a try
Re:Play audio only on YouTube and save bandwidth
by manwe150 on Friday February 04, 2022 @09:53AM
(#30207461)
If you have ever switched resolutions manually in the browser, you will notice that it takes a while to rebuffer and decode the stream. I would guess it would be hard to do this in a glitch-free way. The YouTube Music app has a button to toggle it, and it exhibits just this lag.
Re:Play audio only on YouTube and save bandwidth
by kevincox on Friday February 04, 2022 @10:29AM
(#30208013)
IIRC the audio is the same for all formats, so this shouldn't be an issue. You just continue playing what you have and stop downloading new video chunks. I think the biggest problem is that when you switch to the tab you would need to wait a bit for the video to appear (or it would need to pause and stutter). That is actually quite a hard problem as well because the player needs to decide how far into the future it should start fetching video.
Re:Play audio only on YouTube and save bandwidth
by belthesar on Friday February 04, 2022 @11:13AM
(#30208688)
Google provides renditions in two codec pairs for most video - vp9 + Opus and h.264 + AAC. Assuming the manifest for audio only keeps you using the same codec family of renditions, this should work just fine (minus, as you said, the player not showing anything until the next video+audio segment is fetched) as long as we're talking VOD content. Live content should also be able to switch from source to audio only with no re-fetch, but live transcoded renditions won't be in line with either rendition, so that'll cause a burp.
Re:Play audio only on YouTube and save bandwidth
by kingcharles on Friday February 04, 2022 @12:32PM
(#30209840)
I feel like the YouTube Music app is actually changing to a totally different SKU when you switch between video/audio, and not just giving you the audio stream from the video.
Re:Play audio only on YouTube and save bandwidth
by thunderarea on Friday February 04, 2022 @09:52AM
(#30207448)
It could. But it does not do it :)