- add JS API to query for presenter user id

This commit is contained in:
Richard Alam 2013-02-13 17:05:59 +00:00
parent b5141883f1
commit 37db82c67a
3 changed files with 28 additions and 0 deletions

View File

@ -71,6 +71,15 @@
}
}
BBB.getPresenterUserID = function(callback) {
var swfObj = getSwfObj();
if (swfObj) {
if (typeof callback === 'function') {
callback(swfObj.getPresenterUserID());
}
}
}
/**
* Query the Flash client for the user's role.
* Params:

View File

@ -28,6 +28,15 @@ package org.bigbluebutton.core
public class UsersUtil
{
public static function getPresenterUserID():String {
var presenter:BBBUser = UserManager.getInstance().getConference().getPresenter();
if (presenter != null) {
return presenter.userID;
}
return "";
}
public static function amIPublishing():CameraSettingsVO {
return UserManager.getInstance().getConference().amIPublishing();
}

View File

@ -56,6 +56,7 @@ package org.bigbluebutton.main.api
ExternalInterface.addCallback("switchPresenterRequest", handleSwitchPresenterRequest);
ExternalInterface.addCallback("getMyUserInfoSync", handleGetMyUserInfoSynch);
ExternalInterface.addCallback("getMyUserInfoAsync", handleGetMyUserInfoAsynch);
ExternalInterface.addCallback("getPresenterUserID", handleGetPresenterUserID);
ExternalInterface.addCallback("getMyUserID", handleGetMyUserID);
ExternalInterface.addCallback("getExternalMeetingID", handleGetExternalMeetingID);
ExternalInterface.addCallback("joinVoiceRequest", handleJoinVoiceRequest);
@ -179,6 +180,15 @@ package org.bigbluebutton.main.api
return UsersUtil.internalUserIDToExternalUserID(UsersUtil.getMyUserID());
}
private function handleGetPresenterUserID():String {
var presUserID:String = UsersUtil.getPresenterUserID();
if (presUserID != "") {
return UsersUtil.internalUserIDToExternalUserID(presUserID);
}
// return an empty string. Meeting has no presenter.
return "";
}
private function handleGetExternalMeetingID():String {
return UserManager.getInstance().getConference().externalMeetingID;
}