I'm using <object> to embed an SWF file like this:
<object width="900" height="900">
<param name="movie" value="carte-uso-ch-01.swf">
</object>
I don't know if this is portable and it really doesn't matter here, this is just for personal use. Is there any way to let the SWF expand to its actual size, instead of restricting it to 900x900? If I remove the width and height attributes from <object> I'll only get a thumb displayed.
If you have PHP running, you can use getimagesize() on SWF files.
<object width="100%" height="100%">
or JavaScript width andheight detection
Related
So ive been trying to use Ruffle (a flash emulator written in Rust) on a website for some flash games. This works like a charm with flash games in my website source files, but it doesnt work for iframes. This is the code that ive been trying to get working, but at this point im not sure if its possible at all. any help?
<script src="ruffle/ruffle.js"></script>
<iframe id="cppscreatorCPPS" src="https://play.cppscreator.xyz/embed/24436" scrolling="no" width="960" height="600" frameborder=0></iframe>
<br /><br />```
Instead of an <iframe>, I would recommend you used an <object> and <embed>component. I will leave a code snippet below (You need to replace the value of the param and the src of the embed with your swf file link. In your case, it is the play.cppscreator.xyz/embed link. ). Also, you are using cppscreator.xyz, which does not really work, as it is not an SWF file.
<script src="https://flash-games.penguinbotcoder.repl.co/ruffle/ruffle.js"></script>
<object width="600" height="400">
<param name="movie" value="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
<embed src="https://flash-games.penguinbotcoder.repl.co/flashgames/thinice.swf">
</embed>
</object>
I'd like to embed an SWF file in HTML5. It works fine with this code:
<embed src="main.swf" width="550" height="400" />
But how could I show alternative content (an animated GIF image, or a static JPEG or PNG) just in cases which swf file is not supported (and still validating in w3! ;) )
Thank you!
Use the object tag instead of the embed tag like so:
<object width="550" height="400" data="main.swf">Alertnative Content Here</object>
See: EMBED vs. OBJECT
I'm looking to play a flash video hosted on a remote website. I've tried the following (and profuse google-ing):
In source of page on http://fakesite1.com/player.jsp:
<embed src = "FlashPlayer.swf?file=http://fakesite2.net/video.flv" />
I can browse to http://fakesite2.net/video.flv and ensure it's there, but the player comes back "movie not loaded" (on right-click) on fakesite1. My initial guess is that this might be some sort of security feature... is it possible to play a video hosted on a remote site?
The message "Movie not loaded" as seen in the context menu of an SWF object in a webpage means that the .swf file was not loaded by the browser plugin. The main cause is that that SWF file doesn't exist and the plugin got a 404 error, in which case make sure that the path to the SWF file is correctly set.
Also, the <embed> element is obsolete in modern HTML. Use <object> instead, as seen below.
Note that various versions of IE (except IE9/10, possibly including IE8) do not support the HTML5 <object data="" /> element, they prefer the IE4-era <object clsid="" /> element, so use a conditional comment, like so:
<!--[if IE]>
<object width="640" height="480" data="http://mysite.com/myflash.swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" >
<![endif]-->
<!--[if !IE]>-->
<object width="640" height="480" data="http://mysite.com/myflash.swf" />
<!--<![endif]-->
Try;
<embed
src="player.swf"
width="300"
height="300"
allowscriptaccess="always"
allowfullscreen="true"
id="player1"
name="player1"
file="http://fakesite2.net/video.flv"
/>
Is your SWF file named exactly "FlashPlayer.swf"?
As far as I know in Windows based systems letter case differences don't matter, however in Unix or Linux based ones it does matter. Your host is probably a Linux one. Try using lower case letters like "flashplayer.swf". Make this a habit with files that will be hosted online all the time. Also no space or special characters, use - or _ to seperate words.
I am using the xhtml valid way to embed below:
<object type="application/x-shockwave-flash" width="640" height="360" data="youtube-video-url">
<param name="movie" value="youtube-video-url" />
<param name="allscriptaccess" value="always" />
<p>Adobe Flash is required to view this content. Please download Flash Player.</p>
</object>
When I view it in IE without flash installed, I just get a black box and no alternate content. If I take out the type="application/x-shockwave-flash" attribute, the alternate content will appear. Why is it not showing the alternate content when the type attribute is specified and how do I correct this?
IE doesn't support fallback of the object element. What you describe should happen but IE is well, IE. You could use SWFObject to embed the flash if you really like a fallback.
Try removing the data parameter from the tag. It will work that way. Then if you put it back, you will notice that you might not be able to reproduce this issue. Also, try removing and using only data. You will find the possibilities interesting.
I never did find a solution to this problem. It only happened in Windows XP when the type was set to "application/x-shockwave-flash".
i just want to embed a flash like this:
<object
data="data:application/x-shockwave-flash;base64,..."
type="application/x-shockwave-flash">
<param name="movie"
value="data:application/x-shockwave-flash;base64,..."
/> </object>
but it just doesn't work. Did i make any mistake?
thankz
That's because it doesn't work. Not only would you have a buffer overflow, but most browsers don't allow for the inclusion of Flash via Data URIs. If you need a good place to host your Flash, Google Code works just fine.