public class SyncRoomManager extends Object
| Constructor and Description |
|---|
SyncRoomManager(RoomHandler roomHandler,
KurentoClientProvider kcProvider)
Provides an instance of the room manager by setting a room handler and
the
KurentoClient provider. |
| Modifier and Type | Method and Description |
|---|---|
void |
addMediaElement(String participantId,
org.kurento.client.MediaElement element)
Applies a media element (filter, recorder, mixer, etc.) to media that is
currently streaming or that might get streamed sometime in the future.
|
void |
addMediaElement(String participantId,
org.kurento.client.MediaElement element,
org.kurento.client.MediaType type)
Applies a media element (filter, recorder, mixer, etc.) to media that is
currently streaming or that might get streamed sometime in the future.
|
void |
close()
Closes all resources.
|
void |
closeRoom(String roomName)
Closes an existing room by releasing all resources that were allocated
for the room.
|
void |
createRoom(KurentoClientSessionInfo sessionInfo)
Creates a room if it doesn’t already exist.
|
String |
generatePublishOffer(String participantId)
Represents a client’s request to initiate the media connection from the
server-side (generate the SDP offer and send it back to the client) and
must be followed by processing the SDP answer from the client in order to
establish the streaming.
|
Set<UserParticipant> |
getParticipants(String roomName)
Returns all the participants inside a room.
|
Set<UserParticipant> |
getPeerPublishers(String participantId)
Returns the peer’s publishers (participants from which the peer is
receiving media).
|
Set<UserParticipant> |
getPeerSubscribers(String participantId)
Returns the peer’s subscribers (participants towards the peer is
streaming media).
|
org.kurento.client.MediaPipeline |
getPipeline(String participantId)
Returns the media pipeline used by the participant.
|
Set<UserParticipant> |
getPublishers(String roomName)
Returns all the publishers (participants streaming their media) inside a
room.
|
Set<String> |
getRooms()
Returns all currently active (opened) rooms.
|
Set<UserParticipant> |
getSubscribers(String roomName)
Returns all the subscribers (participants subscribed to a least one
stream of another user) inside a room.
|
boolean |
isPublisherStreaming(String participantId)
Checks if a participant is currently streaming media.
|
Set<UserParticipant> |
joinRoom(String userName,
String roomName,
boolean webParticipant,
String participantId)
Represents a client’s request to join a room.
|
Set<UserParticipant> |
leaveRoom(String participantId)
Represents a client’s notification that she’s leaving the room.
|
void |
mutePublishedMedia(MutedMediaType muteType,
String participantId)
Mutes the streamed media of this publisher in a selective manner.
|
void |
muteSubscribedMedia(String remoteName,
MutedMediaType muteType,
String participantId)
Mutes the incoming media stream from the remote publisher in a selective
manner.
|
void |
onIceCandidate(String endpointName,
String candidate,
int sdpMLineIndex,
String sdpMid,
String participantId)
Request that carries info about an ICE candidate gathered on the client
side.
|
String |
publishMedia(String participantId,
boolean isOffer,
String sdp,
boolean doLoopback,
org.kurento.client.MediaElement... mediaElements)
Same as
publishMedia(String, boolean, String, MediaElement, MediaType, boolean, MediaElement...)
, using as loopback the published stream and no specific type of loopback
connection. |
String |
publishMedia(String participantId,
boolean isOffer,
String sdp,
org.kurento.client.MediaElement loopbackAlternativeSrc,
org.kurento.client.MediaType loopbackConnectionType,
boolean doLoopback,
org.kurento.client.MediaElement... mediaElements)
Represents a client’s request to start streaming her local media to
anyone inside the room.
|
String |
publishMedia(String participantId,
boolean isOffer,
String sdp,
org.kurento.client.MediaType loopbackConnectionType,
boolean doLoopback,
org.kurento.client.MediaElement... mediaElements)
Same as
publishMedia(String, boolean, String, MediaElement, MediaType, boolean, MediaElement...)
, using as loopback the published stream and allowing a specific
connection type. |
void |
removeMediaElement(String participantId,
org.kurento.client.MediaElement element)
Disconnects and removes media element (filter, recorder, etc.) from a
media stream.
|
String |
subscribe(String remoteName,
String sdpOffer,
String participantId)
Represents a client’s request to receive media from room participants
that published their media.
|
void |
unmutePublishedMedia(String participantId)
Reverts the effects of the mute operation.
|
void |
unmuteSubscribedMedia(String remoteName,
String participantId)
Reverts any previous mute operation.
|
void |
unpublishMedia(String participantId)
Represents a client’s request to stop publishing her media stream.
|
void |
unsubscribe(String remoteName,
String participantId)
Represents a client’s request to stop receiving media from the remote
peer.
|
public SyncRoomManager(RoomHandler roomHandler, KurentoClientProvider kcProvider)
KurentoClient provider.roomHandler - the room handler implementationkcProvider - enables the manager to obtain Kurento Client instancespublic Set<UserParticipant> joinRoom(String userName, String roomName, boolean webParticipant, String participantId) throws AdminException
userName - name or identifier of the user in the room. Will be used
to identify her WebRTC media peer (from the client-side).roomName - name or identifier of the roomwebParticipant - if true, the internal media
endpoints will use the trickle ICE mechanism when establishing
connections with external media peers (WebRtcEndpoint); if
false, the media endpoints will be of type
RtpEndpoint, with no ICE implementationparticipantId - identifier of the participantUserParticipant, can be
empty if firstAdminException - on error while joining (like the room is not found
or is closing)public Set<UserParticipant> leaveRoom(String participantId) throws AdminException
participantId - identifier of the participantUserParticipant, if empty
this method has closed the roomAdminException - on error leaving the roompublic String publishMedia(String participantId, boolean isOffer, String sdp, org.kurento.client.MediaElement loopbackAlternativeSrc, org.kurento.client.MediaType loopbackConnectionType, boolean doLoopback, org.kurento.client.MediaElement... mediaElements) throws AdminException
participantId - identifier of the participantisOffer - if true, the sdp is an offer from remote, otherwise is the
answer to the offer generated previously by the server endpointsdp - SDP String offer or answer,
that's been generated by the client’s WebRTC peerloopbackAlternativeSrc - instead of connecting the endpoint to
itself, use this MediaElement as sourceloopbackConnectionType - the connection type for the loopback; if
null, will stream both audio and video mediadoLoopback - loopback flagmediaElements - variable array of media elements (filters,
recorders, etc.) that are connected between the source WebRTC
endpoint and the subscriber endpointsAdminException - on errorpublic String publishMedia(String participantId, boolean isOffer, String sdp, boolean doLoopback, org.kurento.client.MediaElement... mediaElements) throws AdminException
publishMedia(String, boolean, String, MediaElement, MediaType, boolean, MediaElement...)
, using as loopback the published stream and no specific type of loopback
connection.AdminException#publishMedia(String, boolean, String, boolean, MediaElement,
MediaElement...)public String publishMedia(String participantId, boolean isOffer, String sdp, org.kurento.client.MediaType loopbackConnectionType, boolean doLoopback, org.kurento.client.MediaElement... mediaElements) throws AdminException
publishMedia(String, boolean, String, MediaElement, MediaType, boolean, MediaElement...)
, using as loopback the published stream and allowing a specific
connection type.AdminException#publishMedia(String, boolean, String, boolean, MediaElement,
MediaElement...)public String generatePublishOffer(String participantId) throws AdminException
participantId - identifier of the participantAdminException - on error#publishMedia(String, String, boolean, MediaElement...)public void unpublishMedia(String participantId) throws AdminException
participantId - identifier of the participantAdminException - on errorpublic String subscribe(String remoteName, String sdpOffer, String participantId) throws AdminException
remoteName - identification of the remote stream which is
effectively the peer’s name (participant)sdpOffer - SDP offer String generated by the client’s WebRTC peerparticipantId - identifier of the participantAdminException - on errorpublic void unsubscribe(String remoteName, String participantId) throws AdminException
remoteName - identification of the remote stream which is
effectively the peer’s name (participant)participantId - identifier of the participantAdminException - on errorpublic void onIceCandidate(String endpointName, String candidate, int sdpMLineIndex, String sdpMid, String participantId) throws AdminException
endpointName - the name of the peer whose ICE candidate was gatheredcandidate - the candidate attribute informationsdpMLineIndex - the index (starting at zero) of the m-line in the
SDP this candidate is associated withsdpMid - media stream identification, "audio" or "video", for the
m-line this candidate is associated withparticipantId - identifier of the participantAdminException - on errorpublic void addMediaElement(String participantId, org.kurento.client.MediaElement element) throws AdminException
participantId - identifier of the owner of the streamelement - media element to be addedAdminException - in case the participant doesn’t exist, has been
closed or on error when applying the filterpublic void addMediaElement(String participantId, org.kurento.client.MediaElement element, org.kurento.client.MediaType type) throws AdminException
participantId - identifier of the owner of the streamelement - media element to be addedtype - the connection type (null is accepted, has the same result as
calling addMediaElement(String, MediaElement))AdminException - in case the participant doesn’t exist, has been
closed or on error when applying the filterpublic void removeMediaElement(String participantId, org.kurento.client.MediaElement element) throws AdminException
participantId - identifier of the participantelement - media element to be removedAdminException - in case the participant doesn’t exist, has been
closed or on error when removing the filterpublic void mutePublishedMedia(MutedMediaType muteType, String participantId) throws AdminException
muteType - which leg should be disconnected (audio, video or both)participantId - identifier of the participantAdminException - in case the participant doesn’t exist, has been
closed, is not publishing or on error when performing the mute
operationpublic void unmutePublishedMedia(String participantId) throws AdminException
participantId - identifier of the participantAdminException - in case the participant doesn’t exist, has been
closed, is not publishing or on error when reverting the mute
operationpublic void muteSubscribedMedia(String remoteName, MutedMediaType muteType, String participantId) throws AdminException
remoteName - identification of the remote stream which is
effectively the peer’s name (participant)muteType - which leg should be disconnected (audio, video or both)participantId - identifier of the participantAdminException - in case the participant doesn’t exist, has been
closed, is not publishing or on error when performing the mute
operationpublic void unmuteSubscribedMedia(String remoteName, String participantId) throws AdminException
remoteName - identification of the remote stream which is
effectively the peer’s name (participant)participantId - identifier of the participantAdminException - in case the participant doesn’t exist, has been
closed or on error when reverting the mute operation@PreDestroy public void close()
RoomManager.closeRoom(String)public Set<String> getRooms()
public Set<UserParticipant> getParticipants(String roomName) throws AdminException
roomName - name or identifier of the roomUserParticipant POJOS (an instance contains the
participant’s identifier and her user name)AdminException - in case the room doesn’t existpublic Set<UserParticipant> getPublishers(String roomName) throws AdminException
roomName - name or identifier of the roomUserParticipant POJOS representing the existing
publishersAdminException - in case the room doesn’t existpublic Set<UserParticipant> getSubscribers(String roomName) throws AdminException
roomName - name or identifier of the roomUserParticipant POJOS representing the existing
subscribersAdminException - in case the room doesn’t existpublic Set<UserParticipant> getPeerPublishers(String participantId) throws AdminException
participantId - identifier of the participantUserParticipant POJOS representing the publishers
this participant is currently subscribed toAdminException - in case the participant doesn’t existpublic Set<UserParticipant> getPeerSubscribers(String participantId) throws AdminException
participantId - identifier of the participantUserParticipant POJOS representing the
participants subscribed to this peerAdminException - in case the participant doesn’t existpublic boolean isPublisherStreaming(String participantId) throws AdminException
participantId - identifier of the participantAdminException - in case the participant doesn’t exist or has been
closedpublic void createRoom(KurentoClientSessionInfo sessionInfo) throws AdminException
sessionInfo - bean that will be passed to the
KurentoClientProvider in order to obtain the
KurentoClient that will be used by the roomAdminException - in case of error while creating the roompublic void closeRoom(String roomName) throws AdminException
roomName - name or identifier of the roomAdminException - in case the room doesn’t exist or has been already
closedpublic org.kurento.client.MediaPipeline getPipeline(String participantId) throws AdminException
participantId - identifier of the participantAdminException - in case the participant doesn’t existCopyright © 2015 Kurento. All rights reserved.