Jump to content
Search Community

Metadata revived listener for a video loader?

Nickbee test
Moderator Tag

Recommended Posts

I'm loading a video like so:

 

		private function loadFlv():void
	{
		_flvLoader = new VideoLoader(_flvPath, {name:"flvLoader", bgColor:0xFFFFFF, autoPlay:false, bufferMode:true, width:_flvWidth, height:_flvHeight, volume:1, onComplete:flvBufferComplete});
		_flvLoader.load();
	}

 

I would like to add an listener for when the metadata is received so I can grab the length of the video. I did not see anything in the greensock docs for this.

 

Thanks!

Link to comment
Share on other sites

Yep, it's in the docs (maybe not obvious enough though) - you just listen for the INIT event which means the metaData has been received (among a few other things).

 

_flvLoader = new VideoLoader(_flvPath, {onInit:videoInitHandler}); //shortened for clarity
function videoInitHandler(event:LoaderEvent):void {
   trace("video metaData says width is " + _flvLoader.metaData.width + " and height is " + _flvLoader.metaData.height);
}

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...