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

控制台报错: ispots.map is not a function at initDotsAPI (dotsApi.js:257:27)以及动态更新视频配置问题 #1624

Open
jiangxiaoxilsy opened this issue Sep 27, 2024 · 0 comments

Comments

@jiangxiaoxilsy
Copy link

您使用的西瓜播放器版本是多少? What version of xgplayer are you using?
"xgplayer": "^3.0.20",
"xgplayer-flv": "^3.0.20",
"xgplayer-flv.js": "^3.0.20",
"xgplayer-hls": "^3.0.20",
"xgplayer-hls.js": "^3.0.20",
"xgplayer-mp4": "^3.0.20"

您使用的操作系统和浏览器分别是? What OS and browser are you using?

windows + 谷歌
如何复现问题? How to reproduce the problem?
data () {
return {
player: null,
pluginsType: {
mp4: [],
hls: [HlsPlugin],
flv: [FlvPlugin]
}
}
},
initChart () {
const player = new Player({
...this.config.props.option,
id: 'mse' + this.config.code,
plugins: this.pluginsType[this.config.props.type]
})
if (player) {
this.player = player
/* 这里注册监听 */
// 监听视频开始播放 播放传给父组件的是true
this.player.on('play', () => {
this.$emit('triggerEvent', true)
})
// 监听视频已经暂停 暂停传给父组件的是true
this.player.on('pause', () => {
this.$emit('triggerEvent', false)
})
}
},
// 更新图表配置
updateChartStyle () {
if (this.player) {
this.player.destroy()
this.player = null
}
this.initChart()
}

1、初始化调initChart () ,播放器可以出来,但是控制台报 ispots.map is not a function ,这个错误是你们插件内部错误,是因为配置不对吗?
2、当我动态改变播放器的设置时(比如时间、倍速、静音、封面图等等,调用你们提供的更新配置的方式不生效(下面就是之前更新配置的方法:
this.player.playNext(this.config.props.option)
this.player.poster = this.config.props.option.poster
我只能暂时销毁实例然后重新创建实例
if (this.player) {
this.player.destroy()
this.player = null
}
this.initChart()

您期望的播放器正常行为是? What did you expect to happen?
1、控制台不报错
2、动态修改播放器的配置时,不需要重新构建实例

实际播放器的表现是? What actually happened?
1、播放器报错
2、playNext方法不太生效

可填写您所在的公司和相关产品业务,方便我们提供更好的技术支持 You can write your company and product which uses xgplayer, for helping us provide better technical support.
案例不太方便上传,但是基本的逻辑已经列出了,还请能提供一些宝贵的建议和指导,万分感谢

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

1 participant