Bobby van der Sluis FITC Amsterdam, 26th February 2008

0 downloads 185 Views 4MB Size Report
Feb 26, 2008 - Geoff Stearns. SWFObject. Bobby van der Sluis. Unobtrusive Flash Objects (UFO). Michael Williams. Adobe F
Bobby van der Sluis FITC Amsterdam, 26th February 2008

Many Flash embed methods • Twice cooked • Embed only

• Adobe Flash Player Detection Kit

• Flash Satay

• SWFObject

• Nested objects (Hixie)

• Unobtrusive Flash Objects (UFO) • ObjectSwap • Many, many other scripts...

Some methods are on the road to nowhere; none of them are optimal

The

project

Geoff Stearns SWFObject Bobby van der Sluis Unobtrusive Flash Objects (UFO) Michael Williams Adobe Flash Player Detection Kit

8 key questions 1. How to embed cross-browser? 2. How to comply with web standards? 3. What if no Flash plug-in is available? 4. How to deal with an outdated Flash plug-in? 5. Where to download the latest Flash plug-in? 6. How to help search engines? 7. How to avoid mechanisms that hurt the user experience? 8. How to do all of this in the easiest way possible?

8 key questions 1. How to embed cross-browser? 2. How to comply with web standards? 3. What if no Flash plug-in is available? 4. How to deal with an outdated Flash plug-in? 5. Where to download the latest Flash plug-in? 6. How to help search engines? 7. How to avoid mechanisms that hurt the user experience? 8. How to do all of this in the easiest way possible?

Cross-browser anno 1998

Netscape’s

• Is patented and therefore not a web standard • Invalid HTML • Doesn’t support alternative content

Alternative content

Content that is accessible to people who browse the web without plugins

Internet Explorer’s

Alternative content



• Is a W3C Recommendation • Supports alternative content • Is a platform specific implementation

Twice cooked

• Locked into vendor specific code • No alternative content possible • This is still the default publishing method of the Flash IDE today

Web standards offer a universal language to a whole ecosystem of browser makers, tool builders, and web authors, so that all of these audiences can avoid compatibility problems, vendor lock-ins, and patent-infringement issues.

Cross-browser today All modern web browsers support a platform independent implementation of

Alternative content



Except Microsoft Internet Explorer

Alternative content



Nested objects

Alternative content



Nested objects - take 2

Alternative content



Why nested objects is better than twice cooked • It breaks the cycle of vendor lock-in • Valid HTML • The opportunity to use alternative content

Markup vs scripting

• Around 98% of the people has Flash Player 8 • Around 5% has no JavaScript support • Around 1% has poor JavaScript support

8 key questions 1. How to embed cross-browser? 2. How to comply with web standards? 3. What if no Flash plug-in is available? 4. How to deal with an outdated Flash plug-in? 5. Where to download the latest Flash plug-in? 6. How to help search engines? 7. How to avoid mechanisms that hurt the user experience? 8. How to do all of this in the easiest way possible?

The Flash Player will attempt to play Flash content, no matter what Flash plugin version that content was published for

Flash Player version detection Use JavaScript to: • Detect the Flash Player version • Determine whether Flash content or alternative content needs to be shown • Trigger Adobe Express Install (optional)

Adobe Express Install

The old way of downloading

The old way of downloading

The old way of downloading

The old way of downloading

The modern way of downloading • Use alternative content • Use Adobe Express Install (optional) • Rely on browser built-in mechanisms (based on MIME type invocation)

8 key questions 1. How to embed cross-browser? 2. How to comply with web standards? 3. What if no Flash plug-in is available? 4. How to deal with an outdated Flash plug-in? 5. Where to download the latest Flash plug-in? 6. How to help search engines? 7. How to avoid mechanisms that hurt the user experience? 8. How to do all of this in the easiest way possible?

Doesn’t Google index Flash content?

Search engines and Flash content • Not all search engines index Flash content • Search engines are far more optimized to index HTML pages than Flash content • Flash indexing itself is limited: merely flat content in a specific order; it lacks the hierarchical structure and the semantics of HTML

Strategies to help search engines

1. Use alternative content 2. Use Sitemaps and robots.txt

8 key questions 1. How to embed cross-browser? 2. How to comply with web standards? 3. What if no Flash plug-in is available? 4. How to deal with an outdated Flash plug-in? 5. Where to download the latest Flash plug-in? 6. How to help search engines? 7. How to avoid mechanisms that hurt the user experience? 8. How to do all of this in the easiest way possible?

Active content

• Eolas - Microsoft patent dispute • A user-unfriendly workaround by Microsoft and Opera to avoid claims • Affects Internet Explorer 6+ and Opera 9+

Click-to-activate mechanism

Avoiding active content

Publish your Flash content with JavaScript

No more active content? • Microsoft has settled with Eolas • 2008 onwards: click-to-activate mechanism is removed from Internet Explorer via update • Opera to follow? • Apple and Opera to be sued next?

8 key questions 1. How to embed cross-browser? 2. How to comply with web standards? 3. What if no Flash plug-in is available? 4. How to deal with an outdated Flash plug-in? 5. Where to download the latest Flash plug-in? 6. How to help search engines? 7. How to avoid mechanisms that hurt the user experience? 8. How to do all of this in the easiest way possible?

SWFObject 2.0 • Static publishing method • Dynamic publishing method • JavaScript API • Only utilizes 1 JavaScript file (9.2 Kb)

Static publishing method Embed Flash content and alternative content using standards compliant markup, and use unobtrusive JavaScript to resolve the issues that markup alone cannot solve

Static publishing - step 1

Alternative content



Static publishing - step 2

Static publishing - step 3

Dynamic publishing method

Create alternative content using standards compliant markup and embed Flash content with unobtrusive JavaScript

Dynamic publishing - step 1

Alternative content



Dynamic publishing - step 2

Dynamic publishing - step 3

JavaScript API • •

swfobject.registerObject(...) swfobject.embedSWF(...)

• • • • • • • •

swfobject.getObjectById(...) swfobject.getFlashPlayerVersion() swfobject.hasFlashPlayerVersion(...) swfobject.addLoadEvent(...) swfobject.addDomLoadEvent(...) swfobject.createSWF(...) swfobject.createCSS(...) swfobject.getQueryParamValue(...)

SWFObject 2.0 and browser integration • As usual, e.g.: - Adobe External Interface - SWFAddress 2.0 - AS3.0 MouseWheel on Mac OSX • One catch with static publishing: Use swfobject.getObjectById("myId") to retrieve the active

SWFObject 2.0 and accessibility • Create Flash content (for visitors with the right plug-in/JavaScript support) • Create alternative HTML content (for visitors that don’t have the right support) • Make your Flash content accessible • Make your HTML content accessible

Links This presentation will soon be posted at: http://www.bobbyvandersluis.com SWFObject 2.0: http://code.google.com/p/swfobject/ SWFFix/SWFObject 2.0 dev blog: http://www.swffix.org Flash embedding cage match: http://www.alistapart.com/articles/flashembedcagematch/ Flash Player embed test suite: http://www.swffix.org/testsuite/