Jump to content
Search Community

found bug on initEvent in VideoLoader

boogie test
Moderator Tag

Recommended Posts

Hi, I think I found a bug when I try to load a video and access to the onInit event.

 

I made a simple test that you can copy and paste on an as file or a fla file:

 

import com.greensock.loading.VideoLoader;
import com.greensock.loading.data.VideoLoaderVars;

// flv works ok, see example below:			
// var _url : String = "http://cdn.liverail.com/adasset/229/331/hi.flv"
// MP4 is not OK , it si doing Two onInitEvent
var _url : String = "http://streaming.openvideoads.org/shows/the-black-hole.mp4"
var videoVars : VideoLoaderVars = new VideoLoaderVars();
videoVars.onInit(onInitEvent);
videoVars.bufferTime(3);
videoVars.allowMalformedURL(true);
// videoVars.autoPlay(false);
videoVars.autoAdjustBuffer(true);
videoVars.container(this.stage);
var videoLoader : VideoLoader = new VideoLoader(_url,videoVars);
videoLoader.load();		

function onInitEvent(event:Event) : void {
		trace("onInitEvent")
}

 

As you can see if I use the URL that has a FLV file, the onInitEvent is fired 1 time

But if I use the URL that has a mp4 file, the onInitEvent is fired 2times !!!

 

I test this isue with a previous version on greensock and with the latest version (just downloaded) and I get the same result.

 

 

Any ideas?

 

Thanks

 

Rodrigo

Link to comment
Share on other sites

That's not a bug in VideoLoader - that's an issue with Flash's NetStream. You can verify it for yourself. It calls the onMetaData twice for MP4s and typically it has different data each time. Weird, I know. I thought about adding code in VideoLoader to ignore one of those but there are dangers involved with that too, so I left it as-is. It's pretty shocking how many bugs and inconsistencies there are in Adobe's NetStream implementation. VideoLoader works around the vast majority of them but this one is a bit trickier and it isn't exactly a show-stopper from what I can tell so I didn't get super aggressive with injecting code to ignore one of the events based on what type of file it is, etc.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...