How to change preview image on onComplete event?

I am using the following source code to display a video using jwpalyer.

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){ } } }); 

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

I read jwplayer api and googled, no luck ..

+4
source share
1 answer

Add this inside the onComplete function:

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

All Articles