您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

alipalyer 直播弹幕组件怎么限制最大显示弹幕数量?更改弹幕透明度?

alipalyer 直播弹幕组件怎么限制最大显示弹幕数量?更改弹幕透明度?

alipalyer 直播弹幕组件怎么限制同一时间最大显示弹幕数量?更改弹幕透明度?
aliplayer弹幕组件

弹幕属性

demo地址

image.png

<!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 Functions</title>
  <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.19/skins/default/aliplayer-min.css" />
  <script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.9.19/aliplayer-min.js"></script>
  <script src="./CommentCoreLibrary.js"></script>
  <!-- 请下载之后使用 -->
  <script type="text/javascript" charset="utf-8" src="/aliplayercomponents-1.0.8.min.js"></script>
</head>
<body>
<div id="player-con"></div>
<script>
  /* The bullet screen component is integrated with CommentCoreLibrary. For more information, see https://github.com/jabbany/CommentCoreLibrary/ */
  var danmukuList = [{
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 2000,
    "size": 25,
    "color": 0xff0000
  }, {
    "mode": 1,
    "text": "test",
    "stime": 30000,
    "size": 25,
    "color": 0xff0000
  }, {
    "mode": 1,
    "text": "test",
    "stime": 4000,
    "size": 25,
    "color": 0x00c1de
  }, {
    "mode": 1,
    "text": "test",
    "stime": 5000,
    "size": 25,
    "color": 0x00c1de
  }, {
    "mode": 1,
    "text": "test",
    "stime": 10000,
    "size": 25,
    "color": 0x00c1de
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }, {
    "mode": 1,
    "text": "test",
    "stime": 1000,
    "size": 25,
    "color": 0xffffff
  }]
  var player = new Aliplayer({
    id: "player-con",
    source: "//player.alicdn.com/video/editor.mp4",
    width: "100%",
    height: "500px",
    autoplay: true,
    isLive: false,
    controlBarVisibility: 'click',    /* The mode of the status bar, which is set to Click. */
    showBarTime: '10000',             /* The time period that you must wait before the status bar is hidden, which is set to 10,000 milliseconds. */
    components: [{
      name: 'AliplayerDanmuComponent',
      type: AliPlayerComponent.AliplayerDanmuComponent,
      args: [danmukuList]
    }]
  }, function (player) {
    console.log("The player is created");
  });
</script>
</body>
</html>
player 2022/2/18 19:30:01 有534人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶