苹果CMS添加阿里播放器aliplayer

 admin   2022-05-25 17:35   217 人阅读  0 条评论

一、进入后台,添加播放器

状态:启用,
编码:aliplayer,
名称:阿里播放器,
备注:aliplayer,
目标窗口,当前,
解析状态:禁用,
解析接口:空,
排序:例如100,
提示:无需安装任何插件

图片.png


二、播放器代码

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();

图片.png


三、进入网站根目录的/static/player目录下,新建aliplayer.html

将以下代码复制到文件中

<!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>

本文地址:https://liuchunjie.top/?id=347
版权声明:本文为原创文章,版权归 admin 所有,欢迎分享本文,转载请保留出处!

 发表评论


表情

还没有留言,还不快点抢沙发?