flash not rendering in Internet Explorer - html

Hi have the following flash object placed in HTML, flash seems to be rendering good in Firefox, Chrome, Safari but not in any version of IE!!!
Can someone please let me know whats wrong in this object, or what I miss specially for IE!!
Thanks in advance,
Tanmay

Use SWFObject for embedding Flash elements, it will solve all your cross-browser issues.

I believe you need the movie param. This works for me:
<!doctype html>
<object data="http://jquery.thewikies.com/swfobject/fireworks.swf" width="440" height="550" name="demoLaunch" id="demoLaunch" type="application/x-shockwave-flash">
<param value="true" name="democonnect">
<param value="always" name="allowscriptaccess">
<param value="transparent" name="wmode">
<param value="demo1=1&demo2=3&demo3=12&demo4=19" name="flashvars">
<param name="movie" value="http://jquery.thewikies.com/swfobject/fireworks.swf">
</object>
It is better to rely on Javascript to control no flash fallbacks in addition to cross-browser JS for this purpose. I would recommend jquery swfobject.

Have you tried validating your HTML and CSS? You almost certainly have a coding error in there somewhere and that will help you find it. http://validator.w3.org/

Actually, the problem here is that you're using W3C valid HTML, which IE has a tendency not to get along with. To get IE to embed flash content you need to use embed, which does exactly the same thing as object but is not part of the W3C standard.
The syntax for the embed tag is as follows:
<embed src="somefilename.swf" width="550" height="400"></embed>
This is often just placed inside of the object tag, so that both options are on the page (don't worry, it won't be rendered twice in browsers that understand the object tag you already have).
A common way to get around using non-standard HTML is to do the embed with Javascript, which writes non-standard HTML code to the browser but not until after the page is rendered. This allows the page to pass the W3C HTML validator, and still work cross-platform. The best javascript library for doing this is generally SWFObject, which lets you just include the flash content once and will write html out for whatever browser the user is viewing your content in.

Related

Firefox / Flash plugin

I am using a moving flash logo on my website. I am using the code below:
<object width="248px" height="148px" id="flashContent">
<param name="movie" value="http://domain.co.uk/flash/Flash_logo.swf">
<param name="wmode" value="transparent" />
<object type="application/x-shockwave-flash" data="http://domain.co.uk/flash/Flash_logo.swf" width="248px" height="148px">
<param name="movie" value="http://domain.co.uk/flash/Flash_logo.swf">
<param name="wmode" value="transparent" />
<img src="images/global/logo.png"/>
</object>
</object>
Basically the code above will show the flash logo unless flash is not available.In which case the image logo.png will be used as a replacement. This works perfectly fine. However problems arise with Firefox when it detects that flash is not up to date.
Instead of showing the flash file or the logo.png firefox displays a big box stating that the plugin is vulnerable and must be updated. To be honest my flash files serves not other function that to add a little extra style to the site and with the plugin problem my site loads without a logo at all which is less than ideal.
I suppose my question is... Is it possible to edit my code above so that if the plug in is out of date then just the logo.png is loaded instead of Firefox detecting the plugin problem?
First of all, it is not just Firefox and/or outdated Flash.
Users can set any plugin incl. Flash to click-to-play in recent Firefox versions, not just outdated ones.
Chrome also has a preference that allows you to set plugins to "click-to-play".
There is no reliable way to detect click-to-play (due to outdated plugins and/or user preferences), neither in Firefox nor Chrome.
Sometimes it is recommended to construct a plugin in javascript, wait for it to load and then try to interact with it, and if that fails go to a fallback method. However, you still cannot distinguish between the plugin being autoloaded and the user just being a fast clicker.
Your best option is not to use Flash at all, if you don't really need it or it doesn't worth the fuzz. Otherwise try the detection thing.

.SWF Object Shrinking in IE 8

I am having an issue in WordPress. I've embedded a .swf as an object, but in IE 8 it shows really small. I've attached a screenshot of the IE issue. It's that really small picture on the left. To see a working version, check out the page here on another browser.
I would love to disregard this issue, but unfortunately our company runs on IE so I need to fix this.
This is all created in WordPress. The .swf is hosted externally. Here is the code:
<object width="680px" height="300px">
<param name="movie" value="http://www.pplweb.com/ppl-generation/~/media/PPLWeb/Generation/Media/PPL%20Susquehanna/nuclear.swf">
<embed src="http://www.pplweb.com/ppl-generation/~/media/PPLWeb/Generation/Media/PPL%20Susquehanna/nuclear.swf" width="100" height="100">
</embed>
</object>
Embed it using SWFObject, it's the most reliable way to insert SWF files. WordPress already comes bundled with it, so you just need wp_enqueue_script('swfobject');, and then use the script embedding accordingly.
Or you can use a plugin: wordpress.org/plugins/search.php?q=swfobject.

Initial Zoom Parameter for PDF Object in HTML5

I am building a page that will display a PDF file on the page. When viewing this page in Chrome, the zoom level is set by default so that the document is wider and taller than the allotted space. Safari seems to have a preferable default of fitting the page to the available space, just FYI.
I would like to know if there are any parameters that can be set in <object> to force the initial zoom level of the document. It might be name=initZoom with values like "fitToPage" or "fitToWidth" or "70" (for 70% zoom). It might look something like this:
<object data="/path/to/file.pdf" type="application/pdf">
<param name="initZoom" value="fitToPage" />
</object>
Does Adobe's document 'Parameters for opening PDF files' help you?
According to that document, something like
<object data="/path/to/file.pdf" type="application/pdf">
<param name="view" value="Fit" />
</object>
could work, or even
<object
data="/path/to/file.pdf#toolbar=1&navpanes=0&scrollbar=1&page=3&view=FitV"
type="application/pdf">
<p>It appears you don't have a PDF plugin for this browser.
No problem though...
You can click here to download the PDF.
</p>
</object>
See demo here http://jsfiddle.net/6TNrw/68/
The above works if the pdf viewer object is adobe.
Google chrome has its own pdf viewer so changing its zoom parameter wont work for that.
<object data="http://www.nclabor.com/wh/faqs.pdf?#view=fitH"
type="application/pdf"
width="100%" height="100%">
<param name="view" value="fitH" />
</object>
Adding a late answer since none of the existing ones worked for me, and someone might need it.
Instead of adding '#view=fitH' or '#view=fitV' to the pdf url, which didn't work for me, i got it working by adding '#zoom=scale', like this:
<object data="/path/to/file.pdf#zoom=scale" type="application/pdf">
</object>
Hope this helps someone, and sorry for any inconvenience.
EDIT:
Found more parameters here. Found the link in this thread, which is basically the same question as this.
Another late answer (looks like we're on a 2-year cycle...)
I found that setting the parameter #zoom=Fit finally did the trick. This is only in FF so far. Chrome is laughing at every parameter I feed it.
Note that the documentation states that view gets the Fit values, but zoom is the one that seems to do anything with them.
I hope this helps someone down the line.

Ruby: how to ouput PDF object element?

I am embedding a pdf file in rails view using embed tag, i have write it in simple html and its working fine but i need to write this tag in rails conventions.
The code is like:-
<object data="file1.pdf#toolbar=0&navpanes=0&scrollbar=0" type="application/pdf" width="100%" height="720">
<embed src="file2.pdf#toolbar=0&navpanes=0&scrollbar=0" type="application/pdf" width="100%" height="720" />
</object>
It seems Ruby uses print to output to a client...
print 'Hello World!'
There is no "embed tag", that is an "object element"; using the correct terminology not only makes you look more professional to others though also greatly improves your ability to communicate in fewer steps. 99.9% of the time people are referring to an element, it is the whole element. A very rare correct reference to a tag would be something like, "In XHTML does the meta element self close or does it have an end tag?" (e.g. < meta / > or < meta >< / meta >).
Internet Explorer (as usual) has a bug that is unable to display flash objects correctly in certain situations such as with your code, I'm not sure if this applies to a PDF but they're both Adobe products so best to try this in IE7 to be sure. You need to have a movie parameter element.
Here is everything put together along with Ruby...
<object class="pdf" data="something.pdf" type="application/pdf">
<param name="movie" value="something.pdf" />
<p>This is alternative content that displays if the plugin is not suppoted.</p>
</object>
Another very important clarification: you need to have a height/width set or at least a minimum height and width set otherwise certain browsers (e.g. Firefox) will not load the resource. In fact when I change themes on my site if the dimensions change in the middle of the music playing the whole Flash object resets. Not such a big issue for a PDF though if it forces the browser to reload the PDF it may annoy your visitor and it's ALL about making sure your visitors aren't annoyed by doing things right the first time.
Lastly alternative content is any (X)HTML that appears inside the object element. You can add a link to download a PDF plugin if the client's browser doesn't already support one.
Hope this helps, feel free to ask for clarifications if need be.

Is there a standard copy-paste way to safely put a SWF in a web-page?

While embedding a SWF in HTML is not too hard, there are a few subtleties for different browsers, detecting if Flash is installed, etc.
For enabling AJAX, there are standard chunks of code you can use to save the hassle of coping with all cases... is their a similar 'reference implementation' to embed a SWF which covers all the bases?
Is there a standard? Sadly no. The desirable points of a Flash embedding method are:
modern browser compatible
IE compatible
ancient browser compatible
standards-compliant
supporting streamed Flash (play before the whole file is downloaded) in IE
Don't Repeat Yourself
allow fallback content
no JavaScript reliance
but there is no one bunch of markup that satisfies all these points. Point 6 is impossible to achieve fully but some solutions fail worse than others.
About the simplest markup you can get away with is the version outlined in the classic Flash Satay article:
<object type="application/x-shockwave-flash" data="file.swf" width="x" height="y">
<param name="movie" value="file.swf" />
(Non-Flash content here)
</object>
The ALA article complains that this version won't prompt the user to download Flash if it isn't installed; personally I see this as a plus point. But it still fails on points 3 and 5. Point 5 may or may not matter: if your Flash file is a simple application, media player or loader stub it doesn't matter at all, but if it's a big animation it can be unfortunate.
Maybe point 3 doesn't matter any more; no-one's really using Netscape 4 or IE4 these days. But if it does to you, you need the old-school embed tag. This is also supported by modern browsers so that means you can use the ActiveX method for the outer object, so you get streaming in IE:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="x" height="y">
<param name="movie" value="file.swf" />
<embed type="application/x-shockwave-flash" src="file.swf" width="x" height="y" />
</object>
This is the ‘traditional’ method of embedding Flash. It fails on points 4 and 7 and is slightly worse on point 6.
The third approach, used by libraries such as SWFObject is to use JavaScript to choose the best way to instantiate Flash on the current browser. This can hit the all the above points except, naturally, 8. Some libraries offer ways to mitigate that by also including static object markup, trading point 8 for point 6.
Apple (Link for example)
Content that your plug-ins will view
needs to be embedded within HTML. Most
browsers do this with an EMBED tag,
but others require the OBJECT tag. For
maximum compatibility, you can tune
your page to support both.
Adobe (Link for example)
The OBJECT tag is used by Internet
Explorer on Windows and the EMBED is
used by Netscape Navigator (Macintosh
and Windows) and Internet Explorer
(Macintosh) to direct the browser to
load the Macromedia Flash Player.
Internet Explorer on Windows uses an
ActiveX control to play Macromedia
Flash content while all other browser
and platform combinations use the
Netscape plugin technology to play
Macromedia Flash content. This
explains the need for two tags.
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/
shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH="550"
HEIGHT="400"
id="myMovieName">
<PARAM NAME=movie VALUE="myFlashMovie.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED href="/support/flash/ts/documents/myFlashMovie.swf"
quality=high
bgcolor=#FFFFFF
WIDTH="550"
HEIGHT="400"
NAME="myMovieName"
ALIGN=""
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
Many implementations of Flash embedding seem to be based on SWFObject. Is this the kind of thing you are looking for? Edit: project is hosted here now
I would recommend SWF Object compared to all the other options because it produces Standards Compliant html and is really easy to setup.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<div id="myvideo"></div>
<script type="text/javascript">
var params = { allowScriptAccess: "always" };
var atts = { id: "myplayerid1" };
swfobject.embedSWF("http://www.youtube.com/v/gRvUpoTT-Bo&hl=pt-br&fs=1&enablejsapi=1&playerapiid=myplayerid1&version=3", "myvideo", "425", "344", "8", null, null, params, atts);
</script>
This might be the easy way ..use js fiddle to test any code ... that helped me a lot to try many things