在Cms中配置阿里播放器
以苹果CMS10 为例
首先新建一个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>Aliplayer Online Settings</title>
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.8/skins/default/aliplayer-min.css" />
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.8/aliplayer-min.js"></script>
</head>
<body>
<div class="prism-player" id="player-con"></div>
<script>
var player = new Aliplayer({
"id": "player-con",
"source": parent.MacPlayer.PlayUrl,
"width": "100%",
"height": "620px",
"autoplay": true,
"isLive": false,
"rePlay": false,
"playsinline": true,
"preload": true,
"controlBarVisibility": "hover",
"useH5Prism": true
}, function (player) {
console.log("The player is created");
}
);
</script>
</body>
MACCMS中的配置
以此点开视频–播放器–添加;
状态:启用,编码:aliplayer(与html文件同名即可),名称:阿里播放器;播放器代码:
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();
保存后,在视频数据中添加一组播放器就可以正常使用了。
通过以下sql语句给每条视频增加一组阿里播放;
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)
以下为直接更新为阿里播放器播放
update mac_vod set vod_play_from = 'aliplayer'