Wowza Community

IMediaStreamActionNotify2 Stream Watchdog

https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog

I’m sorry to bring back an old post but nowdays it’s all about AS3. How can I add that callback to the JW Player version 5?

They tell me I should place the code in the NetClient.as file (src/com/longtailvideo/jwplayer/utils/NetClient.as) but I can’t figure out how to do it. Any advice or better yet, an example?

This is the only piece of functionality I’m missing to start streaming.

Thanks!!!

Callbacks in JW player are handled in

com.longtailvideo.jwplayer.utils.NetClient.as

You have to add the callback, eg:

/** customCallBack handler. **/
		public function customCallback(obj:Object):void {
			forward(obj, 'captioninfo');
		}

Data is actually handled in this file:

com.longtailvideo.jwplayer.media.RTMPMediaProvider.as

And in this function:

function onClientData

I happen to know this, but for more support you might need to tap the JW Player forum.

Richard

That would work, the callback will be handled right there. If you need the data in the RTMP provider, which you might, you should leave the forward mechanism in place and handle the data that is returned in com.longtailvideo.jwplayer.media.RTMPMediaProvider.as in the onClientData. You have to add a case to that function.

With JW Player and Flash Builder, it is fairly painless to step through this with the debugger and look at all the data that is available, etc.

Richard

Hi Richard, you rock!

I happen to know this, but for more support you might need to tap the JW Player forum

I’ve tried this but they said:

I can’t really provide code for you, but I can tell you how the NetClient class works. If you set the NetStream.client property to some object, the stream will call all of its callback functions on this object (see http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html#client). In the JWPlayer, the NetClient class is used for this purpose, and all of the NetStream callbacks are defined here.

When one of the callbacks are received, the NetClient class packages up the data and sends it back to the MediaProvider, by calling the provider’s onClientData() function, passing the data back that way.

and there are LOTS of ppl like me that need things like this but they won’t provide support for it. Their forum is filled with answers like that.

Is this OK to you for this callback in particular?

/** customCallBack handler. **/
public function customCallback(clientObj:Object):void
{
	clientObj.streamStats = function(streamName:String,currSeq:String,msg:String,date:String):void
	{
		trace("Stream stats. Name: " + streamName + " currSeq: " + currSeq + " msg: " + msg + " date: " + date);
	}
}

Thanks once more!