I came across one issue in my project, the buttons of the player was missing when another player destroyed.
And I found the issue is that the icons will only has one instance in DOM tree, and when one player destory, the icons' svg will also destroy, therefor will affect another player in the page.
constructor(options) {
this.mounted = false
// because of this line, can only has one icons in dom tree.
if (!document.querySelector('.shk-icons')) {
this.icons = createElement({
className: 'shk-icons',
innerHTML: IconComp,
})
}
this.initEl()
this.initOptions(options)
}
mount(container, supportsPassive) {
// ...
if (this.icons) {
container.append(this.icons)
}
// ...
}
Hi @jessuni
I came across one issue in my project, the buttons of the player was missing when another player destroyed.
And I found the issue is that the
icons
will only has one instance in DOM tree, and when one player destory, the icons' svg will also destroy, therefor will affect another player in the page.