Kaltura - onKdpReady从未打过电话

时间:2014-07-24 21:33:49

标签: javascript kaltura

我的HTML代码

<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TEST</title>

</head> <body>  <object id="kaltura_player_1406237220" name="kaltura_player_1406237220" type="application/x-shockwave-flash" allowFullScreen="true" allowNetworking="all" allowScriptAccess="always" height="333" width="400" bgcolor="#000000" style="width: 400px; height: 333px;" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video"       resource="https://cdnapisec.kaltura.com/index.php/kwidget/cache_st/1406237220/wid/_1737042/uiconf_id/25101282/entry_id/1_jghjj7an" data="https://cdnapisec.kaltura.com/index.php/kwidget/cache_st/1406237220/wid/_1737042/uiconf_id/25101282/entry_id/1_jghjj7an">      <param name="allowFullScreen" value="true" />       <param name="allowNetworking" value="all" />        <param name="allowScriptAccess" value="always" />       <param name="bgcolor" value="#000000" />        <param name="flashVars" value="emptyF=onKdpReady&readyF=onKdpReady" />      <param name="movie" value="https://cdnapisec.kaltura.com/index.php/kwidget/cache_st/1406237220/wid/_1737042/uiconf_id/25101282/entry_id/1_jghjj7an" />

        <a rel="media:thumbnail" href="http://cdnbakmi.kaltura.com/p/1737042/sp/173704200/thumbnail/entry_id/1_jghjj7an/version/100000/acv/101"></a> <span property="dc:description" content=""></span> <span property="media:title" content="1mb.mp4"></span> <span property="media:width" content="400"></span> <span property="media:height" content="333"></span> <span property="media:type" content="application/x-shockwave-flash"></span> <a href="http://corp.kaltura.com/products/video-platform-features">Video          Platform</a> <a href="http://corp.kaltura.com/Products/Features/Video-Management">Video Management</a> <a href="http://corp.kaltura.com/Video-Solutions">Video Solutions</a> <a href="http://corp.kaltura.com/Products/Features/Video-Player">Video Player</a>  </object> </body> </html>

我的JS代码

function onKdpReady(playerId) {
    alert("THIS IS NEVER CALLED");
}

这是JSFiddle:

http://jsfiddle.net/5ugsr/2/

我使用了这个例子:

http://www.kaltura.org/kdp_js_api_demo_page.html

我不知道我是否遗漏了某些东西,或者这是否是一个错误。

另外作为一个侧面问题,我希望它与HTML5播放器兼容,这可以解决这个问题,还是我还做了其他的事情?

1 个答案:

答案 0 :(得分:1)

您使用https并且测试页面是http - javascript通信必须在同一协议中。 除了jsfiddler上的某些原因你需要把函数放在html里面(不要问我为什么)

〔实施例:

        <object id="kaltura_player_1406237220" name="kaltura_player_1406237220" type="application/x-shockwave-flash" allowFullScreen="true" allowNetworking="all" allowScriptAccess="always" height="333" width="400" bgcolor="#000000" style="width: 400px; height: 333px;" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video"
        resource="http://cdnapisec.kaltura.com/index.php/kwidget/cache_st/1406237220/wid/_1737042/uiconf_id/25101282/entry_id/1_jghjj7an" data="http://cdnapisec.kaltura.com/index.php/kwidget/cache_st/1406237220/wid/_1737042/uiconf_id/25101282/entry_id/1_jghjj7an">
        <param name="allowFullScreen" value="true" />
        <param name="allowNetworking" value="all" />
        <param name="allowScriptAccess" value="always" />
        <param name="bgcolor" value="#000000" />
        <param name="movie" value="http://cdnapisec.kaltura.com/index.php/kwidget/cache_st/1406237220/wid/_1737042/uiconf_id/25101282/entry_id/1_jghjj7an" />


    </object>
<script>
    function jsCallbackReady(pid){
alert(pid);
}
</script>