FlowPlayer onError - updating clip URL

匆匆过客 提交于 2019-12-11 11:08:21

问题


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.


回答1:


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;
    }
}


来源:https://stackoverflow.com/questions/3311713/flowplayer-onerror-updating-clip-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!