阿里云播放器(Aliplayer)开发文档

作者 : admin 本文共2796个字,预计阅读时间需要7分钟 发布时间: 2020-05-5 共339人阅读
今天我们来看看Aliplayer(阿里云Web播放器)的实际调试代码 ,因Aliplayer支持Flash和Html5两种播放技术,兼容性不一样,所有在实际运用的时候,大家可按需选择!
支持格式:(阿里云Web播放器SDK,同时支持Flash和Html5两种播放技术。)

Flash 模式(已停止更新):
视频格式:mp4、flv、m3u8、rtmp
视频编码:H.264
音频编码:AAC、MP3
音频格式:MP3
HTML5 模式:

视频格式:mp4、m3u8、flv
视频编码:H.264
音频编码:AAC
音频格式:mp3

更多文档说明

 

Flash直播演示实例:
<!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": "http://cctvalih5ca.v.myalicdn.com/live/cctv13_2/index.m3u8",//播放地址,支持MP4、m3u8
  "width": "100%",
  "height": "500px",
  "autoplay": true,
  "isLive": true,
  "rePlay": false,
  "showBuffer": true,
  "snapshot": false,
  "showBarTime": 5000,
  "useFlashPrism": true,
  "skinLayout": [
    {
      "name": "bigPlayButton",
      "align": "blabs",
      "x": 30,
      "y": 80
    },
    {
      "name": "errorDisplay",
      "align": "tlabs",
      "x": 0,
      "y": 0
    },
    {
      "name": "infoDisplay"
    },
    {
      "name": "controlBar",
      "align": "blabs",
      "x": 0,
      "y": 0,
      "children": [
        {
          "name": "liveDisplay",
          "align": "tlabs",
          "x": 15,
          "y": 25
        },
        {
          "name": "fullScreenButton",
          "align": "tr",
          "x": 10,
          "y": 25
        },
        {
          "name": "volume",
          "align": "tr",
          "x": 10,
          "y": 25
        }
      ]
    }
  ]
}, function (player) {
    console.log("The player is created");
  }
);
</script>
</body>
实际使用时可以吧播放地址改成:“<?php echo($_REQUEST['url']);?>'”那么调用的时候,就是文件链接地址在结尾加上“?url=”加视频地址就可以播放了;此方法使用所有播放器项目哦,下面演示也是参考这里
Html5点播演示实例:
<!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": "https://www.coolcoolcloud.com/btjson.m3u8",//点播地址,使用情参考上面的方法
  "width": "100%",
  "height": "500px",
  "autoplay": true,
  "isLive": false,
  "rePlay": false,
  "playsinline": true,
  "preload": true,
  "controlBarVisibility": "hover",
  "useH5Prism": true
}, function (player) {
    console.log("The player is created");
  }
);
</script>
</body>
1. 本站所有源码、模板、插件等其他资源,都不包含技术服务请大家谅解!
2. 本站提供的所有资源不免费提供个人需要的资源修改、美化、功能定制!
3. 如遇需要解压密码,则解压密码为"www.360mb.net"!
4. 由于源码属于可复制性产品,发货后禁止买家以各种理由退款!!
5. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
6. 如用于商业或者非法用途,与本站无关,一切后果请用户自负!
7. 本站提供资源如遇源码失效,功能异常等等可提供退款服务,可参考退款规则!

360模板吧 » 阿里云播放器(Aliplayer)开发文档

发表评论