Getting video total time? (not dispatching metadata event anymore?)

Hi, I’m using a NetStream object to play a video file on flash and html5 targets. To get the total time of the video, I’m using the NetStream’s client object, like this:

var clientObj:Dynamic = {
  'onMetaData': this.metadataEvent,
  'onImageData': this.imagedataEvent,
  'onPlayStatus': this.playstatusEvent,
  'onCuePoint': this.cuepointEvent
this._stream.client = clientObj;

I noticed that while we had the metadata event dispatched on Flash target, the playstatus was the safe one to rely on html5. This was working fine, but I recently noticed that the metadata is not being dispatched on Flash anymore, with the same code and video file (playstatus on html5 works as expected). This is the first time I’m using it since the latest OpenFL update (I’m using version 4.5.2).

What can I do about it? Is there another way to catch this metadata event? Or is there another way to get the total time of the video loaded at the the NetStream?

An update: if I use an mp4 video, the metadata event is dispatched, but this doesn’t happen if the video is encoded as flv. Unfortunately I’ll need this format as well since I’ll need to support AIR on iOS…

Found the problem. I was using some flvs that were encoded without the metadata information available, so there was no info for the event to dispatch. With flvs encoded using another software, everything seems to be fine.

1 Like