Best way to embed Flash for modern browsers using HTML5?

Is this such a common thing that I believe should be a “good” way to purely embed Flash in HTML5? I am interested in supporting the following browsers: FF3, FF4, IE7, IE8, IE9, Chrome and Safari.

I know that there are some Javascript solutions like SWFObject , but this seems like overkill. Isn't it just a clean, fast, and easy way to use HTML?

In addition: is there a lack of use <embed>? This was previously discounted by the W3C, but I understand that in HTML5. So why not just use it instead of faffing around with <object>?

+5
source share
2 answers

Tried jQuery Tools ?

Basically, all you have to do is:

<div id="clock"></div>

<script>
flashembed("clock", "/media/swf/global/clock.swf");
</script>

Working example:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>

<div id="clock"></div>

<script>
flashembed("clock", "http://jquerytools.org/media/swf/global/clock.swf");
</script>

It worked with jQuery 2.0.3, 1.10.2, 1.9.0.

+3
source

SWFObject was created to dynamically examine the various ways in which each browser interpreted an object tag. I do not know any real changes in this scenario, even with ie9, which still requires the user to activate the active-x object.

I still prefer SWFObject for its reliable and easy flash streaming:

var flashvars   = {
    filePath:   "somePath",
    verbose:    "true"
};

var params  = {
    quality:    "high",
    wmode:  "opaque",
    menu:   "false",
    base:   "/flash/home_page/"
};

var attributes  = {
    id:     "flashContent"
};


    swfobject.embedSWF(
        "../flash/home_page/home.swf",
        "flashContent",
        "570",
        "325",
        "10.0.0",
        "../frameworks/swfobject/expressInstall.swf",
        flashvars,
        params,
        attributes,
        outputStatus
        );

I agree, it would be “nice” if there was an “even more” easy alternative, but the convenience compensates for any additional loads, imo.

amuses

0
source

All Articles