2011-04-25 31 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