Skip to content
Snippets Groups Projects
Commit cc80f1c2 authored by Richard Alam's avatar Richard Alam
Browse files

- trigger starting of screen capture from the server side.

parent 080a3557
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -202,12 +202,12 @@ class Screenshare(val sessionManager: ScreenshareManager,
log.debug("Received SharingStoppedMessage for streamId=[" + msg.streamId + "]")
}
sessions.get(msg.streamId) match {
case Some(session) => {
case Some(session) =>
session.actorRef ! msg
}
case None => {
case None =>
log.info("Sharing stopped on a non-existing session=[" + msg.streamId + "]")
}
}
}
......
......@@ -43,15 +43,13 @@ public class DeskshareClient {
}
private void shareWithFrame() {
screenSharer = new ScreenRegionSharer(ssi);
screenSharer = new ScreenRegionSharer(ssi, false);
screenSharer.addClientListener(listener);
screenSharer.start(false);
}
private void shareFullScreen() {
screenSharer = new ScreenRegionSharer(ssi);
screenSharer = new ScreenRegionSharer(ssi, true);
screenSharer.addClientListener(listener);
screenSharer.start(true);
}
public void disconnected(){
......
......@@ -45,16 +45,19 @@ public class ScreenRegionSharer implements ScreenSharer, NetworkConnectionListen
// If sharing full screen, autoStart is true
private volatile boolean fullScreen = false;
public ScreenRegionSharer(ScreenShareInfo ssi) {
public ScreenRegionSharer(ScreenShareInfo ssi, boolean autoStart) {
this.fullScreen = autoStart;
this.ssi = ssi;
streamId = ssi.streamId;
signalChannel = new NetworkStreamSender(ssi.host, ssi.meetingId, ssi.streamId);
signalChannel.addNetworkConnectionListener(this);
signalChannel.start();
this.ssi = ssi;
streamId = ssi.streamId;
sharer = new ScreenSharerRunner(ssi);
}
public void start(boolean autoStart) {
public void start() {
if (!status.toUpperCase().equals(START)) {
CaptureRegionListener crl = new CaptureRegionListenerImp(this);
frame = new CaptureRegionFrame(crl, 5);
......@@ -63,9 +66,9 @@ public class ScreenRegionSharer implements ScreenSharer, NetworkConnectionListen
frame.setLocation(ssi.x, ssi.y);
System.out.println(NAME + "Launching Screen Capture Frame");
status = "START";
this.fullScreen = autoStart;
System.out.println(NAME + "Starting Screen Capture Frame. StreamId=" + this.streamId + " autoStart=" + autoStart);
frame.start(autoStart);
System.out.println(NAME + "Starting Screen Capture Frame. StreamId=" + this.streamId + " fullScreen=" + fullScreen);
frame.start(fullScreen);
}
}
......@@ -114,7 +117,7 @@ public class ScreenRegionSharer implements ScreenSharer, NetworkConnectionListen
} else if (reason.getExitCode() == ExitCode.START.getExitCode()) {
this.streamId = streamId;
System.out.println(NAME + "starting. StreamId=" + this.streamId + " fullScreen=" + fullScreen);
start(fullScreen);
start();
} else {
System.out.println(NAME + "Closing. Reason=" + reason.getExitCode());
listener.onClientStop(reason);
......
......@@ -19,7 +19,7 @@
package org.bigbluebutton.screenshare.client;
public interface ScreenSharer {
void start(boolean autoStart);
void start();
void disconnected();
void stop();
void addClientListener(ClientListener l);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment