Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The javascript engine and rendering engines are what are generally affected by being backgrounded. So yes, generally the media library will continue receiving the combined video/audio stream and not bother rendering the video frames


Youtube uses the Media Source Extensions API, which means that JS is responsible for fetching compressed video data and feeding it into the decoder, so it can implement adaptive streaming. Pause JS for more than a few seconds and the video will stop playing.


Yes, and this is likely why Youtube now periodically pauses in the background on current macOS/Safari.


My understanding is that most video websites like Youtube use Media Source Extensions, a standard which allows javascript to download and assemble video streams in non-standard ways. This work is done by page JS and passed to the browser to decode and render. AFAIK youtube uses this to implement DASH streaming.

Presumably there is no easy way to disable page JS but keep your youtube video downloading.


Does HTML video need to catch up based on the most recent keyframe?

If they don't render while backgrounded, how do they do that without being noticeable?


Chrome does this for a long time now and I don't consider it an issue. You see a frozen version of the last decoded keyframe until the next one is decoded. Elegant solution IMO.


That makes sense, it seems I haven’t looked closely enough to notice.

I couldn’t find info on how often a keyframe is expected from YouTube, but I’m recalling the bad old divx days where you sometimes had a frame per scene and skipping was very slow.


What about a timer running in a different tab?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: