- slowly making presentation work again
This commit is contained in:
parent
aa8f68076f
commit
f12ec75377
@ -57,7 +57,11 @@ public class PresentationService {
|
||||
Integer slideNum = (Integer) msg.get("pageNumber");
|
||||
|
||||
IScope scope = Red5.getConnectionLocal().getScope();
|
||||
presentationApplication.gotoSlide(scope.getName(), slideNum);
|
||||
log.debug("Got GotoSlide for meeting [{}] page=[{}]", scope.getName(), slideNum);
|
||||
|
||||
// We are adding 1 here because the slides in the client is zero based. Need to
|
||||
// fix that so page numbers start with 1.
|
||||
presentationApplication.gotoSlide(scope.getName(), slideNum + 1);
|
||||
}
|
||||
|
||||
public void sharePresentation(Map<String, Object> msg) {
|
||||
|
@ -186,7 +186,8 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
|
||||
val id = "slide/" + i
|
||||
val num = i;
|
||||
val thumbnail = "thumbnail/" + i
|
||||
val p = new Page(id=id, num=num, thumbnail=thumbnail)
|
||||
val current = if (i == 1) true else false
|
||||
val p = new Page(id=id, num=num, thumbnail=thumbnail, current=current)
|
||||
pages += (p.id -> p)
|
||||
}
|
||||
|
||||
@ -197,11 +198,7 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
|
||||
code: String, presentationId: String, numPages: Int) {
|
||||
|
||||
val pages = generatePresentationPages(numPages)
|
||||
|
||||
pages.values foreach {p =>
|
||||
println("**** Page [" + p.id + "," + p.num + "]")
|
||||
}
|
||||
|
||||
|
||||
val presentation = new Presentation(id=presentationId, name=presentationId, pages=pages)
|
||||
bbbGW.accept(new PresentationConversionCompleted(meetingId, messageKey,
|
||||
code, presentation))
|
||||
@ -227,7 +224,8 @@ class BigBlueButtonInGW(bbbGW: BigBlueButtonGateway) extends IBigBlueButtonInGW
|
||||
}
|
||||
|
||||
def gotoSlide(meetingID: String, slide: Int) {
|
||||
bbbGW.accept(new GotoSlide(meetingID, slide.toString))
|
||||
println("**** Forwarding GotoSlide for meeting[" + meetingID + "] ****")
|
||||
bbbGW.accept(new GotoSlide(meetingID, "slide/" + slide.toString))
|
||||
}
|
||||
|
||||
def sharePresentation(meetingID: String, presentationID: String, share: Boolean) {
|
||||
|
@ -107,9 +107,11 @@ trait PresentationApp {
|
||||
}
|
||||
|
||||
def handleGotoSlide(msg: GotoSlide) {
|
||||
presModel.changePage(msg.page) foreach (page =>
|
||||
outGW.send(new GotoSlideOutMsg(meetingID, recorded, page)))
|
||||
|
||||
println("Received GotoSlide for meeting=[" + msg.meetingID + "] page=[" + msg.page + "]")
|
||||
presModel.changePage(msg.page) foreach {page =>
|
||||
println("Switching page for meeting=[" + msg.meetingID + "] page=[" + page.id + "]")
|
||||
outGW.send(new GotoSlideOutMsg(meetingID, recorded, page))
|
||||
}
|
||||
}
|
||||
|
||||
def handleSharePresentation(msg: SharePresentation) {
|
||||
|
@ -205,31 +205,60 @@ class PresentationClientMessageSender(service: ConnectionInvokerService) extends
|
||||
}
|
||||
|
||||
private def handleSendCursorUpdateOutMsg(msg: SendCursorUpdateOutMsg) {
|
||||
val args = new java.util.HashMap[String, Object]();
|
||||
args.put("xPercent", msg.xPercent:java.lang.Double);
|
||||
args.put("yPercent", msg.yPercent:java.lang.Double);
|
||||
val args = new java.util.HashMap[String, Object]();
|
||||
args.put("xPercent", msg.xPercent:java.lang.Double);
|
||||
args.put("yPercent", msg.yPercent:java.lang.Double);
|
||||
|
||||
val m = new BroadcastClientMessage(msg.meetingID, "PresentationCursorUpdateCommand", args);
|
||||
service.sendMessage(m);
|
||||
val message = new java.util.HashMap[String, Object]()
|
||||
val gson = new Gson();
|
||||
message.put("msg", gson.toJson(args))
|
||||
|
||||
log.debug("PresentationClientMessageSender - handleSendCursorUpdateOutMsg \n [{}]", message.get("msg"))
|
||||
|
||||
val m = new BroadcastClientMessage(msg.meetingID, "PresentationCursorUpdateCommand", args);
|
||||
service.sendMessage(m);
|
||||
}
|
||||
|
||||
private def handleResizeAndMoveSlideOutMsg(msg: ResizeAndMoveSlideOutMsg) {
|
||||
// val args = new java.util.HashMap[String, Object]();
|
||||
// args.put("xOffset", msg.xOffset);
|
||||
// args.put("yOffset", msg.yOffset:java.lang.Double);
|
||||
// args.put("widthRatio", msg.widthRatio:java.lang.Double);
|
||||
// args.put("heightRatio", msg.heightRatio:java.lang.Double);
|
||||
|
||||
// val m = new BroadcastClientMessage(msg.meetingID, "moveCallback", args);
|
||||
// service.sendMessage(m);
|
||||
val args = new java.util.HashMap[String, Object]();
|
||||
args.put("id", msg.page.id)
|
||||
args.put("num", msg.page.num:java.lang.Integer)
|
||||
args.put("current", msg.page.current:java.lang.Boolean)
|
||||
args.put("thumbnail", msg.page.thumbnail)
|
||||
args.put("xOffset", msg.page.xOffset:java.lang.Double);
|
||||
args.put("yOffset", msg.page.yOffset:java.lang.Double);
|
||||
args.put("widthRatio", msg.page.widthRatio:java.lang.Double);
|
||||
args.put("heightRatio", msg.page.heightRatio:java.lang.Double);
|
||||
|
||||
val message = new java.util.HashMap[String, Object]()
|
||||
val gson = new Gson();
|
||||
message.put("msg", gson.toJson(args))
|
||||
|
||||
log.debug("PresentationClientMessageSender - handleResizeAndMoveSlideOutMsg \n [{}]", message.get("msg"))
|
||||
|
||||
val m = new BroadcastClientMessage(msg.meetingID, "moveCallback", args);
|
||||
service.sendMessage(m);
|
||||
}
|
||||
|
||||
private def handleGotoSlideOutMsg(msg: GotoSlideOutMsg) {
|
||||
val args = new java.util.HashMap[String, Object]();
|
||||
// args.put("pageNum", msg.slide:java.lang.Integer);
|
||||
val args = new java.util.HashMap[String, Object]();
|
||||
args.put("id", msg.page.id)
|
||||
args.put("num", msg.page.num:java.lang.Integer)
|
||||
args.put("current", msg.page.current:java.lang.Boolean)
|
||||
args.put("thumbnail", msg.page.thumbnail)
|
||||
args.put("xOffset", msg.page.xOffset:java.lang.Double);
|
||||
args.put("yOffset", msg.page.yOffset:java.lang.Double);
|
||||
args.put("widthRatio", msg.page.widthRatio:java.lang.Double);
|
||||
args.put("heightRatio", msg.page.heightRatio:java.lang.Double);
|
||||
|
||||
val message = new java.util.HashMap[String, Object]()
|
||||
val gson = new Gson();
|
||||
message.put("msg", gson.toJson(args))
|
||||
|
||||
log.debug("PresentationClientMessageSender - handleGotoSlideOutMsg \n [{}]", message.get("msg"))
|
||||
|
||||
// val m = new BroadcastClientMessage(msg.meetingID, "gotoSlideCallback", args);
|
||||
// service.sendMessage(m);
|
||||
val m = new BroadcastClientMessage(msg.meetingID, "gotoSlideCallback", args);
|
||||
service.sendMessage(m);
|
||||
}
|
||||
|
||||
private def handleSharePresentationOutMsg(msg: SharePresentationOutMsg) {
|
||||
|
@ -18,10 +18,23 @@ package org.bigbluebutton.modules.present.model
|
||||
public function get id():String {
|
||||
return _id;
|
||||
}
|
||||
|
||||
|
||||
public function isCurrent():Boolean {
|
||||
return _current;
|
||||
}
|
||||
|
||||
public function addPage(p: Page):void {
|
||||
_pages.addItem(p);
|
||||
}
|
||||
|
||||
|
||||
public function getPages():Array {
|
||||
var pages:Array = new Array();
|
||||
|
||||
for (var i: int = 0; i < _pages.length; i++) {
|
||||
pages.push(_pages.getItemAt(i) as Page);
|
||||
}
|
||||
|
||||
return pages;
|
||||
}
|
||||
}
|
||||
}
|
@ -44,7 +44,51 @@ package org.bigbluebutton.modules.present.model
|
||||
}
|
||||
|
||||
public function addPresentation(p: Presentation):void {
|
||||
_presentations.addItem(p);
|
||||
}
|
||||
|
||||
public function getCurrentPresentationName():String {
|
||||
for (var i:int = 0; i < _presentations.length; i++) {
|
||||
var pres: Presentation = _presentations.getItemAt(i) as Presentation;
|
||||
if (pres.isCurrent()) return pres.id;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getPresentationNames():Array {
|
||||
var presos:Array = new Array();
|
||||
|
||||
for (var i:int = 0; i < _presentations.length; i++) {
|
||||
var pres: Presentation = _presentations.getItemAt(i) as Presentation;
|
||||
presos.push(pres.id);
|
||||
}
|
||||
|
||||
return presos;
|
||||
}
|
||||
|
||||
public function getCurrentPresentation():Presentation {
|
||||
for (var i:int = 0; i < _presentations.length; i++) {
|
||||
var pres: Presentation = _presentations.getItemAt(i) as Presentation;
|
||||
if (pres.isCurrent()) return pres;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getCurrentPage():Page {
|
||||
var pres: Presentation = getCurrentPresentation();
|
||||
|
||||
if (pres != null) {
|
||||
var pages:Array = pres.getPages();
|
||||
for (var j:int = 0; j < pages.length; j++) {
|
||||
var page:Page = pages[j] as Page;
|
||||
if (page.current) return page;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -284,40 +284,25 @@ package org.bigbluebutton.modules.present.services
|
||||
dispatcher.dispatchEvent(new MadePresenterEvent(MadePresenterEvent.SWITCH_TO_PRESENTER_MODE));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
trace(LOG + " ************** msg.presentation.xOffset [" + msg.presentation.xOffset +"] ***********");
|
||||
|
||||
if (msg.presentation.xOffset) {
|
||||
var e:MoveEvent = new MoveEvent(MoveEvent.CUR_SLIDE_SETTING);
|
||||
e.xOffset = Number(msg.presentation.xOffset);
|
||||
e.yOffset = Number(msg.presentation.yOffset);
|
||||
e.slideToCanvasWidthRatio = Number(msg.presentation.widthRatio);
|
||||
e.slideToCanvasHeightRatio = Number(msg.presentation.heightRatio);
|
||||
|
||||
trace(LOG + " **************Dispatching MoveEvent.CUR_SLIDE_SETTING ***********");
|
||||
dispatcher.dispatchEvent(e);
|
||||
}
|
||||
|
||||
if (msg.presentations) {
|
||||
var presNames:Array = PresentationModel.getInstance().getPresentationNames();
|
||||
|
||||
if (presNames) {
|
||||
trace(LOG + " ************ Getting list of presentations *************");
|
||||
for(var p:Object in msg.presentations) {
|
||||
var u:Object = msg.presentations[p]
|
||||
sendPresentationName(u as String);
|
||||
for (var x:int = 0; x < presNames.length; x++) {
|
||||
sendPresentationName(presNames[x] as String);
|
||||
}
|
||||
}
|
||||
|
||||
// Force switching the presenter.
|
||||
triggerSwitchPresenter();
|
||||
|
||||
if (msg.presentation.sharing) {
|
||||
currentSlide = Number(msg.presentation.slide);
|
||||
trace(LOG + "**** Trigger sharing presentation of [" + msg.presentation.currentPresentation + "]");
|
||||
|
||||
|
||||
var curPresName:String = PresentationModel.getInstance().getCurrentPresentationName();
|
||||
|
||||
var shareEvent:UploadEvent = new UploadEvent(UploadEvent.PRESENTATION_READY);
|
||||
shareEvent.presentationName = String(msg.presentation.currentPresentation);
|
||||
shareEvent.presentationName = curPresName;
|
||||
dispatcher.dispatchEvent(shareEvent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function sendPresentationName(presentationName:String):void {
|
||||
|
Loading…
Reference in New Issue
Block a user