jquery加载函数与kwidget(kaltura播放器)

时间:2015-04-09 21:26:18

标签: javascript jquery kaltura

我正在使用jquery.load()在jquery中加载一个包含kaltura player嵌入代码的html页面。我们的想法是通过页面上的javascript在div标签中加载视频。

aspx页面中的代码

  <%@ Page Language="C#" AutoEventWireup="true"  CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server"></head>
<body>
<script src="images/jquery-1.9.1.min.js" type="text/javascript"> </script>
            <script type="text/javascript">
                function test() {
                    var light = document.createElement('div');
                    light.id = "light";

                    document.body.appendChild(light);

                    $("#light").load("files/test.html");
                        $("#fade").fadeIn();
                        $("#light").fadeIn(1000);
                        $("#close").fadeIn();

                    return false;
                }
            </script>
<form id="form1" runat="server">
    <asp:LinkButton ID="lb" runat="server" ClientIDMode="AutoID" Text="test" ></asp:LinkButton>
    </form>
</body>
</html>

Test.html文件

<html>
<body>
<script src="http://www.kaltura.com/p/423851/sp/42385100/embedIframeJs/uiconf_id/11598752/partner_id/423851"></script>
<div id="kaltura_player" style="width: px; height: px;"></div>
<script>
kWidget.embed({
  "targetId": "kaltura_player",
  "wid": "_423851",
  "uiconf_id": "11598752",
  "flashvars": {},
  "entry_id": "1_znvt6hgh"
});
</script>
</body>
</html>

从aspx.cs文件中调用函数test()

protected void Page_Load(object sender, EventArgs e)
        {

             lb.OnClientClick = "return test()";

        }

点击按钮加载div中的kaltura视频时出错(id ='light')

Microsoft JScript运行时错误:'kWidget'未定义

如果我们需要包含任何文件或API来克服此错误,请告知我们。感谢。

1 个答案:

答案 0 :(得分:0)

尝试升级播放器版本 - 您使用的是旧版本。 - 我们最新的是v2.31

相关问题