HTML5 Single-Page-Application lifecycle

Hello, using the HTML5 player:

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?


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

kalturaPlayer = KalturaPlayer.setup(config);
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.