开发者

How to change preview image at onComplete event?

I'm using the following source code to display a video file using jwpalyer.

  jwplayer('mediaplayer').setup({
    'id': 'mediaplayer',
    'width': '649',
    'image': "<?=$siteURL?>/views/index/preview.jpg",       
    'height': '300',
    'file': '<?=siteURL?>/开发者_JAVA技巧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){
        }
    }
  });

I would like to change 'image' at the end of the video. I added 'onComplete' event, but I have no idea how to change 'image' property only.

I have read jwplayer api and googled, had no luck..


Add this inside the onComplete function:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜