4 ms·
I notice that the demo video stops when I switch tabs. Is this by design or by accident? Can I use JSMpeg but have it play in the background? Another thing; can
by eriknstr 10y ago
I notice that the demo video stops when I switch tabs. Is this by design or by accident? Can I use JSMpeg but have it play in the background? Another thing; can I have video controls?
PS: That video has a very late nineties, early double-ohs feel to it indeed. Good choice of video :)
- nacs 10y agoBrowsers (like Chrome throttle) the JS execution of background tabs drastically which would probably make the MPEG decode impossible. They probably stop the video as a workaround.
- ryanplant-au 10y agoWorth noting that Chrome won't throttle a tab that has audio playing.
- stilldavid 10y agoYeah. From the docs: > pauseWhenHidden – whether to pause playback when the tab is inactive. Default true. Note that browsers usually throttle JS in inactive tabs anyway.
- tyingq 10y agoSupposedly, Chrome doesn't throttle background tabs where audio is playing.
- koolba 10y agoJS hack idea! Play a silent sound to force Chrome to not throttle your page when it's not primary.
- nix0n 10y agoPlease don't. Also, Chrome puts a little speaker icon on the tab, so users might notice.
- recursive 10y agoIn the long run, the probability of this being exploited is approximately 100%. I'm surprised they left in such an obvious loophole.
- daurnimator 10y agoI'm not sure how usurping this is an 'exploit'. It's used as a heuristic to save battery life. and if you're trying to run down a user's battery I can think of better ways.
- Ezhik 10y agoNeed to do some more testing, but I have suspicions that Chrome actually doesn't put the sound icon on the tab if it's playing silent audio.
- koolba 10y agoThrow in an inaudible frequency once per second at a low volume. I doubt they're doing signal processing to decide if a human can actually hear the output.