<object height="25" width="75" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" name="movie"/>
<param value="high" name="quality"/>
<param value="#FFFFFF" name="bgcolor"/>
<param value="opaque" name="wmode"/>
<embed height="25" width="75" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF" quality="high" src="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK"/>
</object>
I am having to insert this legacy markup into a new site that I'm building. Problem is its using an <embed> tag.
Would I just do away with the <embed> and put some content in as an alternative, for those that do not have flash? Basically I'm just trying to bring this piece of html into the 21st century.
You can nest object elements to display alternatives. The W3C explains it here. I copied a snippet below:
One significant consequence of the OBJECT element's design is that it offers a mechanism for specifying alternate object renderings; each embedded OBJECT declaration may specify alternate content types. If a user agent cannot render the outermost OBJECT, it tries to render the contents, which may be another OBJECT element, etc.
In the following example, we embed several OBJECT declarations to illustrate how alternate renderings work. A user agent will attempt to render the first OBJECT element it can, in the following order: (1) an Earth applet written in the Python language, (2) an MPEG animation of the Earth, (3) a GIF image of the Earth, (4) alternate text.
<P> <!-- First, try the Python applet -->
<OBJECT title="The Earth as seen from space"
classid="http://www.observer.mars/TheEarth.py">
<!-- Else, try the MPEG video -->
<OBJECT data="TheEarth.mpeg" type="application/mpeg">
<!-- Else, try the GIF image -->
<OBJECT data="TheEarth.gif" type="image/gif">
<!-- Else render the text -->
The <STRONG>Earth</STRONG> as seen from space.
</OBJECT>
</OBJECT>
</OBJECT>
I recommend that you use swfobject which is a cross platform, open source library to display flash on your pages.
http://code.google.com/p/swfobject/
There are a variety of ways to load the flash and the alternative (non-flash) content. For example the following code could replace your code:
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK",
"myContent", "25", "75", "9.0.0");
</script>
<div id="myContent">
<p>Alternative content</p>
</div>
Basically, you should keep embed, because it is a fallback for some old browsers. It might hurt validation of page, but as long as you know why it is there, it is OK.
At least that's the way Adobe officially recommends: Macromedia Flash OBJECT and EMBED tag syntax
You are right to want to do code for XXIth century, but we have to deal with browser from previous millennium... :-)
I use function AC_FL_RunContent for embedding flash objects - it's good because it supports all browsers and is recommended by Adobe.
More is here:
They also suggest using <object> tag instead of <embed>
I found this code on the web (from a usability site) which caters for IE and others, and I use it on my flash pages (I've changed it to your code):
<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" width="75" height="25">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="75" height="25">
<param name="movie" value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" />
<!--><!--dgx-->
<param name="loop" value="false">
<param name="menu" value="false">
<param name="quality" value="high">
</object>
<!-- <![endif]-->
Related
This is from the Pandora One Source Code Lines 2918-2924
(view-source:http://www.pandora.com/) on Google Chrome
<script id="audioQualityUpsaleTmpl" type="text/x-jquery-tmpl">
<div class="upsale_container clearfix">
<h2>Enjoy Higher Quality Audio</h2>
<p>When Listening on the web, experience music at 192K bits per second. <br/>More bits means
better sounding Audio.
</p>
<div id="audioSample">
<object width="236" height="35">
<param value="high" name="quality">
<param value="transparent" name="wmode">
<param value="always" name="allowScriptAccess">
<param value="/static/pandora_one/flash/pandoraone_sampler.swf" name="movie">
<embed width="236" height="35" allowscriptaccess="always" wmode="transparent"
src="/static/pandora_one/flash/pandoraone_sampler.swf">
</object>
</div>
{{tmpl "#upgradeForUpsaleTmpl"}}
</div>
</script>
Can someone please explain to me what this section of code is designed to do?
Thank you
It appears to be a template for a javascript templating engine (it seems to be jquery based, however I'm not familar with it). You can tell this from the type="text/x-jquery-tmpl" tag.
Templates are often defined within script tags like this (with a type tag that is not javascript declared) because they are not rendered by the browser on page load, however are not executed as javascript. This allows the text to be selected client side, via something like $('#my-template'), and used as a template.
i ran into some IE8 issue and I am not yet familiar with the problem.
The video does not play using I8 and versions below. My target is only IE8. But I don't know how to implement it and am not also familiar in adobe flash.
Question: Can I solve this issue using action scripts? If so, how can I apply the scripts exactly into my codes
The site I'm working with is : http://210.48.94.218/~printabl/about-us/our-culture/
My code is shown below:
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="172" height="250" id="FlashID" title="printableIntro">
<param name="movie" value="printableIntro.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="6.0.65.0" /><!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don't want users to see the prompt. -->
<param name="autoplay" value="false"/>
<param name="play" value="false"/>
<param name="flashvars" value="autoplay=false" />
<param name="expressinstall" value="Scripts/expressInstall.swf" /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]-->
</object>
<object type="application/x-shockwave-flash" data="printableIntro.swf" width="172" height="250">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<param name="autoplay" value="false"/>
<param name="play" value="false"/>
<param name="flashvars" value="autoplay=false" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></p>
</div>
<!--[if !IE]-->
</object>
<!--<![endif]-->
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
</body>
Use SWFObject
https://code.google.com/p/swfobject/
Here is how you use it
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent"> This text is replaced by the Flash movie. </div>
<script type="text/javascript">
var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");
</script>
Here is what each parameter means
var so = new SWFObject(swf, id, width, height, version, background-color [, quality, xiRedirectUrl, redirectUrl, detectKey]);
Create a new SWFObject and pass in the required arguments:
swf – The file path and name to your swf file.
id – The ID of your object or embed tag. The embed tag will also have this value set as it’s name attribute for files that take advantage of swliveconnect.
width – The width of your Flash movie.
height – The height of your Flash movie.
version – The required player version for your Flash content. This can be a string in the format of ‘majorVersion.minorVersion.revision’. An example would be: "6.0.65". Or you can just require the major version, such as "6".
background-color – This is the hex value of the background color of your Flash movie.
Optional arguments are:
quality – The quality you wish your Flash movie to play at. If no quality is specified, the default is "high".
xiRedirectUrl – If you would like to redirect users who complete the ExpressInstall upgrade, you can specify an alternate URL here
redirectUrl – If you wish to redirect users who don’t have the correct plug-in version, use this parameter and they will be redirected.
detectKey – This is the url variable name the SWFObject script will look for when bypassing the detection. Default is ‘detectflash’. Example: To bypass the Flash detection and simply write the Flash movie to the page, you could add ?detectflash=false to the url of the document containing the Flash movie.
so.write("flashcontent");
Tell the SWFObject script to write the Flash content to the page (if the correct version of the plug-in is installed on the user’s system) by replacing the content inside the specified HTML element.
I wrote an applet which is called "IdrawApplet.java" and a HTML which is supposed to contain this applet. But somehow when I run the HTML it says that it can't find my java-Class.
This is a "Dynamic-Web-Project". It has a "WebContent"-Folder which contains both, the HTML and the java-Class.
As you will see I tried to insert the applet in two different ways. By putting it in a "applet"-Tag and a "object"-Tag (as suggested) on SELFHTML.org:
<!-- <applet code= "IdrawApplet.class"
codebase= "../applets"
width= 320 height= 180></applet> -->
<object classid="java:IdrawApplet.class"
codebase="../applets"
width="800" height="600"></object>
Thanks in advance...
The proper way (which is also the HTML5 way) to embed a Java applet is:
<object type="application/x-java-applet" width="320" height="180">
<param name="code" value="MyJavaClass">
fallback content
</object>
However, IE doesn't support the standard way so you need to use IE conditional comments (in an HTML5-compatible way) like this:
<!--[if !IE]>-->
<object type="application/x-java-applet" width="320" height="180">
<param name="code" value="MyJavaClass">
fallback content
</object>
<!--<![endif]-->
<!--[if IE]>
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="320" height="180">
<param name="code" value="MyJavaClass">
fallback content
</object>
<![endif]-->
Note that for the value of the code param, it doesn't require the .class extension. Just the class name is preferable.
For IE, you can also specify a codebase attribute if you want to provide a location to a cab file where IE can fetch Java if you don't have it. However, if you want to specify the path to the directory the .class file is in, you do that (for any browser) with the codebase param.
As for enabling scripting with "mayscript", you shouldn't need to do that these days. But, if you need to for some reason, you do it with a mayscript param (not attribute) and set its value to true.
Note that the fallback content will only show when a handler for application/x-java-applet isn't present or is disabled. It won't show for a missing .class file as the Java plug-in still loads.
for that..first check your environment variables, then see the class file names, if you do not write .class extention than it may be works...and its batter to include applet file..like
in header part of the html code
Following embed code is from http://hd.se/landskrona/2010/04/09/kunglig-glans-pa-idrottsgalan/ but it doesn't work in Internet Explorer 8. Firefox no problems.
Any recommendations for improvements?
Thanks for your time!
<object width="480px" height="294px" id="_36313041" data="http://hd.se/static/media/html/flash/video-3/flowplayer.swf" type="application/x-shockwave-flash">
<param name="movie" value="http://hd.se/static/media/html/flash/video-3/flowplayer.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="flashvars" value='config={"key":"$3fff7448b28a8cffc85","contextMenu":["hd.se videospelare 1.0"],"plugins":{"rtmp":{"url":"http://hd.se/static/media/html/flash/video-3/flowplayer.rtmp.swf"},"controls":{"height":24,"opacity":1,"all":false,"play":true,"time":true,"scrubber":true,"playlist":false,"mute":true,"volume":true,"fullscreen":true,"backgroundColor":"#222222","backgroundGradient":"none","buttonColor":"#7c7c7c","buttonOverColor":"#36558b","progressColor":"#7c7c7c","bufferColor":"#7c7c7c","timeColor":"#ffffff","durationColor":"#ffffff","timeBgColor":"#222222","scrubberHeightRatio":0.5,"scrubberBarHeightRatio":0.5,"volumeSliderHeightRatio":0.5,"volumeBarHeightRatio":0.5,"autoHide":"fullscreen","hideDelay":1800,"tooltips":{"buttons":true,"play":"Spela","pause":"Paus","next":"Nästa","previous":"Föregående","mute":"Ljud av","unmute":"Ljud på","fullscreen":"Fullskärmsläge","fullscreenExit":"Lämna fullskärmsläge"},"tooltipColor":"#153872","tooltipTextColor":"#ffffff"},"contentIntro":{"url":"http://hd.se/static/media/html/flash/video-3/flowplayer.content.swf","top":0,"width":736,"border":"none","backgroundColor":"#202020","backgroundGradient":"none","borderRadius":"none","opacity":"85pct","display":"none","closeButton":true}},"canvas":{"backgroundColor":"#000000","backgroundGradient":"none"},"play":{"replayLabel":"Spela igen"},"screen":{"bottom":24},"clip":{"scaling":"fit","autoPlay":true},"playlist":[{"provider":"rtmp","netConnectionUrl":"rtmp://fl0.c06062.cdn.qbrick.com/06062","url":"ncode/hdstart","autoPlay":false,"scaling":"fit"},{"url":"http://hd.se/multimedia/archive/00425/_kunligglans_HD_VP6_425359a.flv","scaling":"fit","autoPlay":true},{"provider":"rtmp","netConnectionUrl":"rtmp://fl0.c06062.cdn.qbrick.com/06062","url":"ncode/hdstopp","autoPlay":true,"scaling":"fit"}]}' />
</object>
UPDATE 2010-05-14:
If I'm not mistaken HD.se uses Flowplayer and all those flasvars are for that. Perhaps someone here is good with Flowplayer? I've never used it myself.
You cannot have 'px' in the width and height attributes, only a number. Also IDs cannot start with an underscore, they can only start with a letter.
So your code should start <object width="480" height="294" id="f_36313041". However, if the ID is used for anything you may have to change external code somewhere.
Have you double-checked the value of "flashvars" too? It's an incredibly long and complex string so there could easily be an error there somewhere.
You should not create object/embed tags directly to embed Flash. Always use an external JS file to generate the required tags. SWFObject is the most widely used one.
http://en.wikipedia.org/wiki/SWFObject
Info on why you want to use an external JS file:
http://blog.deconcept.com/2005/12/15/internet-explorer-eolas-changes-and-the-flash-plugin/
Are there any ways providing an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated.
I’ve found recommendations, like the following from W3C, which determine via JavaScript the existence of Adobe Flash on the client: W3C Providing alternative images
Honestly, I would prefer a non JS technique. I’m thinking of some XHTML tag, equivalent to <noscript>. (like <noobject> if the object (in our case Flash) can’t be displayed/loaded).
The reason for needing this separation is the following:
The bank I’m working for will preferably display their banners in Flash format. In case it isn’t possible a simple image should be shown.
In the past it was solved very likely in the way mentioned before. We’re currently working on a design refresh and that’s where I stumbled upon this piece of code which makes me wonder if it’s really the most elegant and compatible way of doing so.
Another idea that strikes me: Is it actually possible to load Flash-objects in a JavaScript disabled environment?
Actually having flash installed but javascript turned off is a valid scenario. This should work across most browsers:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="flashContent">
<param name="movie" value="flash.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="flash.swf" width="800" height="600">
<!--<![endif]-->
<img src="(...)" alt="Put your alternate content here" />
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
I use the following code for graceful degradation. It works well.
<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="flash.swf" width="500" height="100">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="500" height="100">
<param name="movie" value="flash.swf" />
<!--><!--dgx-->
<param name="loop" value="false">
<param name="menu" value="false">
<param name="quality" value="high">
<img src="flash_replacement.png" width="500" height="100" alt="No Flash">
</object>
<!-- <![endif]-->
I don't know why you want to avoid javascript, it is the best solution when dealing with Flash.
using the SWFObjects Library (the best known so far for the matter) you can do this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> My Home Page </title>
<meta name="viewport" content="width=780">
<script type="text/javascript" src="swfobject.js"></script>
</head>
<body>
<div id="splashintro">
<img src="splash_noflash.png" />
</div>
<script type="text/javascript">
var so = new SWFObject("csplash.swf", "my_intro", "300", "240", "8", "#338899");
so.write("splashintro");
</script>
</body>
</html>
what the script does is replace the splashintro div with the flash file, if the browser does not support Flash, then does nothing and the splash_noflash.png will be shown.
P.S. With this technique you are ready for the iPhone, instead of showing the blue cube, it will show the image :)
I find using inline styling to do the trick.
For example:
<div style="background-image: url('...');">
<object>
/* Embedded Flash */
</object>
</div>
We can provide an alternate GIF/PNG image, in case the user has no Adobe Flash installed and/or deactivated.
<object id="flashcontent classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="550px" height="400px">
<param name="movie" value="mymovie.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="mymovie.swf" width="550px" height="400px">
<!--<![endif]-->
<p>
Fallback or 'alternate' content goes here.
This content will only be visible if the SWF fails to load.
</p>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
And also add this...
<script type="text/javascript">
swfobject.registerObject("flashcontent", "9", "/path/to/expressinstall.swf");
</script>
I have written an easy way to do this in CSS - no extra JavaScript at all.
Name your ID/Class where your Flash movie resides and use a background image. Wrap your Flash movie within that div.
For example:
<div ID="MyFlashMovie"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="800" height="600" id="flashContent">
<param name="movie" value="flashMovie.swf" />... etc., etc.</object>
</div> etc.
Then in your CSS:
#MyFlashMovie {
background: url("alternateGraphic.png");
background-repeat: no-repeat;
height: XXpx;
width: XXpx;
}
When the Flash isn't available, say on the iphone/pad, the graphic will display. The only drawback with this, that I have found, is that if your Flash movie uses a transparent background, you will see the alt graphic through the transitions. Just make a solid color within the Flash movie as your lowest layer (make sure it's the same bg color as the website) and it will look fine.
~GreaseJunkie