Navigation | Flash VideoError: 1005 Solution

Flash VideoError: 1005 Solution

I encountered this problem today with the FLVPlayback component in my Sailing Videos.org project and couldn’t find any helpful answers by searching.

The error that you get is along the lines of:

VideoError: 1005: Invalid xml: URL: "..." No root node found; if url is for an flv it must have .flv extension and take no parameters

The cause of the problem is with the SMIL functionality built into FLVPlayback, they have something along the lines of:

if (extension == ".flv"){
    // play video
}else{
    // it must be a SMIL file
}

So, the trick to getting video files to play that don’t have a .flv extension (eg. youtube videos) is to create a SMIL file that references the actual video, then you load the SMIL file which will load the video file…

A quick SMIL file that worked for me is below:
<smil>
<head>
<layout>
<root-layout width="240" height="180" />
</layout>
</head>
<body>
<video src="HTTP://WWW.EXAMPLE.COM/MYVIDEO?query=1" />
</body>
</smil>

It seems like a really stupid/lazy bit of coding on Adobe’s part… why can’t you check the mime type instead of relying on just the file extension??

Oh, while I’m posting about this, if you’re working in FlexBuilder on an Actionscript project and you want to get access to the fl.* classes then you’ll need to have Flash CS3 installed, then add the SWC’s (take a peek under “Drive/Program Files/Adobe/Adobe Flash CS3/en/Configuration/Components”) to your library path. Using FLVPlaybackAS3.swc with FlexBuilder Linux Alpha works well, I haven’t tried other swc’s.

Filed by Popeye at January 9th, 2008 under Flash, Actionscript 3

If you get into some errors, like 1005;

try to handle your php/asp flv-rendering-source in Flash like:
your-path-way/to/heaven/ STREAM-HANDLER . php / anything-here.flv
.php COULD be .asp here, :-p

Flash adds ?xxxx to the file, so faking an extension in any other way won’t work.

Comment by Robin Casey — February 15th, 2008 @ 8:41 am

Leave a comment