HTML5 Single-Page-Application lifecycle

Hello, using the HTML5 player: https://github.com/kaltura/kaltura-player-js

What is the recommended player lifecycle (e.g. player needs to shown/hidden/moved)?

  • can the player be created/destroyed/re-created on demand? How to dispose the player?
  • or should we keep a single player instance? Can it be re-parented? Can the media be unloaded?

Thanks

From my experimentations, the player doesn’t dispose correctly (memory leaks after destroy()) and the instance has to be reused:

kalturaPlayer = KalturaPlayer.setup(config);
...
kalturaPlayer.pause();
kalturaPlayer.destroy();
placeholder.innerHTML = '';
// no good, it leaks!

Good thing though: player DIV can be re-parented so it can be paused/detached and reattached as needed.

hi … is there a solution for this ?
i also can see kWidget.destroy( target ) is retaining references to dom …
Detached HTMLDivElement retained size is big, losing 2+MB every embed/destroy cycle
… this seems like a major issue to have this bug
thanks :slight_smile: