View Full Version : FLVPlayback errors in Flex

03-31-2008, 04:50 PM
I am using the FLVPlayback component in flex and it works well with relative files, but when I try to hit our streaming server I get this error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at fl.video::VideoPlayer/http://www.adobe.com/2007/flash/flvplayback/internal::doAutoResize()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

If I just keep plowing through in debug the video will play and everything is fine. This project is just a POC so I am not so concerned about fixing the error just yet but is there a way to catch it and trace it so it won't show up for the client? Here is the relevant code:

var flvPlayer:FLVPlayback = new FLVPlayback();
flvPlayer.skin = "vids/SkinClearOPSM.swf"
flvPlayer.skinBackgroundAlpha = 1;
flvPlayer.skinBackgroundColor = 0xcccccc;
flvPlayer.bufferTime = 5;
//var vUrl:String = "vids/"+name+".flv";
var vUrl:String = "rtmp://(ourtmphost.com)/VideoPlayer/"+name+".flv";
trace("url: "+vUrl);
//flvPlayer.source = vUrl;
flvPlayer.registrationX = (stage.stageWidth -864)/2;;
flvPlayer.registrationY = (stage.stageHeight -486)/2;
flvPlayer.registrationHeight = 486;
flvPlayer.registrationWidth = 864;
flvPlayer.height = 486;
flvPlayer.width = 864;
//flvPlayer.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;

flvPlayer.skinAutoHide = false;
flvPlayer.name = "flvPlayer";

As you can see I tried flvPlayer.source and flvPlayer.load() and am getting the same error for both. I have searched around but not seen anything on this particular error. Any help would be greatly appreciated!