使用方法:
1、进入[后台],点击顶部到导航[视频],选择左边导航中的[播放器],点击[添加]
1 2 3 4 5 6 7 8 9 |
状态:启用, 编码:aliplayer, 名称:阿里播放器, 备注:aliplayer, 目标窗口,当前, 解析状态:禁用, 解析接口:空, 排序:例如100, 提示:无需安装任何插件 |
2、播放器代码
1 2 |
MacPlayer.Html = '<iframe src="'+maccms.path+'/static/player/aliplayer.html" width="100%" height="'+MacPlayer.Height+'" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>'; MacPlayer.Show(); |
3、保存。
4、进入网站根目录下/static/player/目录中,新建一个名为aliplayer.html文件,复制以下代码到这个文件中。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="IE=edge" > <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/> <title>阿里播放器</title> <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.7/skins/default/aliplayer-min.css"> <script type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.8.7/aliplayer-min.js"></script> <script type="text/javascript" src="https://player.alicdn.com/aliplayer/presentation/js/aliplayercomponents.min.js"></script> <style type="text/css"> body,html{background-color:#000;padding: 0;margin: 0;width:100%;height:100%;} .b-videobottom {width:100%;height:23px;background:#1D1D1D;position:fixed;text-align:center;left:0;z-index:100;} .b-adicon {font-size:12px;color:#555;line-height:23px;display:none;} #zmyy{width:100%;height:100%;padding:0;margin:0;display:block;} </style> </head> <body> <div class="b-videobottom"> <span class="b-adicon" style="display: inline;">广告 > 本播放器,支持记忆播放,多次刷新不从来。</span> </div> <div id="zmyy" class="prism-player"></div> <script type="text/javascript"> var player = new Aliplayer({ "id": "zmyy", "source": parent.MacPlayer.PlayUrl, width: "100%", height: "100%", autoplay: true,//是否自动播放 preload: true,//播放器自动加载 rePlay: false,//是否重播 playsinline: false,//H5是否内置播放 useH5Prism: false,//强制H5播放器 isLive: false,//是否直播 autoPlayDelay: 0, autoPlayDelayDisplayText: '请稍待正在加载...', components: [{ name: 'MemoryPlayComponent', type: AliPlayerComponent.MemoryPlayComponent, args: [true] }], skinLayout:[ {name: "bigPlayButton",align:"blabs",x:30,y:80}, {name:"H5Loading",align:"cc"}, {name:"errorDisplay",align:"tlabs",x:0,y:0}, {name:"infoDisplay"}, {name:"tooltip",align:"blabs",x:0,y:56}, {name:"controlBar",align:"blabs",x:0,y:0, "children":[ {name:"progress",align:"blabs",x:0,y:44}, {name:"playButton",align:"tl",x:15,y:12}, {name:"timeDisplay",align:"tl",x:10,y:7}, {name:"fullScreenButton",align:"tr",x:10,y:12}, {name:"setting",align:"tr",x:15,y:12}, {name:"volume",align:"tr",x:5,y:10} ]} ]}, function (player) { console.log("The player is created"); } ); try{ //document.getElementById('zmyy').style.height = parent.MacPlayer.Height + 'px'; } catch(e){} </script> </body> </html> |
5、通过以下sql语句给每条视频增加一组阿里播放
1 |
update mac_vod set vod_play_from = CONCAT('aliplayer$$$',vod_play_from),vod_play_server=CONCAT('no$$$',vod_play_from) ,vod_play_note='$$$' ,vod_play_url=concat(vod_play_url,'$$$',vod_play_url) |
6、以下为直接更新为阿里播放器播放
1 |
update mac_vod set vod_play_from = 'aliplayer' |
评论前必须登录!
立即登录 注册