v2.0.0
Release v2.0.0
This is the first breaking change update for OpenVidu, which brings in lots of new features and internal improvements.
BREAKING CHANGES LIST
-
OpenVidu Browser
OpenVidu.initSession
now doesn't receive any input parameter.OpenVidu.initPublisher
input parameters have changed. Nowproperties
parameter must match PublisherProperties interface.Session.connect
method has been promisified. Change the last mandatorycallback
parameter for a Promise implementation:session.connect(token, (error) => { ... })
tosession.connect(token).then(() => {...}).catch(error => {...});
-
OpenVidu Java Client
- All
Archive
entities are now calledRecording
. This includes: classArchive
toRecording
, classArchiveMode
toRecordingMode
, classArchiveLayout
toRecordingLayout
, methodSessionProperties.archiveLayout()
toSessionProperties.recordingLayout()
, methodSessionProperties.archiveMode()
toSessionProperties.recordingMode()
, methodSessionProperties.Builder.archiveLayout()
toSessionProperties.Builder.recordingLayout()
, methodSessionProperties.Builder.archiveMode()
toSessionProperties.Builder.recordingMode()
RecordingLayout
property inSessionProperties.Builder
is now configured calling methoddefaultRecordingLayout()
instead ofrecordingLayout()
. This means that if one Session is gonna be recorded more than once, each recording layout may be customize withRecordingProperties.Builder.recordingLayout()
, which will overwrite the default one globally configured in SessionProperties object.
- All
-
OpenVidu Node Client
- We have removed the builder pattern in all openvidu-node-client classes. Now objects are used instead, which includes classes
TokenOptions
,SessionProperties
andRecordingProperties
. For example, instead of getting a TokenOptions object like this:var tokenOptions = new TokenOptions.Builder().data(serverData).role(role).build()
now it must be like this:var tokenOptions = {data: serverData, role: role}
- There has been a simple change in certain asynchronous call. Method
Session.getSessionId()
is now synchronous, but methodOpenVidu.createSession()
is now asynchronous (the reason is pretty simple: now method createSession implements the behaviour that getSessionId was providing the first time it was called for certain Session object). - All callback methods have been promisified. This includes method
Session.generateToken(tokenOptions?, callback): void
(nowSession.generateToken(tokenOptions?): Promise<string>
) and methodSession.getSessionId(callback): void
(nowOpenVidu.createSession(): Promise<Session>
, take also into account that the async call has changed from one method to the other as stated in the previous point). - All
Archive
entities are now calledRecording
. This includes: objectArchive
toRecording
, objectArchiveMode
toRecordingMode
, objectArchiveLayout
toRecordingLayout
, methodSessionProperties.archiveLayout()
toSessionProperties.recordingLayout()
, methodSessionProperties.archiveMode()
toSessionProperties.recordingMode()
, methodSessionProperties.Builder.archiveLayout()
toSessionProperties.Builder.recordingLayout()
, methodSessionProperties.Builder.archiveMode()
toSessionProperties.Builder.recordingMode()
recordingLayout
property inSessionProperties
has changed todefaultRecordingLayout
. This means that if one Session is gonna be recorded more than once, each recording layout may be customize withrecordingLayout
property (of RecordingProperties interface, which will overwrite the default one globally configured in SessionProperties object.
- We have removed the builder pattern in all openvidu-node-client classes. Now objects are used instead, which includes classes
-
REST API
- All
Archive
entities are now calledRecording
in API REST. For example:{"archiveMode": "ARCHIVE_MODE", "archiveLayout": "ARCHIVE_LAYOUT", "mediaMode": "MEDIA_MODE"}
now is{"recordingMode": "RECORDING_MODE", "recordingLayout": "RECORDING_LAYOUT", "mediaMode": "MEDIA_MODE"}
. - Field
recordingLayout
is now calleddefaultRecordingLayout
in operation POST /api/sessions. This means that if one Session is gonna be recorded more than once, each recording layout may be customize adding a new fieldrecordingLayout
in the call to POST /api/recordings/start of the API REST, which will overwrite the default one globally configured during POST /api/sessions
- All
-
Other breaking changes
- OpenVidu Server default port from
8443
to4443
- OpenVidu Server configuration property
openvidu.recording.free-access
is nowopenvidu.recording.public-access
- OpenVidu Server default port from
NEW FEATURES
-
OpenVidu Browser new methods
-
Session.publish()
: now returns a Promise so you can tell if the method was successful or not. -
Session.signal()
: now returns a Promise so you can tell if the method was successful or not. -
Subcriber.subscribeToAudio()
andSubscriber.subscribeToVideo()
: new methods that allows you to mute the audio or video tracks of a remote stream. -
OpenVidu.initPubliher()
: now expects properties as interface PublisherProperties. They include:{ audioSource: undefined, // The source of audio. If undefined default audio input videoSource: undefined, // The source of video. If undefined default video input publishAudio: true, // Whether you want to start publishing with your audio unmuted or muted publishVideo: true, // Whether you want to start publishing with your video enabled or not resolution: '640x480', // The resolution of your video frameRate: 30, // The frame rate of your video insertMode: 'APPEND', // How the video will be inserted in the target element mirror: false // Whether to mirror your local video or not }
-
Session.subscribe()
: now expects properties as interface SubscriberProperties. They include:{ insertMode: 'APPEND', // How the video will be inserted in the target element subscribeToAudio: true, // Whether to initially subscribe to the stream's audio track or not subscribeToVideo: true // Whether to initially subscribe to the stream's video track or not }
-
OpenVidu.getDevices()
: now you can use certain video or audio input device when callingOpenVidu.initPublisher()
, thanks to propertiesaudioSource
orvideoSource
ofPublisherProperties
object. Just set these variables to the propertydeviceId
of any of the devices returned by this method. -
OpenVidu.getUserMedia()
: method improved. Now devs can customize a MediaStream object before callingOpenVidu.initPublisher()
method, setting propertyaudioSource
orvideoSource
to a MediaStreamTrack object (see docs for further information)
-
-
OpenVidu Browser new properties
Stream.frameRate
: new property defining the frame rate of video streams. This property will only have value if the Publisher owning the stream has set propertyframeRate
ofPublisherProperties
when callingOpenVidu.initPublisher()
-
OpenVidu Browser events
- New events
accessDialogOpened
andaccessDialogClosed
: dispatched by Publisher objects when the browser asks the user to grant permissions to camera or michrophone by opening a pop-up. You can use them to warn your users about it. - New events
recordingStarted
andrecordingStopped
: dispatched by Session object when the recording of a Session starts and stops. You can customize which clients will receive this event thanks to new propertyopenvidu.recording.notification
(see OpenVidu Server configuration) - Events
publisherStartSpeaking
andpublisherStopSpeaking
improved: more customizable thanks to OpenVidu.setAdvancedConfiguration() and better overall performance. - Events
streamDestroyed
,connectionDestroyed
andsessionDisconnected
have new propertyreason
. This gives more information about why the events have been dispatched so you can take specific actions depending on the context: maybe a stream has been destroyed because the user publishing has deliberately diposed it or maybe the network connection has unexpectedly closed (see docs for StreamEvent, ConnectionEvent and SessionDisconnectedEvent)
- New events
-
Other improvements in OpenVidu Browser
- Support for custom screen sharing extensions for Chrome
- Support for custom STUN and TURN servers in openvidu-browser. Use OpenVidu.setAdvancedConfiguration()
- Library size decreased in almost 30% (openvidu-browser.min.js from 300 KB to 216 KB)
-
OpenVidu Server new features
- New property
name
for recordings: you can now specify which name should OpenVidu Server give to each one of your recording files. You can do it by using the REST API (by setting body parameter "name" in POST /api/recordings/start), openvidu-java-client (by using RecordingProperties.Builder.name()) or openvidu-node-client (by setting property RecordingProperties.name) - Now support for initializing sessions with a custom
sessionId
. You can take advantage of this new property to facilitate the mapping between OpenVidu Server 'session' entities and your own 'session' entities. You can set it by using the REST API (by setting body parameter "customSessionId" in POST /api/sessions), openvidu-java-client (by using SessionProperties.Builder.customSessionId()) or openvidu-node-client (by setting property SessionProperties.customSessionId) - Call Detail Record extended: new events
recordingStarted
andrecordingStopped
, propertyreason
for eventssessionDestroyed
,participantLeft
andwebrtcConnectionDestroyed
.
- New property
BUG FIXES
- Now when any participant unexpectedly disconnects from a session (for example, due to a network failure),
connectionDestroyed
event is sent to the rest of participants with propertyreason
set tonetworkDisconnect
. - When OpenVidu Server is stopped, it will try to gracefully finish every in progress session and recording. This way no recording file will end corrupted upon OpenVidu Server termination (this cannot be granted if the process crashes or is forcibly terminated)
- Now both STUN and TURN OpenVidu Server configuration parameters can be set up at the same time with no overwritings.
- Tons of small fixes and code refactoring that makes OpenVidu more stable and easy to test and develop