THEOplayer / web-ui

UI component library for the THEOplayer Web SDK
https://www.theoplayer.com/docs/open-video-ui/web/
MIT License
10 stars 0 forks source link

Fix `ui.player.destroy()` #62

Closed MattiasBuelens closed 4 months ago

MattiasBuelens commented 4 months ago

Web UI wasn't correctly removing all its event listeners when THEOplayer is destroyed through ui.player.destroy() (where ui is a <theoplayer-default-ui> or <theoplayer-ui>). This caused a whole bunch of errors when those event listeners fire while the player is being destroyed.

React UI now calls player.destroy() during unmount, if for some reason that didn't happen yet. (Normally, this happens automatically when the custom element is disconnected from the DOM.)

Fixes #59