use of org.red5.server.api.IConnection in project bigbluebutton by bigbluebutton.
the class VideoApplication method FCUnpublish.
/**
* Notification method that is sent by FME when publishing of a stream ends.
*
* @param streamName Name of stream that is about to be un-published.
*/
@Override
public void FCUnpublish(String streamName) {
IConnection conn = Red5.getConnectionLocal();
log.info("FCUnpublish " + streamName + " " + System.currentTimeMillis() + " " + conn.getScope().getName());
}
use of org.red5.server.api.IConnection in project bigbluebutton by bigbluebutton.
the class VideoApplication method FCSubscribe.
/**
* Notification method that is sent by some clients just before playback starts.
*
* @param streamName Name of stream that is about to be played.
*/
@Override
public void FCSubscribe(String streamName) {
IConnection conn = Red5.getConnectionLocal();
log.info("FCSubscribe " + streamName + " " + System.currentTimeMillis() + " " + conn.getScope().getName());
}
use of org.red5.server.api.IConnection in project bigbluebutton by bigbluebutton.
the class VideoApplication method recordStream.
/**
* A hook to record a stream. A file is written in webapps/video-broadcast/streams/
* @param stream
*/
private void recordStream(IBroadcastStream stream) {
IConnection conn = Red5.getConnectionLocal();
long now = System.currentTimeMillis();
// + "-" + now; /** Comment out for now...forgot why I added this - ralam */
String recordingStreamName = stream.getPublishedName();
try {
log.info("Recording stream " + recordingStreamName);
ClientBroadcastStream cstream = (ClientBroadcastStream) this.getBroadcastStream(conn.getScope(), stream.getPublishedName());
cstream.saveAs(recordingStreamName, false);
} catch (Exception e) {
log.error("ERROR while recording stream " + e.getMessage());
e.printStackTrace();
}
}
use of org.red5.server.api.IConnection in project bigbluebutton by bigbluebutton.
the class VideoApplication method streamBroadcastStart.
@Override
public void streamBroadcastStart(IBroadcastStream stream) {
IConnection conn = Red5.getConnectionLocal();
super.streamBroadcastStart(stream);
log.info("streamBroadcastStart " + stream.getPublishedName() + " " + System.currentTimeMillis() + " " + conn.getScope().getName());
String userId = getUserId();
String meetingId = conn.getScope().getName();
String streamId = stream.getPublishedName();
Matcher matcher = RECORD_STREAM_ID_PATTERN.matcher(stream.getPublishedName());
if (matcher.matches()) {
log.info("Start recording of stream=[" + stream.getPublishedName() + "] for meeting=[" + conn.getScope().getName() + "]");
Boolean recordVideoStream = true;
VideoStreamListener listener = new VideoStreamListener(conn.getScope(), stream, recordVideoStream, userId, packetTimeout);
listener.setEventRecordingService(recordingService);
stream.addStreamListener(listener);
streamListeners.put(conn.getScope().getName() + "-" + stream.getPublishedName(), listener);
recordStream(stream);
}
}
use of org.red5.server.api.IConnection in project bigbluebutton by bigbluebutton.
the class Application method recordStream.
/**
* A hook to record a sample stream. A file is written in webapps/sip/streams/
* @param stream
*/
private void recordStream(IBroadcastStream stream) {
IConnection conn = Red5.getConnectionLocal();
String streamName = stream.getPublishedName();
try {
ClientBroadcastStream cstream = (ClientBroadcastStream) this.getBroadcastStream(conn.getScope(), stream.getPublishedName());
cstream.saveAs(streamName, false);
} catch (Exception e) {
System.out.println("ERROR while recording stream " + e.getMessage());
e.printStackTrace();
}
}
Aggregations