Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.8 挂载弹幕组件报错 #268

Open
mirai027 opened this issue Aug 29, 2022 · 1 comment
Open

1.0.8 挂载弹幕组件报错 #268

mirai027 opened this issue Aug 29, 2022 · 1 comment

Comments

@mirai027
Copy link

aliplayercomponents 1.0.8版本,挂载弹幕组件报错 a.CommentManager is not a constructor,播放器无法使用。

官网在线功能演示弹幕功能也无法使用

image

<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.11.0/skins/default/aliplayer-min.css" />
<script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.11.0/aliplayer-h5-min.js"></script>
<script type="text/javascript" charset="utf-8" src="/aliplayercomponents-1.0.8.min.js"></script>
var player = new Aliplayer({
  id: "player-con",
  source: "//player.alicdn.com/video/editor.mp4",
  width: "100%",
  height: "500px",
  cover: 'https://img.alicdn.com/tps/TB1EXIhOFXXXXcIaXXXXXXXXXXX-760-340.jpg',
  /* To set an album art, you must set 'autoplay' and 'preload' to 'false' */
  autoplay: false,
  preload: false,
  isLive: false,
  components: [
    {
      name: 'AliplayerDanmuComponent',
      type: AliPlayerComponent.AliplayerDanmuComponent,
      args: [{
        "mode": 1,            // mode 表示弹幕的类型,参考 弹幕类型 https://github.com/jabbany/CommentCoreLibrary/blob/master/docs/CommentTypes.md
        "text": "test",       // text 表示弹幕的文字内容。注意:在创造弹幕对象后,对 text 的更改将无意义。
        "stime": 1000,        // stime 表示弹幕相对于视频位置的开始时间(ms),0即在视频开始立即出现
        "size": 25,           // 弹幕的文字大小
        "color": 0xffffff     // 文字颜色
      }]
    }
  ]
}, function (player) {
  console.log("The player is created");
});
@zhaoyingzi
Copy link

aliplayercomponents 1.0.8版本,挂载弹幕组件报错 a.CommentManager is not a constructor,播放器无法使用。

官网在线功能演示弹幕功能也无法使用

image

<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.11.0/skins/default/aliplayer-min.css" />
<script charset="utf-8" type="text/javascript" src="https://g.alicdn.com/de/prismplayer/2.11.0/aliplayer-h5-min.js"></script>
<script type="text/javascript" charset="utf-8" src="/aliplayercomponents-1.0.8.min.js"></script>
var player = new Aliplayer({
  id: "player-con",
  source: "//player.alicdn.com/video/editor.mp4",
  width: "100%",
  height: "500px",
  cover: 'https://img.alicdn.com/tps/TB1EXIhOFXXXXcIaXXXXXXXXXXX-760-340.jpg',
  /* To set an album art, you must set 'autoplay' and 'preload' to 'false' */
  autoplay: false,
  preload: false,
  isLive: false,
  components: [
    {
      name: 'AliplayerDanmuComponent',
      type: AliPlayerComponent.AliplayerDanmuComponent,
      args: [{
        "mode": 1,            // mode 表示弹幕的类型,参考 弹幕类型 https://github.com/jabbany/CommentCoreLibrary/blob/master/docs/CommentTypes.md
        "text": "test",       // text 表示弹幕的文字内容。注意:在创造弹幕对象后,对 text 的更改将无意义。
        "stime": 1000,        // stime 表示弹幕相对于视频位置的开始时间(ms),0即在视频开始立即出现
        "size": 25,           // 弹幕的文字大小
        "color": 0xffffff     // 文字颜色
      }]
    }
  ]
}, function (player) {
  console.log("The player is created");
});

请下载新的1.0.8版本的组件,我做了修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants