aliplayer 阿里播放器的记忆功能很给力,这篇整合教程加了阿里播放器的记忆功能,去除了弹幕,资源预加载等功能。
使用方法:
1、进入[后台],点击顶部到导航[视频],选择左边导航中的[播放器],点击[添加] :
状态:启用,
编码:aliplayer,
名称:阿里播放器,
备注:aliplayer,
目标窗口,当前,
解析状态:禁用,
解析接口:空,
排序:例如 100,
提示:无需安装任何插件
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/
目录中,新建一个名为
文件,复制以下代码到这个文件中。
<!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>
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
- 最新
- 最热
只看作者