NetStream, IOErrorEvent, URLRequest and other woes

I've been adding some details to ZVideo for this tuto in Cristalab and I've found a couple of oddities regarding the NetStream object. First, mandatory link to the reference of NetStream.play() where we can read:

If the video file can't be found, the netStatus event is dispatched


Ok, that sounds great and indeed works, but then, when and why is the IOErrorEvent dispatched? I'd have thought it would be dispatched precisely when the FLV can't be found.

Moving on. The very same method, a little below:

...arguments — The location of the video file to play, as a URLRequest object or a string


But whenever I try to use an URLRequest object instead of a simple string, nothing happens. No events fired, nothing. Joseba pointed out that it might be an error on the docs, but at least Flex 3.2 compiler doesn't complain and Flash player 10 doesn't throw any exception.

More. Why do we need a client object to listen to some events (onMetaData) but not to others (netStatus)?

Metadata, interesting stuff uh? Well not so much because it doesn't follow any standard. You want to know the size of your video? You wait for the metadata to come and then you realize that the information depends on the software used to encode the video. That means a video from Youtube has different metadata than a video from DailyMotion. Wouldn't be great having a standard for metadata? Couldn't Adobe force this somehow? At least width, height and duration. Then let them add anything they want, but at least that information should be always present.

Extra ball: when I was looking for open bugs related to these issues I've found this classic: NetStream / Progressive download is not resolving relative URLs in the expected way:

When using progressive download (FLV), NetStream's .play(url) method is not resolving relative URLs in the expected way. Instead of being based off the HTML's embed location and reading the "base" param, it uses the location of the SWF file trying to load it.


This has happened to every Flash developer on Earth. Why paths for external assets are always relative to the HTML page BUT not for videos?

Back to index