Smokescreen, a JavaScript-Based Flash Player
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!"
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.
Better known as 318230.
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.
Physics is like sex: sure, it may give some practical results, but that's not why we do it.
The demo from HSR is way too slow to be useful. Is this the popular experience?
"Here Lies Philip J. Fry, named for his uncle, to carry on his spirit"
Apple just updated its EUA to exclude javascript, Steve Jobs reports that this will improve the user experience
I just wonder how efficient it will be for the rendering times. Some flash is already bordering on bloatware. Add in taking it apart and re-rendering and I start to wonder if its worth it to wait that long.
"Computers are a lot like Air Conditioners" "They both work great until you start opening Windows"
so this isn't going to fix anything, besides forcing apple to create a workaround so their mobile platforms don't get destroyed by JAVASCRIPTING FLASH.
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!"
I know every time slashdot runs a story on some crazy hack, we always get the people that don't get it asking why?
And we invariably have the 267 comment thread debating "why" vs "because it's cool".
But I'm afraid I'm going to have to put my foot down. This isn't so much a epic hack as a unholy kludge. This is as if Hitler killed 9 million Jews "because they were there".
My take is that this proves, perhaps to a significant degree if not completely, that Javascript/HTML5 can do anything that a native Flash engine could do . So why build in Flash? Go straight to Javascript/HTML5. I do not think Steve Jobs will be unhappy about this at all.
-- Perhaps I see less than some, but more than many.
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.
A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
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?
This is fantastic news for Intel and AMD. 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.
You know, I could watch streaming video just fine back in 1995 using RealPlayer on my old HP-UX workstation. That workstation probably has less computing power than a shitty clamshell phone today. But times change. Now it's 2010, and my computer from last year will barely have enough power to suitably run this JavaScript video player monstrosity.
It's not that we can do something that we couldn't do 15 years ago, it's just that we take an absolutely moronic approach these days.
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.
Okay this is a pretty good proof of concept and it runs super slow. I looked over at my cpu usage though thinking it was hogging it like flash and cpu usage was almost non-existent. I would love to see this implemented well, but OTOH I would probably start running noscript to block ads eventually too.
If the player will work without being slow, then it's a welcome addition. Just a thought - what if it grows up to be faster in later editions?
/.'d pretty quick for me. this isnt quite a mirror but it is a video of the guy that coded it showing it working on an iPad:
http://vimeo.com/12014368
What about Gordon? That one *is* open-source. Is it different from what TFS refers to in terms of goals (not current state)?
Have you heard about SoylentNews?
Other than Apple's non-support of Flash on the iPad, this has nothing to do with Apple. This is an Adobe Flash emulator written in JavaScript.
Interesting. It seems to use less CPU in Chrome on my Linux box than the actual Flash plugin, too!
Be relentless!
More like 'slowass'.
---- Booth was a patriot ----
The Internet Finds a Way.
This isn't so much about Apple as it is about users finding a way to run the apps and code they want, where they want, when they want it.
Although if it doesn't suck up resources, this could enable flash on Apple iDevices, and I doubt Steve Jobs will ignore it if it catches on.
"I hope you know how very lucky you are to know me, because I am so incredibly incredible."
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?
--- What?
It opens SWF binaries, unzips them (in native JS),follows a little ball down a wire track, knocks over domino that begins a chain of falling dominoes, the last of which frightens a chicken into laying an egg, which rolls down a ramp, cracks into a frying pan, flipped by a spring loaded spatula onto a plate with bacon attached to a remote control car, that drives it to the kitchen table. Then a counter weight pulls up the plate, puts on the table, then extracts images and embedded audio and turns them into base64 encoded data. That is a lot of trouble just because Jobs is being prissy about what runs on his over priced under powered eye candy.
"I'm not a quack, I'm a mad scientist! There's a difference." - Dr. Cockroach
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.
Very impressive but can he solve the three main problems with Flash?
1) Performance
2) Ads
3) Uselessness
The real problem is Flash content is garbage. The fact that hit hogs resources while being garbage is just all that much worse. Running it as a Javascript interpreter will be all that much worse. Blah.
Chrome 6.0 64-bit dev build
Ubuntu 64-bit
3Ghz Quad-Core Phenom II
and it's dreadfully slow. (almost nil cpu tho!)
yes I have tried refreshing it.
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.
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.
If you post your JavaScript source, even minified, without a server component then you've given away all your secrets. Reverse engineering an 8,000 line JavaScript program is not that difficult. But I must say, that's an impressive coding effort!
Gordon is a pure JS flash runtime. http://paulirish.com/work/gordon/demos/
Keep the faith, share the code
Named after a curious side effect after a while running it, they had to choose between that name and FriedMobo.
Actually, Flash allows all those little Flash games, which would cut out Apple's 40% for an AppStore game sale.
Populus vult decipi, ergo decipiatur...
"Force shits upon Reason's back." - Poor Richard's Almanac
On my iPhone 3GS, the Strongbad email runs, but it's dog slow (about one frame per second) and there's no sound. It's a cool idea, but it's effectively unusable (not that this will stop ad agencies from immediately pumping it out to the entire web).
...could they please show Happy Tree Friends videos as a demo of this?
kthxbye
It's a nice piece of work.
It would be even more impressive if it didn't use ~4x the CPU time that Flash itself does to render the same content....
So you're saying iPhone will get piss slow JavaScript based Flash while the Flash Blocker on my N900 functions normally? Awesome! :)
The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
var url = 'swf/sbemail45.swf'
to
var url = 'AYB.swf
and point your browser to the modified page. And yes, AYB at least attempts to work...a little choppy, though.
In my opinion this is proof that Flash is no longer needed. Flash was filling a specific need that HTML could not address. With the new version of HTML being able to replicate Flash (in 8000 lines of code at that), we should be prepared to abandon the proprietary Flash format, and embrace open standards like HTML5.
Using Packer (with variable renaming and 64bit encoding) it get's down to 105,177 -over 30% reduction in size. Using Gzip, it could easily get below 50K.
Is there anything better than clicking through Microsoft ads on Slashdot?
The MacOS Flash Player is also terrible, often sucking up 100% of CPU cycles no matter how fast the computer is. It's been bad for a few years, and has gotten progressively worse with each release.
For those of us with PPC macs, this has made internet video all but unusable (despite the machines being powerful enough to do anything else). My PowerBook can play back 720p H264, XViD, or even FLV video without stuttering through VLC. However, it's completely incapable of playing back a tiny 320x240 video on YouTube when using the official Flash Player.
Is it possible to use this Javascript magic to write a greasemonkey script to interpret the Flash, and strip the video out into an embedded instance of VLC, Quicktime, or (in the case of H264 flash files), HTML5 <video>
-- If you try to fail and succeed, which have you done? - Uli's moose
Comment removed based on user account deletion
He should have named it Smoakscreen
Comment removed based on user account deletion
I could see them kicking up a fuss over open source compilers
Unlikely. For one thing, the Flex SDK (which is the official compiler underlying Flex) has actually been open source for a while now. And MTASC has been around for at least 4-5 years and it's open source as well.
Then there's ming which isn't exactly a compiler, but it's another method of targeting SWF, and OpenLazlo, and SWFTools and SWFMill and ... well, the point is, Adobe doesn't seem to have been particularly interested in squashing tools which target the Flash runtime.
Tweet, tweet.
Ehr... considerin I'm on a i7 Xeon and it's stuttering to get through the first 20s of the video... how the hell does he expect it to work on ANYTHING slower then this?
Pretty cool nevertheless....
captcha: undwind
I tried the linked demo in Firefox 3.5.3 on Windows 7 and it ran great. CPU usage capped at 13% and mostly stayed at about 2-4%. Fantastic! However, I noticed a strange bug. If I close the tab where the "video" is running, the audio continues to play until the end. That's incredibly obnoxious.
What's sad is that this seems to work better than gnash and swfdec combined, and they've been in the works for years and years.
Isn't the source code already "available" ?
It's not under GPL or BSD. So if he just fixes that I can stop pretending that I don't have the source code.
http://smokescreen.us/demos/js/smokescreen.0.1.3-min.js
Oh, I get it -- it would be insanely slow to load. If nothing else, think of it locally generating all that base64-ness, which the browser then has to decode again before displaying.
But at the same time, in my experience, Flash is still significantly more CPU-intensive than the browser playing the same content, and native players are several times faster still. HTML5 could be optimized to be faster, and there are, what, four competing implementations?
So this will probably be slower to load, but also will probably run much faster, given how slow the Flash player itself is. (Unless it's a fundamental design problem with the flash format and specifications, and a fast Flash player is actually impossible...)
Don't thank God, thank a doctor!
Had similar results as you on Safari on my MBP, but not getting the video to render on my iPhone. Anyone else having this?
Long live the BSD license
But if it is entirely in JavaScript, isnt it already open source? After all the browser has to download the script locally to run it. Unless the code is obfuscated??
So basically this means that the Adobe could make Flash simply target HTML5..... Seems to be what would make everyone happy.
See jPlayer
I really mean it, jPlayer supports HTML5 and fallsback gracefully to Flash if HTML5 support does not work. And it is very coder friendly, you can create your own seekable player on top of it using the jPlayer calls very easily.
Maybe it will rather make people go to sites that are not plastered with advertisments instead?
Why would Jobs dislike this or even care? Apple is not anti-Flash, they just don't want the FlashPlayer running on their devices. This actually proves Jobs to be right. You can do Flash-like things with open standards, and no plug-in on the device. Doesn't matter what tool you use. The time and energy it would take to deploy FlashPlayer to all mobiles and update 4 times a year for security is like Appolo project level. And we see from this demo it's not fucking needed just as Jobs has said.
This is an Adobe story, not an Apple story, as it has been all along. FlashPlayer is supposed to be "cross-platform" yet Adobe has managed to put FlashPlayer v10.1 on Mac, PC, and in a beta that runs on a small minority of Android phones with outrageously bad performance. A JavaScript FlashPlayer that is truly cross-platform is like a gift for Adobe. It rescues the Flash developer tool and all the people who have Flash skills and makes them relevant to this decade.
Still, I think this would be more practical if it were a developer tool that converted Flash binaries to JavaScript and SVG and then you deployed the JS and SVG. Converting on the fly each time seems like the wrong approach, especially on tiny mobiles.
An HTML5 export from Flash is what is really needed. The fact that Adobe hasn't done that yet is incredible. But then, they shipped Dreamweaver CS5 in spring 2010 with no HTML5 support! Fucking madness. Don't tell me it's not ratified, the fucking spec describes the past and present, not the future.
These are all on Mandriva 2010.
Works in Midori 0.2.0 albeit slowly.
Works in Epiphany 2.28.1 too. The larger animations like Strongbad are much slower than Flash Player, but the banners are only a frame or two behind.
In Fennec 1.0.0 the smokescreen version works and I have no Flash Player plugin. Since that's supposed to be primarily for mobiles, it just seems right. The larger animations do seem a bit really in Fennec as well, but the banner ads are snappy. The Lyris one is actually a bit faster in smokescreen than in Flash Player.
Does not work in Konqueror 4.3.5 for some reason. I wonder if that version supports the necessary elements of HTML 5 yet. The "No smokescreen. :(" string doesn't show up and the space required is set aside in the render, but nothing ever loads. AdBlock enabled and disabled do the same thing: they run the Flash Player but not the smokescreen version.
Dillo 2.2.1 as expected doesn't support the necessary elements.
As expected, Links 2.2 in graphical doesn't support what smokescreen needs. I didn't bother trying the curses version.
NetSurf 2.5 (as compiled by me since there's no distro package for this one) doesn't work with smokescreen. Neither does the SVN development version of what will be 3.0 for that matter.
Oddly enough, some of the major browsers slowed down even more than the minor ones on the larger files.
This is really, really impressive. I was watching the sample sbemail and honestly couldn't believe this wasn't an actual Flash plugin object. It ran almost completely perfectly, even on this years-old single core PC.
Some problems with the easter eggs at the end, but the rest... DAMN. This stuff may work better than actual Flash on my PC!
I am not devoid of humor.
Replying to myself to note that uzbl works, too. As it uses WebKit, I'm not too surprised. I'm not sure of the exact version, as the command line parser seems to be broken and the option to print the version and quit doesn't print the version and actually leaves some processes running. (Bad coders! No cookies!)
I installed it via urpmi rather than compiling it, so I'm not sure of the git version, either. The RPM name is uzbl-0.0-0.1.20091130.0.1mdv2010.0 so I'm guessing it's version 0.0-01.20091130.0 since the other part is standard Mandriva patch level info.
is that this guy is a non-profit, possible amateur compared to the people at Adobe and Apple, and both Adobe and Apple together cannot come to a solution on how to use flash with the iphone. Thank God for 'thinking outside the box.'