Skip to content

Commit

Permalink
Fix the destroy method
Browse files Browse the repository at this point in the history
destroy() method should remove all traces of the plugin and restore the media element to its original state. At the moment it just removes the container element (with video element itself) which is not an expected behavior
  • Loading branch information
tadaskarpavicius authored Mar 18, 2024
1 parent 20aa772 commit 8742a22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ export default class Player {
this.playerEvents.forEach((event) => {
this.elements.container.removeEventListener(event.type, event.listener)
})
this.elements.container.remove()
this.media.classList.remove('v-media')
this.elements.outerContainer.replaceWith(this.media)
}
}

0 comments on commit 8742a22

Please sign in to comment.