Canvid.js – tiny library for playing video on canvas elements
gka.github.io
gka.github.io
Longer demo: http://phoboslab.org/files/jsmpeg/
jsmpeg only unpacks the current frame into memory instead of decoding the whole video at once, so it's memory footprint should be much lower. MPEG1 files are also much smaller than storing individual JPEG frames.
While killing the battery while doing it... Why we don't just expose lower level decoding apis to JS instead, I don't know...
As we've already established, this can already be done, badly, with native javascript. So adding that access would add nothing new to "abuse" or "eat bandwidth" than what we already have, and will induce even LESS bloat than the current situation.
As for merely playing movies, ads etc (without direct access to low level decoding APIs), obviously javascript can already do that with the HTML5 media api + native encoders. So nothing new here either.
So I can't tell what disastrous "results" you're referring to stemming from what I propose.
Giving JS access to low level movie decoding/encoding would just be something to use to make creating JS-based video editors and such easier and more performant.
make it efficient and easy, and you change the economics of the situation to encourage abuse.
No, but they can already show any arbitrary video they want by using Javascript to add any number of videos playing on the website -- that's just plain vanilla HTML5.
Adding hooks to low level decoding doesn't add anything new that they can't already do when it comes to showing ads. For ads they only care for high level decoding.
It only adds something new when it comes to creating video mangling apps in JS.
Beyond autoplaying, I can't imagine what you mean about adding "hooks" to low level decoding. What does that actually gain you over the current situation?
Aha, I see, thought that wasn't the case.
Now, having that capability didn't turn out to be much of a problem on the desktop, did it? I mean, regardless of battery concerns etc, do we really see that many autoplayed videos?
>What does that actually gain you over the current situation?
The ability to decode individual frames, re-arrange them, add filters to them etc using accelerated native APIs -- much more than some "play()", "skip()" affair.
as for your special api abilities, again, you can do all those things now, even on iphone. so again, what more do you actually want?
The world is in trouble
Ah what we tell dem murdera
Are there other legitimate use cases than using this a fallback for iOS? Curious.
Previously: https://news.ycombinator.com/item?id=4531088
Teardown: https://docs.google.com/document/u/1/pub?id=1GWTMLjqQsQS45FW...
https://www.divergentmedia.com/phosphor
Whether you actually gain anything from using this technique as opposed to other simpler techniques like canvid, well, let's just say YMMV