Add pause sharing client event.

This commit is contained in:
Richard Alam 2016-08-08 21:56:39 +00:00
parent 83c77f5746
commit 9cfbc77699
7 changed files with 61 additions and 2 deletions

View File

@ -0,0 +1,17 @@
package org.bigbluebutton.modules.screenshare.events
{
import flash.events.Event;
public class RequestToPauseSharing extends Event
{
public static const REQUEST_SHARE_PAUSE:String = "screenshare request to pause sharing event";
public function RequestToPauseSharing()
{
super(REQUEST_SHARE_PAUSE, true, false);
}
}
}

View File

@ -147,6 +147,10 @@ package org.bigbluebutton.modules.screenshare.managers {
service.requestStartSharing();
}
public function handleRequestPauseSharingEvent():void {
service.requestPauseSharing(ScreenshareModel.getInstance().streamId);
}
public function handleRequestStopSharingEvent():void {
service.requestStopSharing(ScreenshareModel.getInstance().streamId);
}

View File

@ -33,6 +33,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.screenshare.events.ModuleEvent;
import org.bigbluebutton.modules.screenshare.events.RequestToStartSharing;
import org.bigbluebutton.modules.screenshare.events.RequestToStopSharing;
import org.bigbluebutton.modules.screenshare.events.RequestToPauseSharing;
import org.bigbluebutton.modules.screenshare.events.ShareEvent;
import org.bigbluebutton.modules.screenshare.events.ShareStartRequestResponseEvent;
import org.bigbluebutton.modules.screenshare.events.ShareWindowEvent;
@ -63,6 +64,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<EventHandlers type="{RequestToStartSharing.REQUEST_SHARE_START}">
<MethodInvoker generator="{ScreenshareManager}" method="handleRequestStartSharingEvent"/>
</EventHandlers>
<EventHandlers type="{RequestToPauseSharing.REQUEST_SHARE_PAUSE}">
<MethodInvoker generator="{ScreenshareManager}" method="handleRequestPauseSharingEvent"/>
</EventHandlers>
<EventHandlers type="{RequestToStopSharing.REQUEST_SHARE_STOP}">
<MethodInvoker generator="{ScreenshareManager}" method="handleRequestStopSharingEvent"/>

View File

@ -41,6 +41,10 @@ package org.bigbluebutton.modules.screenshare.services
public function stopShareRequest(meetingId: String, streamId: String):void {
conn.stopShareRequest(meetingId, streamId);
}
public function pauseShareRequest(meetingId: String, userId: String, streamId: String):void {
conn.pauseShareRequest(meetingId, userId, streamId);
}
}

View File

@ -88,6 +88,10 @@ package org.bigbluebutton.modules.screenshare.services {
sender.stopShareRequest(UsersUtil.getInternalMeetingID(), streamId);
}
public function requestPauseSharing(streamId:String):void {
sender.pauseShareRequest(UsersUtil.getInternalMeetingID(), UsersUtil.getMyUserID(), streamId);
}
}
}

View File

@ -179,6 +179,19 @@ package org.bigbluebutton.modules.screenshare.services.red5 {
}
}
public function pauseShareRequest(meetingId:String, userId:String, streamId:String):void {
var message:Object = new Object();
message["meetingId"] = meetingId;
message["userId"] = userId;
message["streamId"] = streamId;
sendMessage("screenshare.pauseShareRequest", function(result:String):void { // On successful result
LOGGER.debug(result);
}, function(status:String):void { // status - On error occurred
LOGGER.error(status);
}, message);
}
public function startShareRequest(meetingId:String, userId:String, record:Boolean):void {
var message:Object = new Object();
message["meetingId"] = meetingId;

View File

@ -55,6 +55,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.screenshare.events.RequestToStopSharing;
import org.bigbluebutton.modules.screenshare.events.RequestToPauseSharing;
import org.bigbluebutton.modules.screenshare.events.ShareWindowEvent;
import org.bigbluebutton.modules.screenshare.events.StartShareRequestSuccessEvent;
import org.bigbluebutton.modules.screenshare.events.StopSharingButtonEvent;
@ -199,6 +200,17 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
closeWindow();
}
public function pauseSharing():void {
LOGGER.debug("Calling pauseSharing");
if (streaming) {
stopStream();
var streamEvent:RequestToPauseSharing = new RequestToPauseSharing();
dispatchEvent(streamEvent);
}
sharingFullScreen = false;
streaming = false;
}
public function stopSharingEvent(evt:StopSharingButtonEvent):void{
if (streaming) {
stopStream();
@ -329,7 +341,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
override public function close(event:MouseEvent = null):void {
stopSharing();
closeWindow();
}
}
override protected function resourcesChanged():void{
super.resourcesChanged();
@ -407,7 +419,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
label="{ResourceUtil.getInstance().getString('bbb.screensharePublish.stop.label')}"
visible="true"
enabled="false"
click="stopSharing()"
click="pauseSharing()"
tabIndex="{baseIndex+5}"/>
<mx:Spacer width="100%"/>
<mx:Button id="btnRegionPublish"