// Store the local so that we do not send notification to ourself
// back
IConnection current = Red5.getConnectionLocal();
String streamid = current.getClient().getId();
RoomClient currentClient = this.clientListManager
.getClientByStreamId(streamid);
if (currentClient == null) {
// In case the client has already left(kicked) this message
// might be thrown later then the RoomLeave
// event and the currentClient is already gone
// The second Use-Case where the currentClient is maybe null is
// if we remove the client because its a Zombie/Ghost
return;
}
// Notify all the clients that the stream had been started
log.debug("sendClientBroadcastNotifications: "
+ stream.getPublishedName());
log.debug("sendClientBroadcastNotifications : " + currentClient
+ " " + currentClient.getStreamid());
// Notify all clients of the same scope (room)
Collection<Set<IConnection>> conCollection = current.getScope()
.getConnections();
for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
if (conn.equals(current)) {
// there is a Bug in the current implementation
// of the appDisconnect
if (clientFunction.equals("closeStream")) {
RoomClient rcl = this.clientListManager
.getClientByStreamId(conn
.getClient().getId());
if (clientFunction.equals("closeStream")
&& rcl.getIsRecording()) {
log.debug("*** stopRecordingShowForClient Any Client is Recording - stop that");
// StreamService.stopRecordingShowForClient(conn,
// currentClient,
// rcl.getRoomRecordingName(), false);
this.flvRecorderService
.stopRecordingShowForClient(
conn, currentClient);
}
// Don't notify current client
current.ping();
}
continue;
} else {
RoomClient rcl = this.clientListManager
.getClientByStreamId(conn.getClient()
.getId());
if (rcl != null) {
if (rcl.getIsScreenClient() != null
&& rcl.getIsScreenClient()) {
// continue;
} else {
log.debug("is this users still alive? :"
+ rcl);
// conn.ping();
IServiceCapableConnection iStream = (IServiceCapableConnection) conn;
// log.info("IServiceCapableConnection ID "
// + iStream.getClient().getId());
iStream.invoke(clientFunction,
new Object[] { rc }, this);
}
log.debug("sending notification to " + conn
+ " ID: ");
// if this close stream event then stop the
// recording of this stream
if (clientFunction.equals("closeStream")
&& rcl.getIsRecording()) {
log.debug("*** +++++++ ######## sendClientBroadcastNotifications Any Client is Recording - stop that");
// StreamService.stopRecordingShowForClient(conn,
// currentClient,
// rcl.getRoomRecordingName(), false);
this.flvRecorderService