Answer the question
In order to leave comments, you need to log in
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))
}
Answer the question
In order to leave comments, you need to log in
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)
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 questionAsk a Question
731 491 924 answers to any question