Reply
Contributor
Carol
Posts: 11
Registered: ‎06-10-2011
0 Kudos
Accepted Solution

Detect NetConnection.Connect.Closed

Hi,

I have a custom live streaming solution. This server send a NetStream.Play.Kick_private_show the the connection close.

Can I detect with the player API the NetConnection.Connect.Closed or something else that I can know when the connection close?

 

Here the log on Brightcove debugger:
lc0.18840163620188832    (0:1935) NetStream.Play.Kick_private_show    09:14:10    unknown    DEBUG    MEDIA
lc0.18840163620188832    (0:1935) Closing connection    09:14:10    unknown    DEBUG    MEDIA
lc0.18840163620188832    (0:1935) NetConnection.Connect.Closed    09:14:10    unknown    DEBUG    MEDIA

 

Thank you

Brightcove Team
BC-Iceman
Posts: 101
Registered: ‎10-22-2009
0 Kudos

Re: Detect NetConnection.Connect.Closed

Hi Carol, 

 

You can make use of the Player API to trigger an localized/customized message if the FMS server fails to connect to the player for whatever reason. 

 

When we are unable to load your Player due to various reasons (i.e., invalid ID, deleted player, systems issues, etc) there are various error messages that can be implemented for different scenarios.

 

Each scenario and error message is shown on the documentation below which describes how to customize the messages themselves: 

 

http://support.brightcove.com/en/docs/localizing-player-error-messages

 

First, you will want to create an XML file that contains the code snippet in the above doc. Once this file is created and uploaded to your webspace, you can bring the XML in through the Publishing Code Snippet as follows:

 

JavaScript example:


<param name="localizedErrorXML" value="http://www.domain.com/localized.xml" />

ActionScript example:
config["localizedErrorXML"] = "http://www.domain.com/localized.xml";

 

To further customize the error with your website, you can also change the background color of the BootloaderSWF, by editing the "bgcolor" config parameter so that it matches your background instead of always loading the default #FFFFFF.

 

You or a developer can also use the Player API to fire off custom related error message based on the event by creating specific event handles in the publishing code as documented in the following article:

 

http://support.brightcove.com/en/docs/player-error-handling

 

All the best~

 

Iceman

 

Contributor
Carol
Posts: 11
Registered: ‎06-10-2011
0 Kudos

Re: Detect NetConnection.Connect.Closed

[ Edited ]

The player load the stream successfully (the stream is always available) but the stream send the NetStream.Play.Kick_private_show function and then it disconnect.

So I can't use the templateErrorHandler to target the error. Do you have any other ideas ?

Maybe the FMS server can send a trigger that the player API can retrieve ?

Do you think if the stream disconnect, I can retrieve the error with templateErrorHandler even if im already watching the stream?

 

Thank you

Brightcove Team
BC-Iceman
Posts: 101
Registered: ‎10-22-2009
0 Kudos

Re: Detect NetConnection.Connect.Closed

I did some additional research and when the FMS server registers a NetConnection.Connect.Closed event, it cannot be access by the Player API. Unfortunately, I'm not aware of how this specific implementation can be accomplished.