FlowPlayer onError - 更新剪辑URL [英] FlowPlayer onError - updating clip URL

查看:174
本文介绍了FlowPlayer onError - 更新剪辑URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找当流未找到时更改剪辑的URL。我正确地配置了onError事件,因为我可以调试特定行或添加警报,但是我遇到的问题如下:

  onError:function(errorCode,errorMessage){
this.getClip(0).update({url:'http://full-url.com/images/stream-not-found.png '});



$ b $ p
$ b

问题是这个图像从未被加载到错误的播放器上 - - 我得到一个没有找到错误信息的流,然后玩家继续寻找这个未知的流。我能够击中URL并看到图像,但无法在流中找不到。根据文档,它应该能够将图像作为URL,但使用完全限定的或相对的URL似乎并没有工作。



这是有些简化,因为我们正在寻找每个错误代码使用定制的图像。

解决方案

没有真正的答案确定了这一点,最好的可以做的是卸载播放器,并显示加载播放器之前在容器中的HTML。

在这一点上,我们仍然有一个错误号码,所以我们能够使用jQuery来设置html来显示新的图像。



没有代码在我面前,但类似于:

  onError:function(errorCode,errorMessage){
this.unload();
switch(errorCode){
case 200:
$('#idOfPlayer a')。attr('src',link-to-200-error.jpg);
break;
}
}


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

这篇关于FlowPlayer onError - 更新剪辑URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆