First a little background. I have a client (in-house) who insists that our training pages (launched from within iframes on a parent page) be able to load .wmv files with variables for the width and height parameters so we don't have to recode when videos are switched. Flash videos are not an option.
I've searched the net and have received several suggestions and even code snippets from several sources but the only one that comes close to working is this one:
<html>
<head>
<style type="text/css">
<!--
.fontStyle {
font-family: Verdana, Geneva, sans-serif;
font-size: small;
font-weight: bold;
color: #67A2DC;
}
-->
</style>
<script type="text/javascript">
window.onload=function(){
loadVideo();
}
function loadVideo()
{
if (parseInt(navigator.appVersion)>3)
{
if (navigator.appName == "Netscape")
{
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft") != -1)
{
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
var dimW = winW-50;
var dimH = winH-20;
var w1 = dimW.toString();
var h1 = dimH.toString();
if(document.getElementById("vidEmbed") != null)
{
document.getElementById("vidEmbed").src = "Welcome_1.wmv";
document.getElementById("vidEmbed").style.width = w1;
document.getElementById("vidEmbed").style.height = h1;
}
else if(document.getElementById("Player") != null)
{
document.getElementById("Player").style.width = w1;
document.getElementById("Player").style.height = h1;
document.getElementById("objectSrc").value = "Welcome_1.wmv";
}
}
</script>
</head>
<body><div>
<p><span class="fontStyle">Introduction<br>
</span>
<object id="Player" width="100%" height="100%" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="border:0px;">
<param name="autoStart" value="True">
<param name="uiMode" value="full">
<param name="volume" value="50">
<param name="mute" value="false">
<param name="URL" id="objectSrc" value="">
<embed src="" id="vidEmbed" width="100%" height="100%" autostart="true" uimode="full" volume="50" mute="false"> </embed>
</object>
</p>
</div>
</body>
</html>
I say close because it works just fine in Firefox (go figure) but doesn't appear to be working correctly in IE. IE just will not load the video using the "objectSrc" id. If I move the source video from the javascript into the actual object, then it loads and plays the video (it still doesn't resize the window correctly).
I've been in several forums and have poured over the code with several people and we just can't figure out why this code doesn't work correctly.
Can anyone here help?
Thanks,
M.