Skip to content
Snippets Groups Projects
Commit aff272cb authored by Anton Georgiev's avatar Anton Georgiev
Browse files

Merge #7484 into #11447 ExternalVideo recording events

parent 0eac0339
No related branches found
No related tags found
No related merge requests found
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2019 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
trait AbstractExternalVideoRecordEvent extends RecordEvent {
setModule("EXTERNAL-VIDEO")
}
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2019 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class StartExternalVideoRecordEvent extends AbstractExternalVideoRecordEvent {
import StartExternalVideoRecordEvent._
setEvent("StartExternalVideoRecordEvent")
def setExternalVideoUrl(externalVideoUrl: String) {
eventMap.put(EXTERNAL_VIDEO_URL, externalVideoUrl)
}
}
object StartExternalVideoRecordEvent {
protected final val EXTERNAL_VIDEO_URL = "externalVideoUrl"
}
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2019 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class StopExternalVideoRecordEvent extends AbstractExternalVideoRecordEvent {
setEvent("StopExternalVideoRecordEvent")
}
/**
* BigBlueButton open source conferencing system - http://www.bigbluebutton.org/
*
* Copyright (c) 2019 BigBlueButton Inc. and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
*
*/
package org.bigbluebutton.core.record.events
class UpdateExternalVideoRecordEvent extends AbstractExternalVideoRecordEvent {
import UpdateExternalVideoRecordEvent._
setEvent("UpdateExternalVideoRecordEvent")
def setStatus(status: String) {
eventMap.put(STATUS, status)
}
def setRate(rate: Double) {
eventMap.put(RATE, rate.toString)
}
def setTime(time: Double) {
eventMap.put(TIME, time.toString)
}
def setState(state: Int) {
eventMap.put(STATE, state.toString)
}
}
object UpdateExternalVideoRecordEvent {
protected final val STATUS = "status"
protected final val RATE = "rate"
protected final val TIME = "time"
protected final val STATE = "state"
}
......@@ -108,6 +108,11 @@ class RedisRecorderActor(
case m: PollStoppedEvtMsg => handlePollStoppedEvtMsg(m)
case m: PollShowResultEvtMsg => handlePollShowResultEvtMsg(m)
// ExternalVideo
case m: StartExternalVideoEvtMsg => handleStartExternalVideoEvtMsg(m)
case m: UpdateExternalVideoEvtMsg => handleUpdateExternalVideoEvtMsg(m)
case m: StopExternalVideoEvtMsg => handleStopExternalVideoEvtMsg(m)
case _ => // message not to be recorded.
}
}
......@@ -456,6 +461,32 @@ class RedisRecorderActor(
}
*/
private def handleStartExternalVideoEvtMsg(msg: StartExternalVideoEvtMsg) {
val ev = new StartExternalVideoRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setExternalVideoUrl(msg.body.externalVideoUrl)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleUpdateExternalVideoEvtMsg(msg: UpdateExternalVideoEvtMsg) {
val ev = new UpdateExternalVideoRecordEvent()
ev.setMeetingId(msg.header.meetingId)
ev.setStatus(msg.body.status)
ev.setRate(msg.body.rate)
ev.setTime(msg.body.time)
ev.setState(msg.body.state)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleStopExternalVideoEvtMsg(msg: StopExternalVideoEvtMsg) {
val ev = new StopExternalVideoRecordEvent()
ev.setMeetingId(msg.header.meetingId)
record(msg.header.meetingId, ev.toMap.asJava)
}
private def handleRecordingStatusChangedEvtMsg(msg: RecordingStatusChangedEvtMsg) {
val ev = new RecordStatusRecordEvent()
ev.setMeetingId(msg.header.meetingId)
......
......@@ -7,7 +7,7 @@ case class StartExternalVideoPubMsgBody(externalVideoUrl: String)
object UpdateExternalVideoPubMsg { val NAME = "UpdateExternalVideoPubMsg" }
case class UpdateExternalVideoPubMsg(header: BbbClientMsgHeader, body: UpdateExternalVideoPubMsgBody) extends StandardMsg
case class UpdateExternalVideoPubMsgBody(status: String, rate: Double, time: Double, state: Boolean)
case class UpdateExternalVideoPubMsgBody(status: String, rate: Double, time: Double, state: Int)
object StopExternalVideoPubMsg { val NAME = "StopExternalVideoPubMsg" }
case class StopExternalVideoPubMsg(header: BbbClientMsgHeader, body: StopExternalVideoPubMsgBody) extends StandardMsg
......@@ -20,7 +20,7 @@ case class StartExternalVideoEvtMsgBody(externalVideoUrl: String)
object UpdateExternalVideoEvtMsg { val NAME = "UpdateExternalVideoEvtMsg" }
case class UpdateExternalVideoEvtMsg(header: BbbClientMsgHeader, body: UpdateExternalVideoEvtMsgBody) extends BbbCoreMsg
case class UpdateExternalVideoEvtMsgBody(status: String, rate: Double, time: Double, state: Boolean)
case class UpdateExternalVideoEvtMsgBody(status: String, rate: Double, time: Double, state: Int)
object StopExternalVideoEvtMsg { val NAME = "StopExternalVideoEvtMsg" }
case class StopExternalVideoEvtMsg(header: BbbClientMsgHeader, body: StopExternalVideoEvtMsgBody) extends BbbCoreMsg
......
......@@ -13,7 +13,7 @@ export default function emitExternalVideoEvent(options) {
const { status, playerStatus } = options;
const user = Users.findOne({ meetingId: meetingId, userId: requesterUserId })
const user = Users.findOne({ meetingId, userId: requesterUserId })
if (user && user.presenter) {
......@@ -21,7 +21,7 @@ export default function emitExternalVideoEvent(options) {
check(playerStatus, {
rate: Match.Maybe(Number),
time: Match.Maybe(Number),
state: Match.Maybe(Boolean),
state: Match.Maybe(Number),
});
let rate = playerStatus.rate || 0;
......@@ -32,5 +32,5 @@ export default function emitExternalVideoEvent(options) {
Logger.debug(`User id=${requesterUserId} sending ${EVENT_NAME} event:${state} for meeting ${meetingId}`);
return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload);
}
}
}
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