An open source Javascript framework for detecting the Adobe Flash Player plugin and embedding Flash (swf) files.

Overview

— IMPORTANT UPDATE —

SWFObject is no longer in active development. Flash Player is on the decline, and the authors of SWFObject have moved on to other projects. This project is being left on GitHub for historical purposes.

SWFObject

SWFObject is a free, open-source tool for embedding swf content in websites.

This GitHub edition of SWFObject is our 2.3 beta. The current release – 2.2 – is still available for download at code.google.com/p/swfobject/

CHANGES

SWFObject 2.3 introduces many small changes under the hood (almost exclusively aimed at fixing bugs), but the public API is mostly unchanged and completely backwards compatible with SWFObject 2.2. The only two significant changes to the API:

  1. You may now pass an element as an argument in embedSWF (in place of an ID)

  2. You may now use integers in place of number strings in embedSWF (e.g. 9 instead of “9”).

Example:

OLD:

swfobject.embedSWF("myContent.swf", "my-target-element", "300", "120", "10.0.0");

NEW:

var el = document.getElementById("my-target-element");
swfobject.embedSWF("myContent.swf", el, 300, 120, 10);

Another significant change: SWFObject's approach to dynamic embedding in Internet Explorer has been updated to use a more W3C-friendly way of creating the <object>. Because this is Internet Explorer, a few hacks were required, but the end result is code generated by W3C techniques (document.createElement). This means, among other things, that nodes generated for XHTML documents should properly self close:

OLD:

<object><param></object>

NEW:

<object><param /></object>

Similarly, since the <param> elements are all generated using the same W3C techniques, encoding flashvars should be less troublesome. Developers will no longer need to create separate flashvars encoding workflows for IE and non-IE browsers.

Comments
  • Apache Flex Installer link broken.

    Apache Flex Installer link broken.

    Just a heads up, the Apache Flex installer (4.13.0) fails with the following error:

    Downloading 2.2.zip from: https://github.com/swfobject/swfobject/archive [get] [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032" errorID=2032]

    opened by schwack 18
  • Flash embedded with SWFObject can't be run if plugin is not always enabled

    Flash embedded with SWFObject can't be run if plugin is not always enabled

    If on plugin page in Chromium browser I do not set checkbox "Always Allowed" on Flash plugin I could manually activate flash content on sites which embed swf directly. But if they use SWFObject I always see "Alternative content" as per you test page.

    It is because nav.plugins does not have SHOCKWAVE_FLASH item.

    There should be possibility to check "possibility to enable" and ask user to do so as it happened in direct method.

    opened by Hubbitus 13
  • Broken in IE 11

    Broken in IE 11

    See list of changes for IE 11:

    http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx

    1. Do not use navigator.appName as IE 11 now reports "netscape"
    2. Mutation Events are no longer supported.
    3. attachEvent has been removed for IE 11
    opened by danransom 12
  • Please make a Git tag

    Please make a Git tag

    Hi,

    Thanks for creating swfobject, it's a really great project. I use swfobject as a Bower component, but currently I need to reference the version as *. For example:

    {
      "name": "my-project",
      "version": "0.0.0",
      "dependencies": {
        "jquery": "~1.9.0",
        "requirejs": "~2.1.8",
        "swfobject": "*"
      }
    }
    
    

    It would significantly improve developer confidence and avoid dependency versioning issues in my project if I could reference a specific version of swfobject. In case you haven't tagged a release with Git before, it's as easy as:

    git tag 2.3.0   # Or whatever the version is
    git push origin --tags
    

    ...And then the tag will show up under Releases. This isn't the type of thing I can make a Pull Request for, unfortunately.

    For reference, Bower uses Git tags as the mechanism by which to define versions. Without at least one tag pushed, all users of swfobject via Bower will be running HEAD.

    opened by jeremyckahn 11
  • ExternalInterface calls fail when using dyanmic embed on IE5.5

    ExternalInterface calls fail when using dyanmic embed on IE5.5

    Not terribly much to describe here: In IE5.5, calling a function exposed by ExternalInterface (when using dynamic embedding) throws a JavaScript error (Object Doesn't Support This Property or Method).

    This bug is present in v. 2.2, as well as the 2.3 test suite. It only appears to affect IE5.5 -- IE6 and above work fine. The test suite demonstrates this problem nicely: http://testsuite.learnswfobject.com/2.3/usage-examples/40-swfobject.embedSWF-(External-Interface).php?doctype=html4#

    I have no clue if we want to continue supporting this ancient browser, but we should probably document this minor shortcoming somewhere.

    opened by schmod 9
  • Invalid argument on line 661 in IE

    Invalid argument on line 661 in IE

    I get "Invalid argument" error, which occurs on line 661, character 5 in IE9. When switching browser mode, the same error occurs, so I believe it's consistent across IE. The problematic block is this one (the logging is mine):

    if (ua.ie) {
        if (dynamicStylesheet && typeof dynamicStylesheet.addRule != UNDEF) {
            dynamicStylesheet.addRule(sel, decl);
            console.log(sel); // prints "#[object HTMLDivElement]"
            console.log(decl); // prints "visibility: hidden"
        }
    }
    

    Possibly related: the elements I'm targeting have no id, so I'm passing the elements themselves, which I know is possible with SWFObject 2.3 (the reason I went with 2.3).

    opened by Cinamonas 7
  • adding flash video to webpage through SWFobject not playing in browser

    adding flash video to webpage through SWFobject not playing in browser

    Hi community! I'm new to coding and trying to practice this piece of code but when I launch the code I only get the player and when I press the play button nothing appears. I've been at this for 3 days now and I am unsure what needs to be corrected. I'm studying html&css design and build websites by Jon Duckett and even he told me what needed to be corrected but the code isn't producing the same results as his code. If anyone can point out a solution that would be so helpful. the sample piece can be downloaded here http://www.htmlandcssbook.com/code-samples/ Its chapter 9 adding a flash video. If you need anything from me such as my piece of code I can post that as well.

    opened by billee06 4
  • Proposal for a new API.

    Proposal for a new API.

    The current API for embedding SWF is not easy to use. Some parameters are optional, others are not. Without a good IDE it's difficult to keep track how many null arguments must be passed before one reaches the position in the argument list for parameters.

    Thus I'm proposing to implement a new API for SWF embedding by utilizing the builder pattern to describe optional arguments and kicking off the actual embedding.

    Old:

    embedSWF('myContent', document.getElementById("my-target-element"), 
             '480px', '320px', '9.0.0', null, null, {AllowNetworking: 'none'});
    

    New:

    swfobject.embed('myContent.swf', "480px", "320px", '9.0.0')
             .parameters({AllowNetworking: 'none'})
             .into(document.getElementById("my-target-element"));
    

    Maybe the necessary arguments can also passed through the builder pattern but I guess it would be to noisy to specify height and width this way.

    What do you think?

    opened by eisenlaub 4
  • SwfObject 2.2 Hang in WebKit

    SwfObject 2.2 Hang in WebKit

    Apologies if this is the wrong place for this post - just looking for some help.

    We are building a Spotify Ad in the spotify client (web kit browser within Spotify Desktop Client). When using SwfObject 2.2 and Flash 11+ we see a white box and no flash is loaded.

    If we use an earlier version of Flash (eg. 10.2), it runs fine.

    Also if we run in a regular browser with the same set up everything works.

    Could anybody point me in the right direction for pinpointing the issue - does the white box give us any clues??

    Thanks in advance.

    opened by unkemptrich 4
  • Get error from player

    Get error from player

    Hello, I play my streaming use this, but i got some error like "Error Error#2154" etc. Can i get the error status with my js file which create this swfobject ?

    opened by Jehanramadhan 3
  • Add a LICENSE file

    Add a LICENSE file

    To allow the users to correctly include SWFObject according to the MIT license, you should include a LICENSE file containing the license text and especially fill in the <year> and <copyright holders> placeholders! Else it is not possible to fulfill the "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." part of the license.

    I already looked up the <year>, but I can't fill out the <copright holders>:

    The MIT License (MIT)
    
    Copyright (c) 2007-2015 <copyright holders>
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.
    
    opened by j-ulrich 3
Owner
null
meetapp Free Adobe Connect Alternatives

meetapp meetapp is free adobe connect alternatives for visual classrooms , online meetings, screen share, webinars , video and audio conferencing. Fea

null 38 Oct 12, 2022
Music-Player - Music player application built with HTML, CSS and vanilla JavaScript

Music-Player Music player application built with HTML, CSS and vanilla JavaScrip

Karthik Umashankar 1 Feb 10, 2022
SRS Player is a video streaming player, supports HLS/HTTP-FLV/WebRTC etc.

WordPress-Plugin-SrsPlayer SRS Player is a video streaming player, supports HLS/HTTP-FLV/WebRTC etc. Usage First, you should get your own video stream

ossrs 3 Jul 27, 2022
SRS Player is a video streaming player, supports HLS/HTTP-FLV/WebRTC etc.

SRS Player is a video streaming player, supports HLS/HTTP-FLV/WebRTC etc.

ossrs 12 Oct 15, 2022
An online stem player. Inspired by but not affiliated with YEEZY TECH X KANO Stem Player.

Stem Player Online An online stem player. Inspired by but not affiliated with YEEZY TECH X KANO Stem Player. https://stemplayeronline.com See the proj

Luke Weiler 23 Nov 13, 2022
A Javascript library for working with Audio. It provides a consistent API for loading and playing audio on different browsers and devices. Currently supports WebAudio, HTML5 Audio, Cordova / PhoneGap, and a Flash fallback.

SoundJS SoundJS is a library to make working with audio on the web easier. It provides a consistent API for playing audio in different browsers, inclu

CreateJS 4.3k Dec 31, 2022
AmplitudeJS: Open Source HTML5 Web Audio Library. Design your web audio player, the way you want. No dependencies required.

Documentation • Examples • Tutorials • Support Us • Get Professional Help AmplitudeJS is a lightweight JavaScript library that allows you to control t

Server Side Up 3.9k Jan 2, 2023
The #1 cross-platform open source music player

Rhyme The #1 Open-Source Music Player Discord: Matrix: A beautiful looking music player which supports Local music files Create custom playlists view

Rhyme Music Player 51 Apr 13, 2022
This is a simple web based media player for playing video and audio. Build with pure HTML, CSS and Javascript. No framework or library included.

Aim-Player This is a simple web based media player for playing video and audio. Build with pure HTML, CSS and Javascript. No framework or library incl

Aim Mikel 2 Jun 27, 2021
LazyLoad Embed YouTube Player - simple and lightweight plugin - pure JavaScript

Youtube LazyLoad LazyLoad Embed Youtube Player - simple and lightweight plugin - pure JavaScript Status View Preview Table of contents Status Quick St

The MUDA Organization 25 Nov 29, 2022
LazyLoad Embed Vimeo Player - simple and lightweight plugin - pure JavaScript

Vimeo LazyLoad LazyLoad Embed Vimeo Player - simple and lightweight plugin - pure JavaScript Status View Preview Table of contents Status Quick Start

The MUDA Organization 23 Nov 3, 2022
a video player framework aims to bring wonderful experience on browser

Chimee English | 中文 Introduction Chimee is a web video player created by the Qiwoo Team. It's based on the web video element. It supports multiple med

ChimeeJS 2.4k Dec 22, 2022
MusicPlayer-Javascript - How to create a custom music player with vanilla javascript

MusicPlayer-Javascript How to create a custom music player with vanilla javascri

Tarokh Mohammadi 1 Feb 8, 2022
HTML5

One file. Any browser. Same UI. Author: John Dyer http://j.hn/ Website: http://mediaelementjs.com/ License: MIT Meaning: Use everywhere, keep copyrigh

MediaElement.js 8k Dec 27, 2022
HTML5

One file. Any browser. Same UI. Author: John Dyer http://j.hn/ Website: http://mediaelementjs.com/ License: MIT Meaning: Use everywhere, keep copyrigh

MediaElement.js 8k Jan 8, 2023
Rule YouTube, Soundcloud and Vimeo player with one API

Polyplayer Polyplayer allows you to rule YouTube's, Soundcloud's and Vimeo's player using one API. Features Playing, pausing, stopping Seek to absolut

Marius 41 Sep 24, 2022
A simple HTML5, YouTube and Vimeo player

Plyr is a simple, lightweight, accessible and customizable HTML5, YouTube and Vimeo media player that supports modern browsers. Checkout the demo - Do

Sam Potts 23.1k Jan 3, 2023
Web Application that represents a music player using the spotify API, React, JS, CSS, HTML, nodeJS, Firebase, material-ui, JSON and other technologies. Made by Yohan Hmaiti

Web Application that represents a music player using the spotify API, React, JS, CSS, HTML, nodeJS, Firebase, material-ui, JSON and other technologies. Made by Yohan Hmaiti

Yohan Hmaiti 2 Jan 8, 2022
Music player made with React and Redux 🚀

Spotipy A modern Web-Based music player made using ReactJS Deployment Spotipy is deployed at Vercel and can be accessed by clicking here Features Clea

Jessej Samuel 35 Jan 3, 2023