Bringing Flash to the iPhone?
What is a realistic approach for bringing Flash to the iPhone? 2008-09-30
So Adobe has decided to publicly talk about (again?) the news that they are working on a flash port to the iphone. While this is a great idea, I definitely would agree with Steve that it won't run very well on the ARM processor. But lets pretend we're Adobe, and look at what's involved with making flash work on the iPhone.
The Pros:
Its only one phone.
Compared to writing Flash for a pc, Adobe only needs to concern themselves with one system. This means they can perform optimizations that would probably cause them compatibility issues otherwise.
Video Support is ARM-Friendly
When Macromedia/Adobe chose On2's video tech, one of their considerations was portability.This means that we can assume quality video playback support, which should give most people warm fuzzies.
The processor isn't slow
Looking at the specs of the iphone shows that its no slowpoke. Let's assume 400mhz. What can we do with 400Mhz on a very specific platform? A lot!
Flash only draws what it needs
Let's also look at this in the context of 'screen real estate'. The iPhone has a 480x320 pixel screen. Say you're viewing a flash movie on a web page. How much of the web page is going to be this movie? Let's assume that the flash is 25% of the screen. That's 120x80. Flash is optimized for drawing only what is necessary, and in most flash movies, this is the most cpu-intensive activity.
So as a user resizes the screen, the flash will only need to draw whatever is necessary to fill the screen. If Safari for iPhone can report to the Flash Player the actual screen size, then the Flash Player can only draw what is needed, and sip the CPU as daintily as it can.
What happens when the flash player fills the screen? Good question. I'll assume that the Flash Player will be an openGL accelerated surface within Safari. And this surface will be layered within Safari. Generally speaking, this is a sub-optimal way to use opengl. What you really want is to have Flash be unfettered with other views being composited on it. This is similar to having a wmode of 'window' on a pc. The flash does its thing, and the browser is almost completely out of the picture. This would be a tough trick to do, but if you could somehow transition out of Safari, and into 'just' flash, then you could get the power where you need it most.
And the Cons
But daintily sipping CPUs is not what the Flash Player is known for. In fact it can easily bring a computer to its knees if used wrongly. What are the major hurdles to overcome?
The Great Unknown
With a web page, browsers have their hands full. There is limitless possibilities in a web page. With flash, there are limitless possibilities, but these also need to be displayed 30 times a second. Regardless of how awesome the developers at Adobe are, they are not going to be able to make everything work at an acceptable speed. What about maybe only displaying every 30th frame? Nope, it can't work that way.
Perhaps Safari will by default display a flash image, requiring activation before display. This is a pretty safe bet, as I'm sure Apple doesn't want Safari to be perceived as slow.
RAM
The Flash Player uses a lot of ram. A LOT. The iPhone has 128MB of ram. And most of that will not be made available to Flash. If there is one place that Adobe developers will lose sleep and hair, it will be attempting to get Flash to work with practically no RAM. This seems to me the biggest hurdle, but I'm very interested to hear if anyone else has other ideas.
It seems almost impossible for Flash to be able to operate on such a small footprint. The flash player will be writing memory to the drive faster than it can allocate it. Features such as BitmapData are so memory intensive that they could possibly be cut.
So which version?
With such rigid requirements, how possible is it that we can see a fully compatible release that mirrors a version on the pc? One that would get Big Steve's signoff?
- Flash 7 - If the Wii can do it, so can the iPhone :)
- Flash 8 - A possibility, but the BitmapData object makes things a bit hairy.
- Flash 9 - BitmapData, and supporting TWO virtual machines (for backwards compatibility). Not likely.
- Flash 10 - I've got an app idea for the iphone called Snowballs in Hell.
No, I'd bet money that if flash came to the iPhone, it would not be any existing release. This sounds crazy, I know, because the point of flash is that it works so consistently across platforms. As the mobile market becomes increasingly relevant Adobe needs to be more of a player.
And Flash Lite hasn't really taken off as it should. Flash Lite is also specific to mobile, with the expectation that mobile would be 'its own thing'. But what's happened is that the 'normal' web is being put on phones, and so Flash Lite isn't an ideal candidate. Unless you're *screaming* for MIDI support.
Instead it would be a new version that would have a sub-set of features. The important bits for video playback, but perhaps not everything you would expect. There would be no need for re-compilation of swfs. It would throw an exception if users used any part of the API that did not exist. Most swfs would load and it would be immediately obvious if they used any 'hardcore' features that didn't make the cut. Let's call it 'Flash 9.5'.
Regardless, we're at the mercy of two pretty secretive companies. We'll just have to wait and see.
|