diff --git a/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js b/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js index 705fdfa35a69f2c8ee10ce8f4c53527d5e009bd5..07015f16ad74f09a41365b48f5823d40e4f3d8c8 100755 --- a/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js +++ b/bigbluebutton-client/resources/prod/lib/bbb_api_bridge.js @@ -242,6 +242,7 @@ swfObj.sendPrivateChatRequest(fontColor, localeLang, message, toUserID); } } + /* *********************************************************************************** * Broadcasting of events to 3rd-party apps. @@ -305,6 +306,18 @@ callback; } + // Flag to indicate that the SWF file has been loaded and ready to handle calls. + var swfReady = false; + BBB.swfClientIsReady = function () { + console.log("BigBlueButton SWF is ready."); + swfReady = true; + } + + // Third-party JS apps should use this to query if the BBB SWF file is ready to handle calls. + BBB.isSwfClientReady = function() { + return swfReady; + } + /************************************************ * EVENT NAME CONSTANTS * diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as b/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as index 9b68ab3cce4e12d792f44d95d7a029bbbe34ba64..26967e56e51cfbab7430df572d662eacadb9b5a5 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/api/ExternalApiCallbacks.as @@ -61,6 +61,12 @@ package org.bigbluebutton.main.api ExternalInterface.addCallback("sendPrivateChatRequest", handleSendPrivateChatRequest); ExternalInterface.addCallback("lockLayout", handleSendLockLayoutRequest); } + + // Tell out JS counterpart that we are ready. + if (ExternalInterface.available) { + ExternalInterface.call("BBB.swfClientIsReady"); + } + } private function handleIsUserPublishingCamRequestAsync(userID:String):void {