2011-04-25 42 views
4

我使用以下源代碼來顯示使用jwpalyer的視頻文件。如何更改onComplete事件的預覽圖像?

jwplayer('mediaplayer').setup({ 
    'id': 'mediaplayer', 
    'width': '649', 
    'image': "<?=$siteURL?>/views/index/preview.jpg",  
    'height': '300', 
    'file': '<?=siteURL?>/views/index/video.mp4', 

    'flashplayer': '<?=siteURL?>/scripts/jwplayer/player.swf', 
    'modes': [ 
     {type: 'flash', src: '<?=siteURL?>/scripts/jwplayer/player.swf?autostart=true'}, 
     { 
      type: 'html5' 
     }, 

     {type: 'download'} 
    ], 
    'events': { 
     onComplete: function(e){ 
     } 
    } 
    }); 

我想在視頻結尾處更改'圖片'。我添加了'onComplete'事件,但我不知道如何僅更改'圖像'屬性。

我已閱讀jwplayer API和google搜索,沒有運氣..

回答

4

添加這個onComplete函數內部:

this.load({ 
    "file": "originalvideofile.mp4", 
    "image": "newimage.jpg" 
}); 
+1

我的版本是6.12。但是這種方法不適用於chrome。任何其他的選擇? – 2015-11-18 12:54:09