This forum post has moved to the following article:
http://www.wowzamedia.com/forums/content.php?171
Enjoy,
The Wowza Team
This forum post has moved to the following article:
http://www.wowzamedia.com/forums/content.php?171
Enjoy,
The Wowza Team
Last edited by charlie; 10-05-2010 at 12:38 PM.
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
You have to add the callback, eg:com.longtailvideo.jwplayer.utils.NetClient.as
Data is actually handled in this file:Code:/** customCallBack handler. **/ public function customCallback(obj:Object):void { forward(obj, 'captioninfo'); }
And in this function:com.longtailvideo.jwplayer.media.RTMPMediaProvider .as
I happen to know this, but for more support you might need to tap the JW Player forum.Code:function onClientData
Richard
Hi Richard, you rock!I've tried this but they said:
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.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/...am.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.
Is this OK to you for this callback in particular?
Thanks once more!Code:/** 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); } }
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