After looking into ways to call the YouTube mp4-file from within a Video for Everybody html-block (which is not possible, Google protects raw video-files using what seems to be a session-based hash that has to be provided in the URL), I decided to take another (dirty) approach; faking it!
The solution is entirely javascript-based and is as un-elegant as it is simple; create a html-file with a script include of http://futtta.be/newTube/newTube.js and a div with “id=newTube” containing a link to a YouTube-page and the script automagically takes care of the rest. Check out http://futtta.be/newTube/ to see it in action.
The result is an embedded YouTube player which will display the HTML5-version if you’re running a browser which supports mp4/h264 playback (i.e. a recent version of Chrome or Safari) and if you enrolled in the beta. If either of these preconditions aren’t met, you’ll just see the plain old Flash-player.
Don’t get your hopes up, in reality newTube is probably pretty useless (for reasons I’ll get into in a follow-up post, when I have some time to spare that is). You’ll have to wait for someone (YouTube, Dailymotion, Vimeo, … are you listening?) to offer real embeddable html5-video (with support for both mp4/h264 and and ogg/theora).
But I did have fun creating the very first html5-capable embedded YouTube-player
Some people seemed all too happy to dismiss my post as being plain old Flash-bashing. Sorry to disappoint you, but I”m not saying Flash is evil or that it will (or should) disappear altogether. Next correction: I do have Flash player installed and in general I do know if a application is made in Flash or not. Heck, the web has been my job for more than 10 years now and Flash has been a point of interest for quite some time already. And yes, there indeed are innovative web applications and games that are build in Flash. That being said, I do think (because of accessibility, SEO and some more philosophical reasons) it’s best to avoid using Flash to develop a site’s core functionality if the same can be achieved with non-propriety, standard web technology.
It’s not about Flash vs HTML5
The comments on last week’s blogpost seemed to focus very much on the individual merits (or lack thereof) of HTML5, CSS3 or Canvas, as if these are islands with no history and no connections to the web mainland. This is, off course, wrong; these “new” technologies just happen to be the most recent evolutions of the core components of the rapidly evolving ecosystem that is the “open web”. Moreover, with HTML, CSS and Javascript being the brick and mortar, libraries such as JQuery, Dojo and YUI are the “prefab” building blocks of open web development, offering plug&play components to efficiently build cross-browser rich web interfaces. So the discussion is not about Flash vs HTML5, but about the choice between Flash and the powerful “open web technology stack”.
about:evolution
“The only constant is change” and that’s all the more valid on the web. Flash has an important role to play in this respect, having pushed the boundaries of web-based UI’s for many years. But as some of the cutting-edge features that once were only available in Flash, can now be created more efficiently using non-propriety technology, there’s a shift towards the use of those open web components (e.g. the Flash carousel on National Geographic website that was shown in the Adobe video from my previous post has been replaced by a JQuery implementation).
I believe (and that’s what the previous post was about) this trend will continue in 2010 because of features of HTML5, CSS3, canvas, … becoming available to a wider audience either natively (in new browsers) or through libraries that provide cross-browser compatible implementations. And yes, I’m afraid that in my book that means Flash will become less relevant (“irrelevant” in my previous post being an obvious hyperbole).
Despite great efforts by Adobe, Flash on the mobile web (i.e. in a browser, non-browser implementations are irrelevant in the discussion about “open web vs flash”) remains almost non-existent. The fact that Apple continues to refuse Flash for the iPhone only makes this worse, due to the seemingly untouchable “game-changer” status of their phone and due to the fact that more than 60% of all mobile pageviews originate from their mobile devices.
To sum it all up: when Adobe Flash evangelist Serge writes “Flash Player has it’s place on the web today and in the future” I can only agree. But I’ll bet you that place in the future will be less prominent than the one it holds today.
My 2nd prediction for 2010 (the first one being ‘offline is the new online‘): the glory days of Flash are over. The reason for this is twofold; the mobile web and the strong advances “open web” technology is making.
Open web moving in, fast
Remember the days when everybody wanted to spice up otherwise dull websites with “a flash splash page” and “flash menu’s”? Now menu’s are built in accessible, SEO-friendly HTML once again, using CSS to add style and even behavior, adding some Javascript if magic dust is required . And splash pages, well, those were pretty useless to begin with. Adobe Flash’s stronghold now is video playback and animation, but they’re bound to eventually lose that battle as well.
HTML5’s canvas (cross-browser javascript-able 2D bitmap-based graphics) is gaining a lot of momentum. Check out the applications and games on http://www.canvasdemos.com/ to see just how much can be accomplished now, in today’s browsers (really, go check out those demo’s, some are mind-boggling)
Adobe’s answer; mobile banners & deploy to Appstore
So with a Flash-less mobile web and with strong browser-native competition for both multimedia and graphics on the “normal” web, how does Adobe see it’s future? Well, they plan to roll out “iPhone packager for Flash” in CS5, allowing any Flash developer to publish to the AppStore, but there’s still no news about in-browser Flash on the iPhone.
For non-Apple devices, Adobe is boasting a preview version of Flash 10.1 in a mobile browser (the Android 2.0 browser on Google Nexus One in this case) with this promo video;
I don’t know about you, but somehow a sub-par game, web video and banners don’t convince that Flash has a bright future ahead. Not on mobile and maybe even not on the open web as it’s shaping up to be.
But maybe you think Flash will remain in the spotlights despite all of this? Why? Let us know in the comments!
That’s the bad news, but let me share some good news with you as well; you can do cross-browser persistent data storage right here, right now! All you need to build a html5 webdb-alternative is old-fashioned javascript arrays and objects and related functions, some json and last but not least Paul Duncan’s persistjs (don’t download it there though, use the more recent version in the repository instead), a little javascript library that goes a long way to provide precious cross-browser persistent storage.
Simplified, your offline-enabled webapp would have to;
store data in an array (or in objects in an array)
do CRUD using your standard javascript functions (you could turn to something like jlinq to do more advanced things)
use JSON.stringify (native or from json2.js) to turn the ‘repository’ into a string
store the resulting JSON-string with persistjs’s store.set
close tab or browser
retrieve JSON-string when user returns with store.get
So there you have it, basic cross-browser (*) persistent data storage without html5 webdb. Just sprinkle some appcache-magic (adding Google Gears LocalServer-support is trivial) on top to store html, js, css, … in your browser and you have a fully offline-enabled webapp.
(*) tested successfully in Firefox 3.6b5, Safari 4.0.3, Chrome 3.0.195.38, IE8 and MSIE6 (with and without Gears), IE7, the Android 1.5 browser on my HTC Hero and in iPhone’s Mobile Safari. I’ve got some weird bug in Opera 10.10 that I can’t seem to iron out though, but feel free to tell me what stupid mistake I made.
The fundamental problem on the iPhone is not Apple’s App Store approval policies, but the iPhone developers’ arrogant disdain for Web technologies.
[...]
After ten years I am fucking tired of the “Web development is not real programming” bullshit that the arrogant bastards in “real programming” are spouting because they’re too frightened to learn something new. Fuck those condescending, ignorant, self-important, stupid, blind, fearful pricks. Fuck them real hard. Where it hurts.
And fucking them real hard where it hurts is exactly what Apple is doing right now.
That’s why I changed my mind. That’s why I’m cheering Apple on. I hope the App Store approval process sticks around for a loooooooong time.
HTML5’s WebDB is one of the building blocks to create offline-enabled webapps. It allows web applications to store data in a local database and it is as such an important part in Google’s push for mobile webapps as an alternative for native mobile apps. The spec (although not finalized) is already implemented in Safari, Safari Mobile and in the Android 2.0 browser.
At opera, we implemented web db [...] it’s likely we will [ship it] as people have built on it
and Google’s Ian Fette joined in:
We’ve implemented WebDB … we’re about to ship it
So that’s great news, no? We can expect WebDB to arrive in Chrome and Opera! OK, so what about Firefox and MSIE? Microsoft, represented by Adrian Bateman, stated:
We don’t think we’ll reasonably be able to ship an interoperable version of WebDB
Well, that doesn’t really come as a surprise does it? No WebDB in MSIE, but surely Mozilla will support this great spec? But Jonas Sicking’s point of view might be slightly shocking to some:
We’ve talked to a lot of developers, the feedback we got is that we really don’t want SQL [...] I don’t think mozilla plans to ship it.
Sorry, come again? Does that mean that Firefox will never support window.openDatabase()? Nope, they probably won’t and they provide some valid concerns (see also Vladimir Vukićević’s blogpost) in a mailinglist-discussion between Mozilla and Apple-engineers shortly after the meeting minutes were published. Summarized and simplified their objections boil down to two issues;
in order to have a webdb standard, you also have to specify (and standardize) the SQL-language to query that database, the question is what SQL-dialect to standardize on.
as the current implementations are all SQLite-based (including Google’s and Opera’s), the spec would have to describe the very specific SQL-dialect that SQLite uses (and maybe even of a specific version of SQLite)
Although I doubt that web-developers don’t want to do client-side SQL at all, writing a spec that almost mandates the use of a specific version of a specific product (even if it’s open source) can indeed be hardly considered the goal of w3.org’s standards creation process.
So back to the drawing-board for yet another spec? Based on the webapp group’s meeting minutes, Web SimpleDB (or “Nikunj”, after the name of the Oracle-engineer behind the idea) is considered a worthy alternative by at least Mozilla, Opera and Microsoft. Let’s hope that a consensus, a finalized spec (it’s in draft now) and the first usable cross-browser implementations will arrive soon.
Af en toe loopt het mis in “the cloud” en dan durven nochtans doorwinterde digitale nomaden al eens klagen over de onbeschikbaarheidvan hun online tools, terwijl eeuwige web2.0-twijfelaars hun grote gelijk -dan toch tijdelijk- bewezen zien.
Misschien moeten die mannen en vrouwen toch eens kijken naar de offline-ondersteuning die bv. Gmail, Google Reader, Google Docs, Google Calender, Zoho, Mindmeister en Remember the Milk bieden? En misschien moeten de webbouwers onder hen hun klanten die mogelijkheden ook beginnen verkopen? Want ik voorspel: 2010 wordt het jaar van offline-enabled webapps, mobiel maar even goed in de desktop-browser!