A
A
Arthur2014-09-30 13:38:48
ActionScript
Arthur, 2014-09-30 13:38:48

Why doesn't onMetaData fire when playing a stream?

Good afternoon!
We use Wowza Media Server 4.1.0,
there is a viewer that views the stream.
everything works, the stream is played,
but the onMetaData event does not fire
code:

var meta:Object = new Object()
meta.onMetaData = onMetaData
ns = new NetStream(nc)	
ns.client = meta

public function onMetaData(info:Object):void
{
  this.dispatchEvent(new Event(EVENT_HIDE_LOADER))
}

Whether there can be a reason that the server does not send metadata?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arthur, 2015-05-29
@Headshrinker

I don’t remember what the jamb was, but I did it this way and it worked:

var meta:Object = {};
//при получении метаданных
meta.onMetaData = onMetaData;
//при получении текстовых данных (например субтитров)
meta.onTextData = onTextData;
ns = new NetStream(nc);
ns.client = meta;
//определение обработчика состояния стрима
ns.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
this.dispatchEvent(new Event(EVENT_CONNECT_SUCCESS));
this.attachNetStream(ns)

A
Alexander Mylchenko, 2015-01-29
@ERrorMAKros

Namely, the stream translator must send the metadata to the media server (immediately after the start of the broadcast), ... and only after that, the metadata will get to the clients.
To send metadata to the server, this is suitable:

var stream:NetStream = new NetStream();
stream.publish();
var meta:Object = {
  x: 10,
  y: 20,
  name: "test",
  //	...any info;
}

stream.send("@setDataFrame", "onMetaData", meta);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question