[thelist] Newbie alert - streaming Flash video Q??

Daryl Brown daryl at browncowmedia.com.au
Wed Mar 16 15:43:23 CST 2005


Hi guys - hope you can help,

I've been given this code by my Flash streaming provider, who also provide
the 'skin' for the player.
It works fine in Explorer on a PC, but doesn't seem to work in Safari or
Explorer on a Mac, ie I only hear the sound, but don't see the pictures.

I need this to work on a Mac as well as a PC - that's part of the beauty of
Flash after all(?)

Could anyone point in the right direction to solving this?
I am imagining by the code in the middle that I should be able to write
something for other browsers - but I haven't got a clue where to get this
information.
Any pointers would be gratefully accepted.

Hope it's ok putting this code up here.  No doubt I'll hear if it's not...

thanks

Daryl Brown
Brown Cow Media
Sydney Australia
www.browncowmedia.com.au



<table width="390" border="0" cellpadding="20" cellspacing="0" height="224"
align="center">
<div id="videoDiv">
    <script language="javascript">
                function videoSize(p_w, p_h) {
                        if(document.all && !document.getElementById) {
                                document.all['videoDiv'].style.pixelWidth =
p_w;
                                document.all['videoDiv'].style.pixelHeight =
p_h;
                        } else {

document.getElementById('videoDiv').style.width = p_w;

document.getElementById('videoDiv').style.height = p_h;
                        }
                }

                function appendParameter(p_args, p_name, p_value) {
                        if (p_args == "")
                                return p_name+"="+escape(p_value);
                        else
                                return
p_args+"&"+p_name+"="+escape(p_value);
                }

                var isInternetExplorer =
navigator.appName.indexOf("Microsoft") != -1;
                // Handle all the FSCommand messages in a Flash movie.
                function FLVPlayer_DoFSCommand(command, args) {
                        var FLVPlayerObj = isInternetExplorer ?
document.all.FLVPlayer : document.FLVPlayer;
                        //var myText = isInternetExplorer ?
document.all['myText'] : document.getElementById('myText')
                        //
                        // Place your code here.
                        //
                        switch (command) {
                                case "videoSize":
                                        var a = args.split(",");
                                        videoSize(a[0], a[1]);
                                        //myText.value =
"videoSize("+a[0]+","+a[1]+")\r" + myText.value;
                                        break;
                                case "done":
                                        //myText.value = "Done Playing\r" +
myText.value;
                                        break;
                                //Add custom events here
                                default:
                                        //myText.value = command+"
("+args+")\r" + myText.value;
                        }
                }

                // Hook for Internet Explorer.
                if (navigator.appName &&
navigator.appName.indexOf("Microsoft") != -1 &&
navigator.userAgent.indexOf("Windows") != -1 &&
navigator.userAgent.indexOf("Windows 3.1") == -1) {

                        document.write('<script language=\"VBScript\"\>\n');
                        document.write('On Error Resume Next\n');
                        document.write('Sub FLVPlayer_FSCommand(ByVal
command, ByVal args)\n');
                        document.write('Call FLVPlayer_DoFSCommand(command,
args)\n');
                        document.write('End Sub\n');
                        document.write('</script\>\n');
                }

                var args = "";
                        args = appendParameter(args, "configFile",
"http://flash.audiovideoweb.com/flashgen.cgi?sname=IScompile.flv&aname=ca70f
ls25042/_definst_");

                        args = appendParameter(args, "skinName",
"http://flashlinks.audiovideoweb.com/flash_skins/flashhaloskin1.swf");

                        args = appendParameter(args, "autoPlay","true");
                        args = appendParameter(args, "autoRewind","true");

                document.write('<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=7,0,0,0" width="100%" height="100%" id="FLVPlayer" align="">');

                document.write('<param name="movie"
value="http://flashlinks.audiovideoweb.com/flash_skins/FLVPlayer.swf?'+args+
'"/>');

                document.write('<param name="salign" value="lt" />');
                document.write('<param name="quality" value="high" />');
                document.write('<param name="scale" value="noscale" />');
                document.write('<param name="bgcolor" value="#ffffff" />');
                document.write('<embed
src="http://flashlinks.audiovideoweb.com/flash_skins/FLVPlayer.swf?'+args+'"
quality="high" scale="noscale" bgcolor="#ffffff" width="100%" height="100%"
name="FLVPlayer" salign="LT" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />');

                document.write('</object>');
        </script>
</div>



</table>
<!-- Content Box -->
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.7.3 - Release Date: 15/03/2005



More information about the thelist mailing list