*/
@Override
public synchronized void streamPublishStart(IBroadcastStream stream) {
try {
log.debug("----------- streamPublishStart");
IConnection current = Red5.getConnectionLocal();
String streamid = current.getClient().getId();
Client currentClient = this.sessionManager
.getClientByStreamId(streamid, null);
//We make a second object the has the reference to the object
//that we will use to send to all participents
Client clientObjectSendToSync = currentClient;
// Notify all the clients that the stream had been started
log.debug("start streamPublishStart broadcast start: "
+ stream.getPublishedName() + " CONN " + current);
// In case its a screen sharing we start a new Video for that
if (currentClient.getIsScreenClient()) {
currentClient.setScreenPublishStarted(true);
this.sessionManager.updateClientByStreamId(current
.getClient().getId(), currentClient, false, null);
}
//If its an audio/video client then send the session object with the full
//data to everybody
else if (currentClient.getIsAVClient()) {
clientObjectSendToSync = this.sessionManager.getClientByPublicSID(
currentClient.getPublicSID(), false, null);
}
log.debug("newStream SEND: "+currentClient);
// Notify all users of the same Scope
// We need to iterate through the streams to catch if anybody is recording
for (Set<IConnection> conset : current.getScope().getConnections()) {
for (IConnection conn : conset) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
Client rcl = this.sessionManager