Creates an instance of LoadManager.
The target iframe element to manage.
Cleans up all registered message event listeners previously added by _listenForMessage.
Call this method when the instance is being destroyed or no longer needs to listen to messages.
Initializes the LoadManager by listening for a "loadState" message from the iframe. Resolves when the iframe reports that it's in a "ready" state.
[loadState]
A promise that resolves with {ready: true, state: 'ready'} when the iframe is ready.
If there is no answer after 10 seconds, it will resolve with {ready: false, state: 'timeout'}.
If there is a loadError, it resolves with {ready: false, state: 'loadError'}
[interactionState] Also gives you a promise once the user interacts with the document. This promise needs to be fulfilled before audio can be played through the iframe. If a loadError occurs, the Promise will reject. If a timeout occurs, the Promise will still behave like normal.
Manages the loading state of an iframe and communicates with it via postMessage.