Smokescreen, a JavaScript-Based Flash Player 356
Tumbleweed writes "How to make Steve Jobs your mortal enemy: Smokescreen, a 175KB, 8,000-line JavaScript-based Flash player written by Chris Smoak at RevShock, a mobile ad startup, and to be open-sourced 'in the near future.' From Simon's blog: 'It runs entirely in the browser, reads in SWF binaries, unzips them (in native JS), extracts images and embedded audio, and turns them into base64 encoded data: URIs, then stitches the vector graphics back together as animated SVG. ... Smokescreen even implements its own ActionScript bytecode interpreter.' Badass!"
Re:Impressive (Score:5, Informative)
Unfortunately, you're exactly right. From the blog:
(sic)"It’s stated intention is to allow Flash banner ads to execute on the iPad and iPhone, but there are plenty of other interesting applications (such as news site infographics)."
There would be a lot of money to be made in cajoling those flash-based banner ads onto iPad / iPhone. Yep, lots o' money...
Slow on Firefox (Score:5, Informative)
This is running like a dream on my Mac running Safari, but I tried it on a co-workers Mac running Firefox, and it crawled...
Just for reference if you're trying this on Firefox.
Gordon? (Score:5, Informative)
Re:Impressive (Score:5, Informative)
Re:Slow on Firefox (Score:2, Informative)
Slow on Firefox at initial attempt.
Then I turned off AdBlock (as it visibly recommends), refreshed and it's as fast as it gets.
So it's possibly some anti-adblock check, not a problem with Firefox.
Which makes sense because those guys are advertisers and would like to see adblock go away.
Re:Too slow or just me? (Score:5, Informative)
Runs fine for me (OS X 10.6.3/Safari 4.0.5).
CPU usage averages 15% (of one core) on the Strong Bad demo, except during the first bit with the Cheat, where it spikes to ~40%.
Using Flash 10, CPU usage averages 8-9%, but during the same scene jumps to ~30%.
Which is pretty damn impressive for an emulator. And proves that there's really nothing Flash can do that HTML 5 can't.
Re:Slow on Firefox (Score:3, Informative)
It also uses broken browser-sniffing, so it's not possible to easily test what it would behave like on development Firefox versions....
Re:I only wonder how the speed will be (Score:3, Informative)
http://smokescreen.us/demos/sb45demo.html [smokescreen.us]
Just open it in Chrome. I can't tell the difference between the flash and the javascript version.
(Also oddly enough the source code is right here? http://smokescreen.us/demos/js/smokescreen.0.1.3-min.js [smokescreen.us] or did he mean he'll clean it up...)
Re:Flash without the memory leak !?!? (Score:4, Informative)
What memory leak? From my experience, especially in recent years, it's been the developer's inexperienced bloat that's been an issue. It's up to you to manage your loops, listeners, objects created, and so on, as to keep memory and cpu usage low. It just takes competence and experience, which most of these so called Flash guys lack.
Flash Player 10.1 mobile actually prevents the poorly developed bloat from using up too many resources, even on the pages that have more than one SWF running at once. The desktop version will hopefully implement this soon.
Your comment about canvas to me says you're not that experienced with Flash. ActionScript 3's drawing API is a huge step up from Canvas. It's years ahead of SVG, or canvas, and it's not at the mercy of the browser for what it can do.
Re:No, they'll be Steve Jobs' Best Friend (Score:4, Informative)
Re:I'm not so sure about that... (Score:2, Informative)
I don't buy your take on things.
I think it has a lot more to do with being the gatekeepers for content (and continuing to get a cut of the profit) than with flash content itself. They don't want people using apps and games on their platform that you didn't buy from the app store, hence no Flash or Java on the i-devices.
... except that they built in the ability to turn a web page into an app that sits on the home screen. So, for example, I have a Google Latitude app, and a Google Calendar app. Furthermore, it's not about profit, because there are many, many free apps in the Apple App Store. Flash does seem to be the clincher.
Re:Impressive (Score:5, Informative)
it is absolutely true that dynamic HTML 5 performance (e.g. SVG/ Canvas) is horrific on the iPhone / iPad
It is absolutely not true. We're developing an HTML5 replacement for a flash app on a major brand's website and it's working perfectly on the iPad and iPhone. It's got moving images, videos, downloaded fonts (CSS3), etc. We haven't run into a single performance problem.
(Can't speak for SVG, though. Never tried it).
Re:Too slow or just me? (Score:5, Informative)
And proves that there's really nothing Flash can do that HTML 5 can't.
No it doesn't. These are simple animation examples from years back . StrongBad was originally created in Flash 4. It's 2010, we're now using Flash 10.1. Flash has evolved quite a bit.
Here's a list of what Flash can do, that HTML 5 can not; http://www.wirelust.com/2010/05/21/10-things-flash-can-do-today-that-html5-cant/ [wirelust.com]
Re:Impressive (Score:4, Informative)
"Turn off JS these days, and practically nothing works."
Um, Nope, that is wrong. I run both noscript and adblock plus and after giving my bank and the biggies like youtube permissions through both the only sites that don't work are the ones that are a bit dodgy in the first place.
It's much, much simpler to just install Chrome and not have to worry about javascript performance.
Re:Slow on Firefox (Score:3, Informative)
Re:Impressive (Score:2, Informative)
Because people have a strong obsession with infornography on the internet.
Re:Impressive (Score:2, Informative)