Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Message handling from Server

I have actually trivial task. On the server side (Wowza) I do some authentication and in case of error the server returns some message

for example
sendClientOnStatusError(client, "NetStream.Publish.Denied", "The password is invalid");

Here is the documentation for this function, java.lang.String, java.lang.String) :

Send an error message to the client-side client.onStatus handler

I am trying to handle this message on client side in order to display it to a user. So I use:

jwplayer("videoDiv").onError( function(event){
document.getElementById('status').innerHTML = "ERROR: " + event.message;

But the callback is not called.
How can I communicate between server and client sending just plain messages?

1 Community Answers

Cooper Reid

JW Player Support Agent  
0 rated :

Hi -
I’m afraid there is no way to communicate directly between our player API and your server. If your video server sends a failed response back to our player, our player will trigger a generic ‘onError’ or ‘onSetupError’ event handler. You can leverage one of these to show a custom message,but you will not be able to pull the message from the server, it will have to be hardcoded in your javascript.

This question has received the maximum number of answers.