- add api call when user is sharing webcam
This commit is contained in:
parent
710901a745
commit
c95e8470d4
@ -22,6 +22,8 @@ package org.bigbluebutton.core
|
||||
public static const AM_I_PRESENTER_RESP:String = 'AmIPresenterQueryResponse';
|
||||
public static const AM_I_SHARING_CAM_RESP:String = 'AmISharingCamQueryResponse';
|
||||
|
||||
public static const I_AM_SHARING_CAM:String = 'IAmSharingCamEvent';
|
||||
public static const CAM_STREAM_SHARED:String = 'CamStreamSharedEvent';
|
||||
public static const USER_JOINED:String = 'UserJoinedEvent';
|
||||
public static const USER_LEFT:String = 'UserLeftEvent';
|
||||
public static const NEW_ROLE:String = 'NewRoleEvent';
|
||||
|
@ -1,7 +1,6 @@
|
||||
package org.bigbluebutton.main.api
|
||||
{
|
||||
import flash.external.ExternalInterface;
|
||||
|
||||
import flash.external.ExternalInterface;
|
||||
import org.bigbluebutton.common.LogUtil;
|
||||
import org.bigbluebutton.core.EventConstants;
|
||||
import org.bigbluebutton.core.UsersUtil;
|
||||
@ -14,8 +13,33 @@ package org.bigbluebutton.main.api
|
||||
import org.bigbluebutton.main.events.UserJoinedEvent;
|
||||
import org.bigbluebutton.main.events.UserLeftEvent;
|
||||
import org.bigbluebutton.main.model.users.BBBUser;
|
||||
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
|
||||
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
|
||||
|
||||
public class ExternalApiCalls {
|
||||
|
||||
public function handleStreamStartedEvent(event:StreamStartedEvent):void {
|
||||
var payload:Object = new Object();
|
||||
payload.eventName = EventConstants.CAM_STREAM_SHARED;
|
||||
payload.userID = UsersUtil.internalUserIDToExternalUserID(event.userID);
|
||||
payload.streamName = event.stream;
|
||||
|
||||
broadcastEvent(payload);
|
||||
}
|
||||
|
||||
public function handleBroadcastStartedEvent(event:BroadcastStartedEvent):void {
|
||||
var payload:Object = new Object();
|
||||
payload.eventName = EventConstants.AM_I_SHARING_CAM_RESP;
|
||||
payload.isPresenter = UsersUtil.amIPresenter();
|
||||
payload.streamName = event.stream;
|
||||
payload.isPublishing = event.camSettings.isPublishing;
|
||||
payload.camIndex = event.camSettings.camIndex;
|
||||
payload.camWidth = event.camSettings.camWidth;
|
||||
payload.camHeight = event.camSettings.camHeight;
|
||||
|
||||
broadcastEvent(payload);
|
||||
}
|
||||
|
||||
public function handleAmISharingCamQueryEvent(event:AmISharingWebcamQueryEvent):void {
|
||||
var camSettings:CameraSettingsVO = UsersUtil.amIPublishing();
|
||||
|
||||
|
@ -31,11 +31,23 @@
|
||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||
import org.bigbluebutton.main.events.UserJoinedEvent;
|
||||
import org.bigbluebutton.main.events.UserLeftEvent;
|
||||
import org.bigbluebutton.main.model.users.events.BroadcastStartedEvent;
|
||||
import org.bigbluebutton.main.model.users.events.StreamStartedEvent;
|
||||
]]>
|
||||
</mx:Script>
|
||||
<!--
|
||||
Listen for events we are interested to forward to the external container..
|
||||
-->
|
||||
|
||||
|
||||
<EventHandlers type="{StreamStartedEvent.STREAM_STARTED}" >
|
||||
<MethodInvoker generator="{ExternalApiCalls}" method="handleStreamStartedEvent" arguments="{event}"/>
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{BroadcastStartedEvent.BROADCAST_STARTED_EVENT}" >
|
||||
<MethodInvoker generator="{ExternalApiCalls}" method="handleBroadcastStartedEvent" arguments="{event}"/>
|
||||
</EventHandlers>
|
||||
|
||||
<EventHandlers type="{AmIPresenterQueryEvent.AM_I_PRESENTER_QUERY}" >
|
||||
<MethodInvoker generator="{ExternalApiCalls}" method="handleAmIPresenterQueryEvent" arguments="{event}"/>
|
||||
</EventHandlers>
|
||||
|
@ -20,15 +20,18 @@
|
||||
{
|
||||
import flash.events.Event;
|
||||
|
||||
import org.bigbluebutton.core.vo.CameraSettingsVO;
|
||||
|
||||
public class BroadcastStartedEvent extends Event
|
||||
{
|
||||
public static const BROADCAST_STARTED_EVENT:String = "BROADCAST_STARTED_EVENT";
|
||||
|
||||
public var stream:String;
|
||||
public var userid:String;
|
||||
|
||||
public function BroadcastStartedEvent(type:String = BROADCAST_STARTED_EVENT)
|
||||
{
|
||||
public var isPresenter:Boolean;
|
||||
public var camSettings:CameraSettingsVO;
|
||||
|
||||
public function BroadcastStartedEvent(type:String = BROADCAST_STARTED_EVENT) {
|
||||
super(type, true, false);
|
||||
}
|
||||
|
||||
|
@ -252,6 +252,9 @@ package org.bigbluebutton.modules.videoconf.maps
|
||||
var broadcastEvent:BroadcastStartedEvent = new BroadcastStartedEvent();
|
||||
broadcastEvent.stream = e.stream;
|
||||
broadcastEvent.userid = UsersUtil.getMyUserID();
|
||||
broadcastEvent.isPresenter = UsersUtil.amIPresenter();
|
||||
broadcastEvent.camSettings = UsersUtil.amIPublishing();
|
||||
|
||||
_dispatcher.dispatchEvent(broadcastEvent);
|
||||
button.publishingStatus(button.START_PUBLISHING);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user