h5阿里云播放器 常规使用

  • Post author:
  • Post category:其他


阿里云播放器:

引入js和css

<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.8.1/aliplayer-min.js"></script>
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.1/skins/default/aliplayer-min.css" />

初始化:source一定要设置,不能空,会报错

 $(document).ready(function () { 
        player = new Aliplayer({
	    "id": "J_prismPlayer",
	    "source": "XXX",
	    "width": "100%",
	    "height": "800px",
	    "autoplay": false,
	    "isLive": false,
	    "rePlay": true,
	    "playsinline": true,
	    "preload": true,
	    "controlBarVisibility": "hover",
	    "useH5Prism": true
    }, function (player) {
    	player._switchLevel = 0;
	    }
    );
 });	

更改播放视频:

   	 //加载已关注直播间数据    
function browseDate(url){
	//改变视频内容
	player.loadByUrl(url);
}  



版权声明:本文为maxiaole_z原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。