crmamx Posted December 1, 2012 Share Posted December 1, 2012 (edited) I could get the videos to play in a new window by linking directly to a .html program. But I wanted them to play on the current open page. I beat my brains out and only discovered how to do it by chance. Here is the code in case it might help someone else. crashes.php <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1252"> <title>AVS FLV Player</title> <!-- SWFObject embed by Geoff Stearns geoff@deconcept.com http://blog.deconcept.com/swfobject/ --> <script type="text/javascript" src="content/pages/swfobject.js"></script> </head> <body style="direction: ltr;"> <div id="flashcontent"> <strong style="font-size: large;">The contents of the page could not be displayed.</strong><br><br> This can be caused by the following reasons: <ul> <li>Microsoft Internet Explorer blocks the flash content on your page.<br> Click the warning in the upper part of the browser and select the <strong>Allow Blocked Content... </strong> option to continue opening the page.<br><br> </li> <li><strong>You need to install or upgrade your Flash Player.</strong><br> Please visit the <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Adobe site</a> to download and install the latest version of the Flash Player necessary to be able to display the contents of this page </li> </ul> </div> <script type="text/javascript"> var so = new SWFObject('content/pages/avs4you_player.swf', 'player', '450', '370', '7', "#ffffff"); so.addParam("allowScriptAccess","always"); so.addParam("allowFullScreen","true"); so.addParam("wmode", "window"); so.addParam("scale", "noscale"); // this is the name of the converted file that will be played by the player so.addVariable("file", "video_crashes.flv"); // here the size of the player itself is set in pixels - width and height so.addVariable("width", "450"); so.addVariable("height", "370"); // the name of the player skin so.addVariable("theme", "content/pages/Platinum.swf"); // the movie loop parameter - can be set to 0 (the video will stop after the playback is over) or 1 (playback is looped) so.addVariable("repeat", "0"); // the movie automatic startup parameter - can be set to 0 (the playback will not start automatically once the page with the video is loaded) or 1 (autostart) so.addVariable("autostart", "0"); // the name and path of the image that will be displayed when the page is loaded, provided that the autostart value is set to 0 (i.e. no autostart is enabled) so.addVariable("image", ""); // the volume that will be used to playback your movie so.addVariable("volume", "50"); so.addVariable("scaleonresize", "none"); // the top and the bottom captions displayed when you roll your mouse cursor over the player window so.addVariable("top_caption", " "); so.addVariable("bottom_caption", " "); so.addVariable("showlogo", "0"); so.addVariable("v", getQueryParamValue("v")); so.write("flashcontent"); </script> </body> </html> What stumped me was this line: so.addVariable("file", "video_crashes.flv"); I had included a path to the video same as with the player and player skin. Still don't know how it works. Guess it assumes the video is located in the same directory as the player. In testing I left the path off the video file unintentionally and lo and behold it worked. If you want to see it at southalabamarc.com I have not finished fixing all of them but Funny Crashes works. Edited December 1, 2012 by crmamx Quote Link to comment https://forums.phpfreaks.com/topic/271447-finally-got-videos-to-work/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.