SWFObject
File:Swfobject logo.gif | |
---|---|
Developer(s) | Geoff Stearns with Toby Boudreaux and Bobby van der Sluis |
Initial release | January 2006 |
Stable release | 2.2 / June 12, 2009 |
Written in | JavaScript |
Platform | Web browser |
Size | 10 KB (output JS file) |
Available in | English |
Development status | Stable |
Type | JavaScript library |
License | MIT License |
Website | http://code.google.com/p/swfobject/ |
SWFObject (originally FlashObject[1]) is an open-source JavaScript library used to embed Adobe Flash content onto Web pages, which is supplied as one small JavaScript file.[2] The library can also detect the installed Adobe Flash Player plug-in in all major web browsers, on all major operating systems (OS), and can redirect the visitor to another webpage or show alternate HTML content if the installed plug-in is not suitable.[3] The library is independent, although related external libraries often integrate with it, such as SWFAddress and SWFFit.
SWFObject is used by over 12% of the websites detected to be utilizing any form of JavaScript[4], amounting to thousands of modern websites such as Ask.com, Windows.com, Time.com, Skype.com, Discovery.com and YouTube.[5][6]
Embedding
SWFObject provides the most reliable method of embedding Flash content into a webpage[citation needed], by internally handling the various practices that one must follow in order for different web browsers to display Flash content correctly, and isolating them from the web designer. The developer may interface with the library in a standardized manner, the minimum being a single line of JavaScript code.[7] Therefore even inexperienced web designers without knowledge of the ideal HTML code to embed Flash content, can easily insert Flash content into web pages, and have them reliably work for the widest possible audience (excepting those with JavaScript disabled).[citation needed] Flash content inserted using SWFObject will also work on devices that support JavaScript execution (and Flash Player), such as the Wii, PlayStation 3 and Nokia N800, unlike the PlayStation Portable.[8]
Limitation
The biggest disadvantage of relying on SWFObject to embed Flash content without using any compatible HTML markup, is that visitors with JavaScript disabled in their web browsers will not be able to view the Flash content, and will instead see alternate HTML content provided by the web page. For websites that aim to reach the widest possible audience an alternate method is available, by using standards-compliant HTML markup to embed the Flash movie (typically using the <object> tags for the best browser compatibility[9]), and using the registerObject() function within the library's API[10] to register the Flash content enabling usage of the other features that the library provides.
Extras
SWFObject also includes a few utility functions within its API to retrieve Flash Player related information, such as checking whether a specific version of Flash Player is installed,[11] and a few DHTML utilities to help work with the DOM.[12] Because of this, the most common reasons Flash Website developers turn to external JavaScript frameworks such as jQuery or Prototype are satisfied internally, giving developers fewer reasons to add additional JavaScript libraries to their website.
The library can also be used to integrate Flash Player Express Install into the webpage, allowing users to install the latest Flash Player without leaving the site, although requiring an automatic browser restart.[13]
References
- ↑ Internet Web Technology Trends and Usage for FlashObject, BuiltWith
- ↑ Source Checkout, swfobject - Google Code, Page Header, overview of SWFObject
- ↑ SWFObject 1.5 Homepage, deconcept
- ↑ Internet JavaScript Technology Trends and Top Providers, BuiltWith
- ↑ Internet Web Technology Trends and Usage for SWFObject, BuiltWith
- ↑ Who uses SWFObject?, SWFObject FAQ
- ↑ Embedding Adobe Flash Player content using SWFObject 2 - Documentation - Google Code
- ↑ Do SWFs embedded with SWFObject 2 display in the Sony PS3 or Nintendo Wii web browsers?, SWFObject FAQ
- ↑ Bobby van der Sluis > Flash embed test suite, HTML embed element compatibility
- ↑ Function swfobject.registerObject, SWFObject JavaScript API documentation - Google Code
- ↑ Function swfobject.hasFlashPlayerVersion, SWFObject JavaScript API documentation - Google Code
- ↑ Function swfobject.add(Dom)LoadEvent, SWFObject JavaScript API documentation - Google Code
- ↑ SWFObject 2.2 - What's new?, Google Code
See also
- Adobe Flash, the design and development program in which Flash websites, animations and intros are created.
- Adobe Flash Player, and its file-format SWF
External links
- SWFObject 1.5
- SWFObject 1.5 Homepage, deconcept, overview and usage of an older version of SWFObject
- SWFObject 1.5 released, deconcept Blog
- SWFObject 2
- swfobject 2, Google Code, freely download SWFObject for usage on a website
- SWFObject 2 FAQ
- SWFObject Documentation, Google Code, the What, Why and How, of SWFObject 2
- General
- Methods of embedding Flash onto a webpage, internally used by SWFObject to maximize compatibility.
- Embed Multiple Web FLV Players in One Web page, using SWFObject or Flashvars code
- Flash Embedding Cage Match, A List Apart, compares the Flash embedding methods.
- swfobject.js vs Embed HTML, advantages of SWFObject over traditional HTML tags
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...