jwplayer事件不起作用

时间:2011-09-13 10:36:46

标签: events callback jwplayer

i'm having trouble using jwplayer events to work. i have jwplayer 5.7.1896 (Licensed version) and i'm trying to use the onReady and onPlay events to send an ajax callback to my application.

Following is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>My InterviewLink</title>
    <script src='http://staging.myinterviewlink.com/javascripts/jwplayer/jwplayer.js'></script>
  </head>
<body>
 <div id='mediaspace'></div>
   <script type='text/javascript'>
        jwplayer('mediaspace').setup({
         autostart: false,
         allowscriptaccess: "always",
         file: 'http://c200581.r81.cf1.rackcdn.com/5a317e302f993e494ccea617c9796eeb_other_video_2.mp4',
         flashplayer: 'http://staging.myinterviewlink.com/javascripts/jwplayer/player.swf',
         'logo.file': 'http://staging.myinterviewlink.com/images/mil-bottom-logo-bottomspace.png',
         'logo.hide': false, 'logo.link': 'http://www.myinterviewlink.com/',
         image: 'http://c200581.r81.cf1.rackcdn.com/16a944899647b38dc7ab083c0299d601_other_video_2.jpg',
         skin: 'http://staging.myinterviewlink.com/javascripts/jwplayer/skins/glow.zip',
         frontcolor: 'ffffff',
         lightcolor: 'cc9900',
         screencolor: 'ffffff',
         stretching: 'exactfit',
         controlbar: 'over',
         width: '660',
         height: '380',
         events: {
        onReady: function(){alert('im ready')},
        onPlay: function(){alert('lets play')}
         }
    });
   </script>
</body>
</html>

let me know if there's something that i'm missing here?

2 个答案:

答案 0 :(得分:1)

我试图从目录中打开浏览器中的文件作为本地html文件,这就是导致事件失败的原因。我将页面上传到我的域并进行了测试,事件运行正常。

答案 1 :(得分:0)

是的,我也遇到过这个问题。未经许可的播放器使用回调,但不是许可的。试着联系创作者,看看他们说了什么。