feat(external-api) introduce a "ready" event

It's fired when the API is ready, and it signals the embedder that they
can reveal the meeting from behind an overlay, for example.

The astute reader might notice we are currently sending a
'browser-support' event roughly at the same time. The reason for this
new event is plain simply semantics.

In addition the 'onload' handler is faked by calling it when the new
ready event fires. The original onload event is unreliable. It will be
called even when nothing was ever loaded (try loading a page without
internet and be amused).
This commit is contained in:
Saúl Ibarra Corretgé
2023-10-17 14:54:54 +02:00
committed by Saúl Ibarra Corretgé
parent 631e39d4fd
commit 59242e1217
2 changed files with 18 additions and 9 deletions

View File

@@ -1107,7 +1107,11 @@ class API {
this._enabled = true;
initCommands();
this.notifyBrowserSupport(isSupportedBrowser());
// Let the embedder know we are ready.
this._sendEvent({ name: 'ready' });
}
/**