Adjusting width of flash content without changing aspect ratio - html

I want to maintain width of 600 px and height be adjusted accordingly in order to maintain aspect ratio. How can that be achieved?
I m using following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" id="myFlashContent">
<param name="movie" value="swffile.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="swffile.swf" width="600">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>

Related

An image for outlook and another image for others

I have this code for html email (for example)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Title</title>
</head>
<body>
<span>Email content</span>
<!--[if mso]>
<img src="НТТР://site.com/image_for_outlook.jpg">
<![endif]-->
<!--[if !mso]><!-->
<img src="НТТР://site.com/image_not_for_outlook.gif">
<!--<![endif]-->
<span>Email content</span>
</body>
</html>
How to hide gif animation in Outlook?
There is many information for this but it's not work between "body" tags.

Stretching a video?

I am trying to stretch the video that I have. It has to be 400 X 400 stretched. I tried using the "stretchtofit" value="true" but that doesn't work and I need the video centered under the heading. I'm curious as to what I use to stretch the video? This is my code:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Lab 8-3</title>
</head>
<body>
<div style="text-align: center">
<img style="border: 0" src="magiclogo.png" width="325" height="88" alt="Logo" />
</div>
<div style="position: absolute; top: 110px; left: 310px">
<object data="magicshow.wmv" height="400" width="400">
<param name="showcontrols" value="false" />
<param name="stretchtofit" value="true" />
</object>
</div>
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6">
<param name="URL" value="magicmusic.mp3" />
<param name="uimode" value="invisible" />
</object>
</body>
</html>
why aren't you using <video> tag. you can set the size easily.
<video width="400" height="400" controls>
<source src="movie.mp4" type="video/mp4">
</video>

swf(flash) plays automatically in chrome

I embed the swf file by swfobject. I do not want the swf file(it's an advertisement) play automatically, so I set the attribute of play with "false". as following html:
<!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" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject/swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0", "expressInstall.swf");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="970" height="250" id="myFlashContent">
<param name="movie" value="day_110702/ad.swf" />
<param name="play" value="false" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="day_110702/ad.swf" width="970" height="250">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
It works perfectly on IE but it doesn't work on Chrome/Firefox. In Chrome/Firefox the swf file plays automatically.
In addition, another behavior of swf file differ from Chrome/Firefox and IE is:
when you embedded the swf file with invisible iframe tag. as
<iframe id="iframe" src="swf.html" style="width:100%;height:100%; display:none; visibility:hidden;"></iframe>
When you browse the page that contains this iframe in IE/Firefox, the swf will NOT play until you make iframe visible. But if yo browse the page in Chrome, the swf will play automatically even if iframe is invisible.
Anyone can tell me why the swf(flash) behavior is differ in different browsers?
Cross-browsers problem always make crazy :).
Have you tried embedding the SWF using dynamic publishing instead of static publishing?
<!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" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
var params = {};
params.play = "true";
var attributes = {};
swfobject.embedSWF("day_110702/ad.swf", "myAlternativeContent", "970", "250", "9.0.0", false, flashvars, params, attributes);
</script>
</head>
<body>
<div id="myAlternativeContent">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</body>
</html>

HTML5 Video for mobile

I'm having some issues with video for mobile and HTML5. My biggest problem is that the video will play like 2 seconds and stop because not enough of the video has loaded. The video is 1:26s long and 9mb. I was testing on wifi. Is there a way that I can make the video wait til enough has loaded so it can play without issues? or what is my best option to help solve this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript">
</script>
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
background-color:#000;
}
-->
</style>
</head>
<body>
<!--<div id = "m_loader">
<div id = "loading_hold">
<img src="d_logo.png" width="365" height="500" />
</div>
</div>-->
<video controls="controls" autoplay="autoplay">
<source src="reel720_3.mp4" type="video/mp4" />
<source src="reel720_3.webm" type="video/webm" />
Your browser does not support the video tag.
</video>
</body>
You can use the "canplaythrough" event. Though you may want to show some sort of progress/download indicator while this is happening.
myVideo.addEventListener('canplaythrough', function() {
myVideo.play();
});

Loading swf on IE html

<div>
<object id="myMovieName" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="/media/camera.swf" name="movie">
<param value="high" name="quality">
<param value="#FFFFFF" name="bgcolor">
<embed align=""
type="application/x-shockwave-flash"
name="myMovieName"
bgcolor="#FFFFFF"
quality="high"
src="/media/camera.swf"
href="/media/camera.swf">
</object>
</div>
the swf file doesnt load in IE what am i doing wrong here
I really think you should use swfobject. Download it from here:
http://code.google.com/p/swfobject/downloads/detail?name=swfobject_2_2.zip&can=2&q=
Then get the expressinstall.swf and the swfobject.js file.
Here is an example code for your stuff:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>SWFObject example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript">
var fo = new Object();
function initFlash()
{
fo.flashvars = {};
fo.params = {
allowScriptAccess: "sameDomain"
};
fo.attributes = {};
swfobject.embedSWF("smedia/camera.swf", "flashcontent", "100%", "100%", "10,1,103", "media/expressInstall.swf", fo.flashvars, fo.params, fo.attributes);
}
</script>
</head>
<body>
<div id="flashcontent">Flash will be placed here by swfobject.</div>
</div>
<script type="text/javascript">initFlash();</script>
</body>
</html>
You can read more about how it works in the documentation.
Rob