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!"
Impressive (Score:5, Insightful)
Very impressive! However, given Flash's performance issues even when compiled natively for mobile devices, this is more of a proof of concept then something usable.
Re:Impressive (Score:4, Insightful)
Hey, now those flash ads can bog you down EVEN MORE, and just in case you left Javascript on with flash uninstalled, you get the benefit of it as well!
Honestly, I think this will force most people to turn Javascript off if nothing else.
Re:Impressive (Score:5, Insightful)
most people or most nerds? I don't think most people even get ABP, even if they run Firefox, let alone actually know what Javascript is or that its something that can be disabled. Turn off JS these days, and practically nothing works. better would be a plug-in which just prevents Smokescreen from being loaded in particular.
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: (Score:3, Insightful)
It dares to have different key bindings to Firefox, and it actually renders pages as intended?
Unacceptable!
Comment removed (Score:5, Insightful)
Re: (Score:3, Interesting)
I don’t use noscript. I use ABP.
When confronted with an annoying script, I’ll identify the script and block it in particular... and if I’m feeling particularly cranky, I’ll smack their entire site with a ##script, like this:
snopes.com##script (god damn you Snopes, for your copy protection script...)
Re: (Score:3, Insightful)
most people or most nerds? I don't think most people even get ABP, even if they run Firefox, let alone actually know what Javascript is or that its something that can be disabled. Turn off JS these days, and practically nothing works. better would be a plug-in which just prevents Smokescreen from being loaded in particular.
Disabling javascript at the user's will? Forget ABP, that's where noscript comes in! And who doesn't use noscript?
I used NoScript for awhile, but it became annoying and I couldn't really identify any real benefits for myself to use it. ABP is enough for me in terms of making the web bearable. Whatever security benefits I allegedly get from running NoScript become meaningless when confronted with the fact that I don't browse around bizarre and obscure websites in the first place.
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...
Re:Impressive (Score:5, Insightful)
On a side note, why are people suddenly so in love with the term "infographic"? Can't we call it a "graph" or "chart"?
Re: (Score:2)
That's, like, so Web 1.0!
Re:Impressive (Score:5, Insightful)
On a side note, why are people suddenly so in love with the term "infographic"? Can't we call it a "graph" or "chart"?
It is because your boss's nephew knows how to make graphs and charts. Never word anything in a way that might cause you to be replaced by your boss's nephew.
Re: (Score:2)
On a side note, why are people suddenly so in love with the term "infographic"? Can't we call it a "graph" or "chart"?
Because it sounds like 'pornographic'. That makes every single marketing degree person perk up their ears. And everybody knows management loves the info-porn.
Re:Impressive (Score:5, Insightful)
First, infographics isn't a new term, it's a been around since the early 1990s, at least.
Second, infographics is a more inclusive category than charts or graphs. Charts and graphs tend to be quantitative in nature. A good example of an infographic is a map: calling a subway map a chart is a stretch. (Yes, I'm aware of nautical and aeronautical charts.)
So, when Dan suggests that Flash has legitimate uses for infographics, I think that's a perfectly legitimate use of the term.
Re: (Score:3, Insightful)
Maps are considered "infographics"? That's crazy. Why aren't maps just "maps"?
Re: (Score:3, Insightful)
Re:Impressive (Score:5, Funny)
Oh, thanks helpfriendinator. Without your inforeply I wouldn't have been able to think outside the box to architect a synergistic model of Web 2.0 paradigms that enable me to comprehend the emergent properties of the cloud.
Re:Impressive (Score:5, Informative)
Re: (Score:2)
It's probably noscript, not adblock. I allowed a script from smokescreen.us and it's working albeit very slow
Re: (Score:2)
It depends on your subscriptions/past blocking history. I am using easylist on adblock on chromium from the daily ppa (the beta I had installed started leaking all my memory, the current dailies are working nicely for me on lucid) and only had to enable scripts, didn't have to disable adblock. but the page explicitly says to disable adblock if it's failing. nice sneaky way around flashblock but noscript &c are still proof against.
Re: (Score:2)
Re: (Score:3, Insightful)
Bog down? And an 8000 line JS program isn't?
Are you running a lappy 386 like in the video?
I don't know about you, but I go to sites with lots of flash and it doesn't bog me down...maybe your on dialup or something....
You can be annoyed with Flash ads sure...but on a free content site like this one STFU...it's free...just ignore them. Bunch of cry babies out there.
And like it our not Flash has brought me and millions countless hours of enjoyment thru YouTube, Hulu, etc. Even strongbad was cool in it's day. I
Re: (Score:2)
When in doubt "Kick da Cheat"
Re:Impressive (Score:4, Insightful)
Times I've used a webcam or mic on flash: 0
Re:Impressive (Score:5, Interesting)
> Honestly, I think this will force most people to turn Javascript off if nothing else.
Which just might be the point. Turn JS off and the browsing experience is degraded to the point of unusability on most of the current net. So now the choice is Flash delivered via the plugin or Flash delivered via this JS thing which will be REALLY slow and make i* products look underpowered when compared to competing products viewing the same content. Game, Set and Match. Flash is now going to run on Apple products, His Steveness's only remaining choice is does he want it to run well or not.
Awesome! (Score:3, Funny)
So you're saying iPhone will get piss slow JavaScript based Flash while the Flash Blocker on my N900 functions normally? Awesome! :)
Re: (Score:3, Interesting)
What performance issues are they?
However wrong your claim might be, it is absolutely true that dynamic HTML 5 performance (e.g. SVG/ Canvas) is horrific on the iPhone / iPad, where such a technology would have the most utility. Which is why it's a bit humorous that Jobs talks it up, while delivering a replacement technology (he was talking up HTML5, right?) that
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: (Score:2, Interesting)
Re:Impressive (Score:5, Interesting)
The mobile player uses the GPU for both animation(vector, bitmap, etc.) and video playback. JavaScript also runs fast on my Nexus, but when compared to Flash 10.1, it's downright slow.
Re: (Score:2)
Funny but from what I have heard the performance is pretty hit or miss.
Just about every review I hard also said it made the phone hot and really did a job on battery life.
As an Android users that just got 2.1 I really want 2.2.
Re: (Score:2)
Hot is a new one on me? I've felt a bit of warmth when playing Genesoid and SNESoid, but nothing has ever got hot on my phone.
I did a search for the 2.2 updater and found it online. It w
Re:Great news for Intel and AMD. (Score:5, Funny)
Crap like this is why we need to buy a new computer with a faster processor every year, just to do the same shit we were able to do last year.
But this is a NEW way to watch those 15 year old videos! That alone makes it better.
Re: (Score:2)
But this is a NEW way to watch those 15 year old videos! That alone makes it better.
Yea, nothing like re-living the Age of Consent Tour in HD on the iPhone.
Re: (Score:2)
That's nice, your comment just shows how ignorant you are.
Don't worry, I'll get off your lawn.
Flash without the memory leak !?!? (Score:3, Insightful)
This sounds better than the actual Flash player! I've been playing with canvas in an effort to get away from Actionscript but this, especially open sourced, sounds like the best of both worlds.
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: (Score:3)
As far as I know Flash Player 10.1 has not fixed the graphics memory leak which was not caused by delveloper bloat. Flash was not releasing memory from loaded graphics according to Macromedia/Adobe. This was a big problem for developing browser based state pages. That may, however, be fixed in 10.1. Were you aware of that problem? Curious why my comment says I'm not experienced. The main problem I have with Actionscript is mobile penetration, and if canvas allows me to port client games and animations to iP
Re: (Score:2)
http://pastebin.com/vuRxVfbx [pastebin.com]
Apple just updated its EUA... (Score:5, Funny)
Apple just updated its EUA to exclude javascript, Steve Jobs reports that this will improve the user experience
Re: (Score:3, Insightful)
If apple was being honest about the reasons for not including flash, things like problems with sandboxing and concurrent app access etc, this probably inciodentally solves those problems so Steve may not actually care.
And it's a EULA btw.
Re: (Score:2)
Tossing it out isn't possible at this point - there are far too many pages that depend on it. The best you can hope for is providing a migration path and getting the major browser providers and the W3 to agree to it.
JavaScript is the scapegoat for the DOM (Score:2)
What needs to be replaced, if anything, is the DOM, not JavaScript. When you don't have to deal with the DOM and the resulting browser-compatibility issues, JavaScript is actually pretty awesome. It's not without its warts -no language is- but it's surprisingly capable.
However, that raises the question of what the DOM should be replaced with, and I don't have an answer for that.
Re:Apple just updated its EUA... (Score:4, Insightful)
I only wonder how the speed will be (Score:4, Insightful)
Re: (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: (Score:3, Interesting)
http://pastebin.com/vuRxVfbx [pastebin.com]
Here it is after running it through a javascript beautifier. ... From what I see, yeah, he implemented it.
Re: (Score:2)
I start to wonder if its worth it to wait that long.
I'm very sure the answer is "no".
No, they'll be Steve Jobs' Best Friend (Score:5, Insightful)
Jobs doesn't care about flash content, he cares about flash. If the flash content can be used without flash itself, well, that'd be great.
Not sure why, but slashdot's headline writers are starting to sound more and more like tabloid writers. Why not say "Smokescreen to Adobe: flash off!"
Re:No, they'll be Steve Jobs' Best Friend (Score:5, Insightful)
Jobs doesn't care about flash content, he cares about flash.
Sorry but that's just not true. Did you miss the recent uproar about the new iPhone SDK agreement [slashdot.org]? The new agreement bans any applications that were not natively written in C/C++/Objective C. This updated agreement was released only weeks before Adobe CS5 was to debut with advanced tools that would allow the porting of flash apps to the iPhone. If flash itself was the problem then such a clause would not have been added.
Re: (Score:3, Interesting)
Who says it has anything to do with Adobe or Flash [bigzaphod.org]?
Re: (Score:2)
not weeks before -- it was released on a Friday, with CS5 launch on next Monday.
Re: (Score:2)
Adobe CS5 was to debut with advanced tools that would allow the porting of flash apps to the iPhone. If flash itself was the problem then such a clause would not have been added.
Funny, you say advanced porting tools in your first sentence, then flash itself in the second. I think Apple is really more concerned about losing control of the iPhone/iPad development environment. I don't think they even particularly care to exercise their own control, just keep it away from outsiders. I mean, if they wished to really lock it down, they could pick one language, one IDE, and stop pursuing HTML5, right? Just my own opinions, and Apple is very hard to read.
Re: (Score:2)
I'm not sure I understand what else it's about if it's not about Flash itself. Flash does suck. I don't like it on our Macs. Either it performs poorly, it crashes or the arrow keys don't work, or all the above (we experience all of these on our Macs at home, the latter being just as irritatingly vexing as the other two issues). But what is the reason for not wanting Flash apps to be convertible to iPhone apps? iPhone apps, if sold, make Apple money. if they aren't sold, they don't, but there's lots of free
Re: (Score:2)
And you can include an Objective C app that has nothing but a UIWebView window loading a SWF file from Javascript.
Re: (Score:2)
Actually it was released the Thursday before CS5's release, and was a twist of the knife into Adobe (with whom Apple has a love/hate relationship -- more hate, actually).
Steve has been screwed by Warnock, Gates and their like before, and took this action at the worst possible time for Adobe as repayment. The last thing Steve wants is to get screwed again,
Re: (Score:2)
Re: (Score:2, Interesting)
I'm not so sure about that... (Score:4, Insightful)
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.
Re: (Score:2)
No, he cares about iAd.
http://en.wikipedia.org/wiki/IAd [wikipedia.org]
He doesn't want others from profiting where he wants to be the gatekeeper.
Actually... (Score:2)
Re:No, they'll be Steve Jobs' Best Friend (Score:4, Informative)
Javascript trumps Flash? (Score:4, Insightful)
Re: (Score:2)
Yet, I heard no sound during these demos. Without sound strongbad is not so great.
Re: (Score:2)
I did. Perhaps you need to turn your speakers up.
Re: (Score:2)
I got it working in Chrome, in firefox I had no sound and it was very slow. I am running adblock there though.
Re: (Score:2)
There are plenty of tools to build Flash content, there aren't nearly as much or as advanced tools to build Javascript/HTML5 apps.
Re:Javascript trumps Flash? (Score:4, Interesting)
the iPad needs this (Score:4, Insightful)
A certain sort of video (the kind you can't find on Youtube) comes primarily in Flash format. This sort of video seems to drive the adoption of new technology. If this can bring said video to the iPad, sales are certain to engorge.
Good test of 'open platform' (Score:5, Interesting)
Adobe insisted Flash is an open platform: This will be a good test of their claims. Will they compete admirably against a JS re-implementation of their own wares (and improve their own runtime - hence Smokescreen as competition to foster improvement) or will they fight dirty?
Re: (Score:3, Interesting)
Re: (Score:2)
Oh yeah, I know of Gnash et al. - but I think this is going to hit a nerve much more than those projects because it has "You are obsolete" written all over it: Not only can JS displace Flash, it can bend over backwards and run Flash itself. It's a big statement. I don't think Adobe will take kindly to it (or not as kindly as they've accepted generic FOSS re-implementations)
Re:Good test of 'open platform' (Score:4, Insightful)
Why should Adobe care? As far as their history goes, I think Adobe would love it if they didn't need to support a flash plug-in. They certainly don't seem to want to invest a lot of time/money into keeping it up-to-date.
Adobe makes their money on Flash development tools. They give the plug-ins away for free to sell more dev kits. I could see them kicking up a fuss over open source compilers, but not interpreters.
Re: (Score:2)
And what happens when a 3rd party plugin gets popular, but omits feature X, or adds feature Y?
Adobe's dev tools then need to be modified to disable some favored feature, which will then piss of developers who use it and want it. Or perhaps Adobe can't add feature Y, giving some 3rd party an advantage in Flash dev t
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.
Re: (Score:2)
Re: (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: (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: (Score:2)
Re: (Score:2)
I want to throw in that it's really slow in Firefox under XP as well, but it runs great with Chrome.
I think they are suffering from the slashdot effect though. It took a few tries to successfully load.
Re: (Score:3, Informative)
Welcome addition (Score:2)
Gordon? (Score:5, Informative)
Why on apple.*? (Score:5, Insightful)
Re: (Score:2)
Because it proves (again) that Adobe can bring Flash to the iPhone/iPad without breaking agreements with Apple. It shows that Adobe would rather cry about the situation instead of actually supporting the product they claim to stand behind.
More efficient?? (Score:2)
Re: (Score:3, Interesting)
I noticed the same thing on Windows XP, 1.8 GHz... although it was a much less drastic 2-3 sec. difference.
Badass? (Score:2)
More like 'slowass'.
Very slow on iPhone 3GS (Score:2)
Pretty nifty anyway, and if the browser has (much) faster Javascript, maybe it will run well? Did anyone try this on an Android 2.2 phone which is suppose to have such?
Rube Goldberg (Score:5, Funny)
And Adobe can't do this, why? (Score:5, Interesting)
This works pretty well under the released version of Safari for OSX 10.6. In fact, in some of the samples where the flash version is provided as well, the Flash ones use more CPU then the HTML5 ones.
There is a bit of degradation in some of the graphics, but hey its better then not seeing the graphics (ok, that really depends ... if its an ad and you prefer not to see it ... whatever).
Now the question is, why can't Adobe add a feature to the Flash authoring tool to just output the HTML5 and whatever is needed, that smokescreen does in the browser?
From some of the samples it would seem like you could just "drop in" the converted version with minimal loss of quality and reach a much larger audience.
I would still prefer Flash, for the most part, go away, and this won't help that too much (initially anyway). But it seems like this would be a good way for many web sites to start using HTML5 now, while support and implementations mature, as well as giving all the Flash devs time to learn to write natively in HTML5.
SmokeScreen (Score:2)
Size (Score:3, Interesting)
Using Packer (with variable renaming and 64bit encoding) it get's down to 105,177 -over 30% reduction in size. Using Gzip [gidnetwork.com], it could easily get below 50K.
Re: (Score:2)
To be fair, this may be one of the few times people actually try to read the article, so I'm sure that's at least contributing to the problem (reduced speed of downloading the JS script before it can be executed)
Re: (Score:2)
As the server is currently undergoing a slashdotting, I'd be inclined to advise you to let it load for a bit, then refresh.
On several of the demos, I did notice that the flash would start first, but partway through the demo, flash would freeze for a moment and the javascript ended up taking the lead. This would seem to relfect the opposite of what you're experiencing.
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: (Score:2)
And proves that there's really nothing Flash can do that HTML 5 can't.
I agree with everything you said, except this last statement.
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:no. (Score:5, Interesting)
The point was to prove HTML5+Javascript can do everything Flash can do.
Now the next step is to do it better.
Re: (Score:2)
What browser are you using?
I'm using Firefox 3.6.3 and it started very slow, but I reloaded the page and it was as fast as running it in flash native. So I think the issue might be un-related to the script itself and actually in the javascript implementation or maybe in the interaction of various plug-ins I'm using that required a reload to make it go away (after allowing it through temporarily for noscript).