public class OpenVidu extends Object
| Constructor and Description |
|---|
OpenVidu(String urlOpenViduServer,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
Session |
createSession()
Creates an OpenVidu session with the default settings
|
Session |
createSession(SessionProperties properties)
Creates an OpenVidu session
|
void |
deleteRecording(String recordingId)
Deletes a recording.
|
boolean |
fetch()
Updates every property of every active Session with the current status they
have in OpenVidu Server.
|
List<Session> |
getActiveSessions()
Returns the list of active sessions.
|
Recording |
getRecording(String recordingId)
Gets an existing recording
|
List<Recording> |
listRecordings()
Lists all existing recordings
|
Recording |
startRecording(String sessionId)
Starts the recording of a
Session |
Recording |
startRecording(String sessionId,
RecordingProperties properties)
Starts the recording of a
Session |
Recording |
startRecording(String sessionId,
String name)
Starts the recording of a
Session |
Recording |
stopRecording(String recordingId)
Stops the recording of a
Session |
public Session createSession() throws OpenViduJavaClientException, OpenViduHttpException
OpenViduJavaClientExceptionOpenViduHttpExceptionpublic Session createSession(SessionProperties properties) throws OpenViduJavaClientException, OpenViduHttpException
properties - The specific configuration for this sessionOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
409: you are trying to
assign an already-in-use custom sessionId
to the session. See
SessionProperties.customSessionId()public Recording startRecording(String sessionId, RecordingProperties properties) throws OpenViduJavaClientException, OpenViduHttpException
SessionsessionId - The sessionId of the session you want to start recordingproperties - The configuration for this recordingOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
404: no session exists
for the passed sessionId406: the session has no
connected participants422: "resolution"
parameter exceeds acceptable values (for
both width and height, min 100px and max
1999px) or trying to start a recording
with both "hasAudio" and "hasVideo" to
false409: the session is not
configured for using
MediaMode.ROUTED
or it is already being recorded501: OpenVidu Server
recording module is disabled
(openvidu.recording property set
to false)public Recording startRecording(String sessionId, String name) throws OpenViduJavaClientException, OpenViduHttpException
SessionsessionId - The sessionId of the session you want to start recordingname - The name you want to give to the video file. You can access
this same value in your clients on recording events
(recordingStarted, recordingStopped). WARNING: this
parameter follows an overwriting policy. If you
name two recordings the same, the newest MP4 file will
overwrite the oldest oneOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
404: no session exists
for the passed sessionId406: the session has no
connected participants422: "resolution"
parameter exceeds acceptable values (for
both width and height, min 100px and max
1999px) or trying to start a recording
with both "hasAudio" and "hasVideo" to
false409: the session is not
configured for using
MediaMode.ROUTED
or it is already being recorded501: OpenVidu Server
recording module is disabled
(openvidu.recording property set
to false)public Recording startRecording(String sessionId) throws OpenViduJavaClientException, OpenViduHttpException
SessionsessionId - The sessionId of the session you want to start recordingOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
404: no session exists
for the passed sessionId406: the session has no
connected participants422: "resolution"
parameter exceeds acceptable values (for
both width and height, min 100px and max
1999px) or trying to start a recording
with both "hasAudio" and "hasVideo" to
false409: the session is not
configured for using
MediaMode.ROUTED
or it is already being recorded501: OpenVidu Server
recording module is disabled
(openvidu.recording property set
to false)public Recording stopRecording(String recordingId) throws OpenViduJavaClientException, OpenViduHttpException
SessionrecordingId - The id property of the recording you want to stopOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
404: no recording exists
for the passed recordingId406: recording has
starting status. Wait until
started status before stopping the
recordingpublic Recording getRecording(String recordingId) throws OpenViduJavaClientException, OpenViduHttpException
recordingId - The id property of the recording you want to retrieveOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
404: no recording exists
for the passed recordingIdpublic List<Recording> listRecordings() throws OpenViduJavaClientException, OpenViduHttpException
List with all existing recordingsOpenViduJavaClientExceptionOpenViduHttpExceptionpublic void deleteRecording(String recordingId) throws OpenViduJavaClientException, OpenViduHttpException
Recording.Status.stopped or
Recording.Status.availablerecordingId - The id property of the recording you want to deleteOpenViduJavaClientExceptionOpenViduHttpException - Value returned from
OpenViduHttpException.getStatus()
404: no recording exists
for the passed recordingId409: the recording has
started status. Stop it before
deletionpublic List<Session> getActiveSessions()
fetch()
was called. Exceptions to this rule are:
Session.fetch() updates that
specific Session statusSession.close() automatically
removes the Session from the list of active SessionsSession.forceDisconnect(Connection)
automatically updates the inner affected connections for that specific
SessionSession.forceUnpublish(Publisher)
also automatically updates the inner affected connections for that specific
SessionstartRecording(String)
and stopRecording(String)
automatically updates the recording status of the Session
(Session.isBeingRecorded())fetch() and then
getActiveSessions()public boolean fetch()
throws OpenViduJavaClientException,
OpenViduHttpException
getActiveSessions()OpenViduHttpExceptionOpenViduJavaClientExceptionCopyright © 2019 OpenVidu. All rights reserved.