Search in sources :

Example 1 with ScreenshareStreamListener

use of org.bigbluebutton.app.screenshare.ScreenshareStreamListener in project bigbluebutton by bigbluebutton.

the class Red5AppAdapter method streamBroadcastStart.

@Override
public void streamBroadcastStart(IBroadcastStream stream) {
    IConnection conn = Red5.getConnectionLocal();
    super.streamBroadcastStart(stream);
    log.info("streamBroadcastStart " + stream.getPublishedName() + "]");
    String streamId = stream.getPublishedName();
    Matcher matcher = STREAM_ID_PATTERN.matcher(stream.getPublishedName());
    if (matcher.matches()) {
        String meetingId = matcher.group(1).trim();
        String url = streamBaseUrl + "/" + meetingId + "/" + streamId;
        app.streamStarted(meetingId, streamId, url);
        boolean recordVideoStream = app.recordStream(meetingId, streamId);
        if (recordVideoStream) {
            recordStream(stream);
            ScreenshareStreamListener listener = new ScreenshareStreamListener(recordingService, recordingDirectory);
            stream.addStreamListener(listener);
            streamListeners.put(conn.getScope().getName() + "-" + stream.getPublishedName(), listener);
        }
        Map<String, Object> logData = new HashMap<String, Object>();
        logData.put("meetingId", meetingId);
        logData.put("streamId", streamId);
        logData.put("url", url);
        logData.put("recorded", recordVideoStream);
        Gson gson = new Gson();
        String logStr = gson.toJson(logData);
        log.info("ScreenShare broadcast started: data={}", logStr);
    } else {
        log.error("Invalid streamid format [{}]", streamId);
    }
}
Also used : Matcher(java.util.regex.Matcher) HashMap(java.util.HashMap) Gson(com.google.gson.Gson) IConnection(org.red5.server.api.IConnection) ScreenshareStreamListener(org.bigbluebutton.app.screenshare.ScreenshareStreamListener)

Aggregations

Gson (com.google.gson.Gson)1 HashMap (java.util.HashMap)1 Matcher (java.util.regex.Matcher)1 ScreenshareStreamListener (org.bigbluebutton.app.screenshare.ScreenshareStreamListener)1 IConnection (org.red5.server.api.IConnection)1