PDA

View Full Version : Start/Stop Buttons for Flash (.swf) video working in all browsers but IE.



Jim Weinberg
10-23-2013, 05:16 PM
I've got a flash video (.swf) with a set of start/stop buttons. My problem is that it works in all browsers, including Safari, but not in IE. I'm not a big fan of IE, so don't know the particular code to use. Can anyone whose more familiar with the particulars of IE help me out, please. Here's the code:



<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="320" height="240" id="ASongOfSpring_1" align="">
<param name=movie value="http://ohiobuttons.org/test/AV_Files/ASongOfSpring_1.swf">
<param name=quality value=high>
<param name=bgcolor value=#333399>
<EMBED id="video1" src="http://ohiobuttons.org/test/AV_Files/ASongOfSpring_1.swf" quality=high bgcolor=#333399 width="320" height="240" name="ASongOfSpring_1" align="" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</object>
</td></tr></table>
<table border=0>
<tr><td><a href="#"><img src="Graphics/Spring_Show/sound-off.png" border=0 onclick="document.getElementById('video1').StopPlay()"></a></td>
<td width=35>&nbsp;</td>
<td><a href="#"><img src="Graphics/Spring_Show/sound-on.png" border=0 onclick="document.getElementById('video1').Play()"></a></td>
</tr></table>


Thanks in advance.

jscheuer1
10-23-2013, 07:07 PM
Get rid of the object. I did and it worked in IE 10 in it's IE 10, 9, and 8 modes:


<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<body>
<EMBED id="video1" src="ASongOfSpring_1.swf" quality=high bgcolor=#333399 width="320" height="240" name="ASongOfSpring_1" align="" type="application/x-
</td></tr></table>
<table border=0>
<tr><td><a href="#" onclick="document.getElementById('video1').StopPlay(); return false;">Stop</a></td>
<td width=35>&nbsp;</td>
<td><a href="#" onclick="document.getElementById('video1').Play(); return false;">Play</a></td>
</tr></table>
</body>
</html>



Some IE might not be able to stream the embed while it's loading, and IE 9 or 8 or both might not perform as they do in the IE 9 and 8 modes of IE 10. But it's worth a shot. If all else fails:


<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function stopVid(){
try{document.getElementsByName('video1')[0].StopPlay();}
catch(e){document.getElementById('video1').StopPlay();}
}
function playVid(){
try{document.getElementsByName('video1')[0].Play();}
catch(e){document.getElementById('video1').Play();}
}
</script>
</head>
<body>
<object name="video1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="320" height="240" id="ASongOfSpring_1" align="">
<param name=movie value="ASongOfSpring_1.swf">
<param name=quality value=high>
<param name=bgcolor value=#333399>
<EMBED id="video1" src="ASongOfSpring_1.swf" quality=high bgcolor=#333399 width="320" height="240" name="ASongOfSpring_1" align="" type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</object>
</td></tr></table>
<table border=0>
<tr><td><a href="#" onclick="stopVid(); return false;">Stop</a></td>
<td width=35>&nbsp;</td>
<td><a href="#" onclick="playVid(); return false;">Play</a></td>
</tr></table>
</body>
</html>

Jim Weinberg
10-24-2013, 01:56 PM
Hey John.

Many thanks. I tried your first suggestion and it seems to work fine. However, I'm holding your second set of code in reserve, just in case.

I can't believe it was that simple. You have no idea how long I've been scr.... messing around with this.

Again, my thanks.

Jim

djr33
11-10-2013, 12:38 AM
This thread has started to attract a huge amount of spam (all deleted at this point). So rather than let that go on, I'm going to close it. I think your question has been answered and your problem is solved. But if you have more questions, please just post a new thread as needed. Or you can PM one of the mods to ask to have this re-opened.