FlowPlayer onError - updating clip URL
I am looking to change the URL of a clip when the stream is not found. I am properly configuring the onError event, as I can debug the specific line or add an alert, but what I am having trouble with is the following:
onError : function(errorCode, errorMessage) {
this.getClip(0).update( { url : 'http://full-url.com/images/stream-not-found.png' } );
}
The problem is this image is never being loaded to the player upon the error -- I get a stream not found error message and then the player continues to look for this 'unfound' stream. I'm able to hit the URL and see the image, but am unable to change over upon stream not found. Per the documentation it is supposed to be able to take an image as the URL, but using a fully qualified or relative URL doesn't seem to be working开发者_如何学编程.
This is somewhat simplified as we are looking to use customized images for each error code.
No real answer was determined for this, the best that could be done was to unload the player, and display the HTML which was in the container prior to the player being loaded.
At that point we still had an error number, so we were able to then use jQuery to set the html to display the new image.
Don't have code in front of me, but was similar to:
onError: function(errorCode, errorMessage) {
this.unload();
switch (errorCode) {
case 200:
$('#idOfPlayer a').attr('src', link-to-200-error.jpg);
break;
}
}
精彩评论