本文介绍了JWPlayer 5-如何在播放器上添加下载链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是播放器的提包

jwplayer("flvplayer").setup({
 file: "$direct_link",
 flashplayer: "$c->{site_url}/player/$name.swf",
 image: "$file->{video_img_url}",
 duration:"$file->{vid_length}",
 width: $file->{vid_width},
 height: $file->{vid_height},
 provider: 'http',
 modes: [ { type: "flash", src: "$c->{site_url}/player/$name.swf" },{ type: "html5", config:     {file:'$direct_link','provider':'http'} }, { type: "download" } ]  });

我想添加一个下载链接按钮,例如此网站上的播放器,例如>> http://www. mp4upload.com/a6hxfn9hdxuy

I want to add a download link button, like player on this website, example >> http://www.mp4upload.com/a6hxfn9hdxuy

你们能帮我吗?

感谢:D

推荐答案

这很容易- http://support.jwplayer.com/customer/portal/articles/1436999-example-adding-a-download-button

​<script>
jwplayer().addButton(
//This portion is what designates the graphic used for the button
   "/uploads/myButton.png",
//This portion determines the text that appears as a tooltip
   "Download Video",
//This portion designates the functionality of the button itself
   function() {
//With the below code, we're grabbing the file that's currently playing
   window.location.href = jwplayer().getPlaylistItem()['file'];
 },
//And finally, here we set the unique ID of the button itself.
"download"
);
</script>

这篇关于JWPlayer 5-如何在播放器上添加下载链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 13:34