How can I replace player's poster used to handle errors?

How can I replace player's poster used to handle errors?

THRON Player has some default posters which will be used to handle errors such as:

  • Unsupported device
  • Flash required
  • No channels available for the content
  • Content deleted or not accessible by the user

If you wish to change the default poster with a custom image you can simply use the "onErrorPoster" parameter, providing the URL to your custom image.

Otherwise, if you wish to set up a more complex error handling you will have to intervene directly into the web page where the player is embedded and implement some code. More specifically, first you will have to "listen" player events and intercept possible errors; instructions on how to interact with the player and listen to its events is illustrated in this article. Once you are listening to player's events and once you intercept an error you will have to replace the player's <div> with a custom HTML such as an image or some text.

Here's an example of how your page should look like:

<script type="text/javascript">
    var handlerError = function(errorType){
        if(errorType == "content_not_found"){
            var html = "your custom HTML here"
            $('#id').html(html);
        }
    };
THRONPlayer(<domId>).on("error", handlerError);
 </script>
Was this article helpful?
0 out of 0 found this helpful

Have more questions?

SUBMIT A REQUEST

Hai altre domande?

INOLTRA UNA RICHIESTA

Comments