2011-09-13 137 views
0
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? 

回答

1

我試圖從目錄中打開瀏覽器中的文件作爲本地html文件,這就是導致事件失敗的原因。我將該頁面上傳到我的域名並對其進行測試,並且事件運行正常。

0

是的,我也一直有這個問題。未經許可的播放器使用回叫,但不是許可的。要嘗試聯繫創作者,看看他們說了些什麼。