Why does Kaltura use the Embed tag Instead of the Object Tag?

Printer-friendly version
Audience / Tech Expertise: 

Background

This document aims to outline common and rare situations where the use of the <object> or <embed> tags interrupt with various deployments, browsers or addons. The <object> tag offers significant advantages over the <embed> tag if you prefer to create standards-compliant code or accessible, search-engine–friendly content. [more]

Old browsers and the <embed> tag

Being the W3C recommendation, we should use the <object> tag for embedding browser plugins. Although web standards are created to avoid compatibility issues, the <embed> tag has become to "de facto" standard, that can't be ignored due to old browser versions that don't support the W3C <object> standard.

The various methods

Clean <object> tag based syntax

According to Drew McLellan, on A List Apart embedding article, one can merge attributes from both methods to create a leaner <object> syntax. Using the "The Satay Method" explained by Drew McLellan on the above article, the <object> based code is cleaner, leaner and validates as standard-compliant. However, even though the above method seems to work on most deployments, it seems that rare cases such as when the adblock firefox pluginis installed (or even when disabled?!) - <object> tag based syntax cause firefox not to render the flash movie.

Adobe’s Solution: The twice-cooked method

So to support the rare cases, the code should include the <embed> tag in addition to the <object> tag. As stated in Adobe tech note tn_4150:

Adobe tech note tn_4150

The <embed> tag is for Netscape Navigator 2.0 or later, or browsers that support the use of the Netscape-compatible plugin version of Flash Player.

The twice-cooked method will makes your web pages non-standard-compliant, and can’t include a mechanism for inserting alternative content (useful for search-engines and users that don't have flash installed).

The most compatible solution: Nested <object> tags + IE conditional comments

According to the browser's Flash embed test suite by Bobby van der Sluis, the most compatible syntax, as well as the most standard-compliant is using IE conditional comments and a nested object tag. In this method, one <object> tags is placed inside the other, thus requiring a double object definition (the outer object targeting Internet Explorer and the inner object targeting all other browsers), so you need to define your object attributes and nested param elements twice. This method, however being more complex, according to Bobby's Flash embed test suitehas proven support for all of deployments.

Media and RSS readers, Facebook, MySpace and other sites - FAQ

My media player doesn't show inside Google Reader

According to the Google Reader FAQ, Google Reader is only capable of recognizing the [html][/html] syntax. In that case, please make sure your RSS include the full [html][/html] code for the media player.

Facebook or MySpace throws exceptions when clicking on the logo or other buttons

Facebook and MySpace prevents direct script access from Flash by adding [html]allowScriptAccess=none[/html]. In order to perform javascript calls from Flash inside Facebook, use the following Facebook Fb:swf guide.

Summary

To get the most standard-compliant and cross-browser compatible solution, we recommend using SWFObject 2. SWFObject is using two methods; a static method using two nested <object> tags, and a javascript based method to dynamically embed flash movies. The [url=http://code.google.com/p/swfobject/wiki/generator]SWFObject Generator[/url] can be used to easily generate the right <object> syntax. The mentioned Adblock firefox plugin issue will not be solved by using SWFObject 2, due to Adblock's functionality of blocking the object tag. Since the development of Adblock was discontinued and Adblock is no longer offered for download- in the case of Adblock compatibility, one of the following are advised:[list][*] SWFObject 2 recommendation: Disable the Adblock extension or upgrade to Adblock Plus [*] Use the non-compliant method passing on alternative content: The twice-cooked method[/list] Adobe has recently decided to use SWFObject as the default template for the html wrappers created by Flash builder: "...The default template included with Flex SDK and Flash Builder embeds the SWFObject 2 functionality..."

FAQ Type: 
(42585 reads)