HTML5 Single-Page-Application lifecycle

#1

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

#2

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.