PDA

View Full Version : Problems loading FLVPlaybackComponent


charlieD
07-17-2008, 02:55 PM
I'm having some frustrating problems trying to get an FLV to play with the FLVPlaybackComponent.

It works if I set the contentPath in the parameters of Flash (CS3) and preview or use the generated HTML file.

However, when I put this into a page and access it through the webserver (even my local machine server) the file is rarely loading. I say rarely because it has randomly worked once within many many page reloads, even though I had changed nothing.

I have checked file permissions, and the SWF itself is loading. However, the video or play controls don't appear. I have also disabled my browser cache and set the Flash cache amount for my local server to none...

I'm using the following embed code to pass the URL of the video file to load, then using the Actionscript below to load the movie. Can anyone help with this?

Embed Code

<script type="text/javascript">
var so = new SWFObject("/flash/video.swf", "flashObj", "453", "319", "8", "#fff");

so.addParam("allowScriptAccess", "sameDomain");
so.addParam("quality", "best");
so.addParam("scale", "scale");

so.addVariable("videoUrl", "<?php echo $MainVideo; ?>");

so.write("mainVideoPlayer");
</script>


Actionscript

var videoUrl:String = _level0.videoUrl;

if (videoUrl != undefined)
{
import mx.video.*;
videoplayer.contentPath = videoUrl;
videoplayer.play();
}

xxneon
07-17-2008, 03:49 PM
i am assuming that videoplayer is the instance name that is assigned to the FLVPlayback component that is on the stage??

also what is the full value of '$MainVideo', I only ask cause i notice the swf is in a different location then the html.. 'flash/video.swf'.. so that means that the swf url path would be relative to the html page and not the swf location itself. so depending on where the video is located at .. and depending on how your viewing the swf .. will depend on if the video is found or not.

charlieD
07-17-2008, 07:09 PM
Yeah, the instance of the component is called videoplayer.

In the HTML I refer to both the SWF file and the FLV in absolute terms, and they are both in the same directory:

/flash/video.swf
/flash/test.flv

So, $MainVideo = "/flash/test.flv"

atomic
07-17-2008, 07:15 PM
A link to this online?

charlieD
07-17-2008, 08:42 PM
http://guminteractive.com/videotest/

Moving this here produced a different result - it now loads the movie, but doesn't show the overlay controls. I've tried playing with the settings, having autoHide true or false, changing the overlay etc. to no avail...

xxneon
07-17-2008, 08:45 PM
you need to make sure that you copy over the skin swf file that is created when you publish too.. and it probably will need to be in the folder where the html is too.. if i had a guess.

xxneon
07-17-2008, 08:51 PM
you can also use the skin property to set the path to the skin swf if you want to keep it in the same location as the swf..

videoplayer.skin = '/flash/skin.swf';

vivian.smith
07-21-2008, 03:50 AM
Good suggestions. Learn more from here. Thanks.
:rolleyes: