Skip to content

Commit

Permalink
fix: 🐛(xgplayer) 修复调用definition插件的changeDefinitionList方法后内部还是使用初始定义的d…
Browse files Browse the repository at this point in the history
…efinition.list的bug
  • Loading branch information
chenrui.92__dcar committed Oct 24, 2024
1 parent 67194ee commit cabfdd7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/xgplayer/src/plugins/definition/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ export default class DefinitionIcon extends OptionsIcon {
if (!Array.isArray(list)) {
return
}

if (this.player.config.definition) {
this.player.config.definition.list = list
}

this.config.list = list.map(item => {
if (!item.text && item.name) {
item.text = item.name
Expand All @@ -152,7 +157,7 @@ export default class DefinitionIcon extends OptionsIcon {
}

onItemClick (e, data) {
const { definitionList } = this.player
const { list: definitionList } = this.config
super.onItemClick(...arguments)
this.emitUserAction(e, 'change_definition', { from: data.from, to: data.to })
for (let i = 0; i < definitionList.length; i++) {
Expand Down

0 comments on commit cabfdd7

Please sign in to comment.