Releases: OpenVidu/openvidu
v2.3.0
Release 2.3.0 - Release Notes available at Medium
v2.2.0
Release 2.2.0
OpenVidu now offers integrated and automated support for TURN server. We encourage developers to check out our post on Medium to learn more about it.
The platform now integrates by default a COTURN server as part of its ecosystem. This means that media connections will work OK even when clients are located on restricted networks. When deploying OpenVidu Server in Amazon Web Services with our Cloud Formation template no changes are required at all. If you are deploying OpenVidu Server on your own in an Ubuntu machine, installation instructions have changed a little bit. You have them properly updated here.
v2.1.0
Release v2.1.0
NEW FEATURES
OpenVidu Browser support for video management
We have implemented a new class in OpenVidu Browser aimed to better support declarative frontend framewroks such as Angular, React or Vue.js.
Now Publisher and Subscriber objects both inherit from StreamManager, which provides 2 different methods to tell OpenVidu what DOM video players should display each specific stream (addVideoElement
and createVideoElement
). This allows us to let OpenVidu take control of the video elements (even if our framework dinamically creates them) and do not worry about its internals. This is all explained in detail in Manage video players section.
If you want to check out a real example of this behaviuor, explore our renovated OpenVidu Angular tutorial.
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
...
v1.9.0
Release v1.9.0
CUSTOM LAYOUT RECORDING
Now you can create your own layouts for Session recording process. They are implemented with HTML/CSS/JS files, just as your OpenVidu application client-side.
-
Create your layout with HTML/CSS/JS files and put them in a path accessible to openvidu-server. There must be an
index.html
file as entrypoint for your custom layout:-
WHAT SHOULD YOUR JS CODE DO: by making use of
openvidu-browser-1.9.0.js
library, you need to connect a recorder participant to the session. This means:- Your layout must create the Session object like this:
var session = OV.initSession('wss://' + location.hostname + ':8443/' + SESSION_ID + '?secret=' + SECRET + '&recorder=true');
Being
SESSION_ID
andSECRET
two parameters that will be url-encoded under idssessionId
andsecret
respectively. So, for example:var url = new URL(window.location.href); var SESSION_ID = url.searchParams.get("sessionId"); var SECRET = url.searchParams.get("secret"); var session = OV.initSession('wss://' + location.hostname + ':8443/' + SESSION_ID + '?secret=' + SECRET + '&recorder=true');
- You will need to subscribe to, at least, two events:
streamCreated
andstreamDestroyed
of Session object. That way you can update your video layout when any user starts or stops publishing. To sum up, this would be the simplest code you need to properly start your recorder participant:
var OV = new OpenVidu(); var url = new URL(window.location.href); var SESSION_ID = url.searchParams.get("sessionId"); var SECRET = url.searchParams.get("secret"); var session = OV.initSession('wss://' + location.hostname + ':8443/' + SESSION_ID + '?secret=' + SECRET + '&recorder=true'); session.on("streamCreated", (event) => { session.subscribe(event.stream, 'html-id-where-insert-video'); }); session.on("streamDestroyed", (event) => { // The video is automatically removed by default but you can do whatever // you want here to update your layout when any user stops publishing }); session.connect(null, (error) => { if (error) { console.error(error); } });
-
HOW TO IDENTIFY YOUR USERS: you can identify them by making use of property
Stream.connection.data
of the Stream object retrieved in Session event "streamCreated". That way you may know which particular user should be displayed in which particular HTML element of your layout. For example:session.on("streamCreated", (event) => { var stream = event.stream; if (stream.connection.data === 'userBigVideo') { session.subscribe(stream, 'big-video-div'); } else if (stream.connection.data === 'userSmallVideo') { session.subscribe(stream, 'small-video-div'); } });
-
-
Add new properties when launching openvidu-server (
openvidu.recording.custom-layout
and a new-v
option if using Docker images):- openvidu-server-1.9.0.jar:
java -jar \ -Dopenvidu.recording=true \ -Dopenvidu.recording.path=/PATH/TO/VIDEO/FILES \ -Dopenvidu.recording.custom-layout: /PATH/TO/INDEX/CUSTOM/LAYOUT \ openvidu-server-1.9.0.jar
- openvidu-server-kms:1.9.0:
docker run -p 8443:8443 --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /PATH/TO/VIDEO/FILES:/PATH/TO/VIDEO/FILES \ -v /PATH/TO/INDEX/CUSTOM/LAYOUT:/PATH/TO/INDEX/CUSTOM/LAYOUT \ -e MY_UID=$(id -u $USER) \ -e openvidu.recording=true \ -e openvidu.recording.path=/PATH/TO/VIDEO/FILES \ -e openvidu.recording.custom-layout=/PATH/TO/INDEX/CUSTOM/LAYOUT \ openvidu/openvidu-server-kms:1.9.0
- openvidu-server:1.9.0 (KMS running as a native service in the same machine):
docker run --net="host" -p 8443:8443 --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /PATH/TO/VIDEO/FILES:/PATH/TO/VIDEO/FILES \ -v /PATH/TO/INDEX/CUSTOM/LAYOUT:/PATH/TO/INDEX/CUSTOM/LAYOUT \ -e MY_UID=$(id -u $USER) \ -e openvidu.recording=true \ -e openvidu.recording.path=/PATH/TO/VIDEO/FILES \ -e openvidu.recording.custom-layout=/PATH/TO/INDEX/CUSTOM/LAYOUT \ openvidu/openvidu-server:1.9.0
- openvidu-server-1.9.0.jar:
-
Configure your sessions to use your custom layout:
Do exactly the same process explained here, but changing
archiveLayout
fromBEST_FIT
toCUSTOM
.- If you are using the API REST, just change json body parameter
"archiveLayout":"BEST_FIT"
to"archiveLayout":"CUSTOM"
. - If you are using openvidu-java-client or openvidu-node-client, change
SessionProperties.Builder().archiveLayout(ArchiveLayout.BEST_FIT)
toSessionProperties.Builder().archiveLayout(ArchiveLayout.CUSTOM)
.
- If you are using the API REST, just change json body parameter
CONFIGURING MULIPLE CUSTOM LAYOUTS
You can implement as many custom recording layouts as you want. Simply store each one of them (each one with its own index.html
entrypoint file) in a subfolder under path /PATH/TO/INDEX/CUSTOM/LAYOUT
. Then, when configuring your sessions as stated above in point 3, just add a new parameter besides changing archiveLayout
property:
- If you are using the API REST, add an additional field to json body:
"archiveLayout":"CUSTOM", "customLayout":"RELATIVE/PATH/TO/INDEX"
- If you are using openvidu-java-client or openvidu-node-client, create SessionProperties object with a new step:
new SessionProperties.Builder() .archiveLayout(ArchiveLayout.CUSTOM).customLayout("RELATIVE/PATH/TO/INDEX").build())
Path RELATIVE/PATH/TO/INDEX
is the path from openvidu-server configuration property openvidu.recording.custom-layout
to the specific index.html
you want to use for a particular session recording. So, if you have the following folder tree structure:
/opt
+-- /openvidu
| +-- /my_custom_layouts
| +-- index.html
| +-- /layout1
| +-- index.html
| +-- /layout2
| +-- index.html
/etc
...
You should start openvidu-server with property openvidu.recording.custom-layout=/opt/openvidu/my_custom_layouts
and you can use any of the 3 index.html
files for recording any of your sessions. To use the outer layout, just configure archiveLayout
to CUSTOM
. To use any of the inner layouts, also configure customLayout
to layout1
or layout2
.
SAMPLE index.html
This is literally the simplest HTML for a custom recording layout. Use it as a template for building more complex ones.
<html>
<head><script src="openvidu-browser-1.9.0.min.js"></script></head>
<body>
<div id="videos"></div>
</body>
<script>
var url = new URL(window.location.href);
var SESSION_ID = url.searchParams.get("sessionId");
var SECRET = url.searchParams.get("secret");
var OV = new OpenVidu();
var session = OV.initSession('wss://localhost:8443/' + SESSION_ID + '?secret=' + SECRET + '&recorder=true');
session.on("streamCreated", (event) => {
session.subscribe(event.stream, 'videos');
});
session.on("streamDestroyed", (event) => {});
session.connect(null, (error) => {
if (error) {
console.error(error);
}
});
</script>
</html>
v1.9.0-beta-1
Release v1.9.0-beta-1
SAFARI SUPPORT
We are glad to announce the first version of OpenVidu compatible with Safari on the most recent versions of Mac and iOS. There's some work to do yet, and as this version may be unstable it will remain as a beta for now.
v1.8.0
Release v1.8.0
OPENVIDU-SERVER
- Recording API extended: manual start and stop. Get, List, Delete recordings
- Recording video files to MP4 (from less common MKV)
- Grid layout for recording greatly improved: OpenVidu now makes the most of the available space in the recording canvas layout. This is based on the fantastic opentok-layout-js open source library
OPENVIDU-BROWSER
-
New event 'videoElementDestroyed' for Subscribers and Publishers: openvidu-browser triggers this event once the library has automatically removed the HTML video from DOM.
-
New errors defined:
BROWSER_NOT_SUPPORTED
(onSession.connect()
method) andSCREEN_SHARING_NOT_SUPORTED
(onOpenVIdu.initPublisher()
method with 'screen' option) -
LocalRecorder API: record any Stream directly from the browser:
var OV = new OpenVidu(); var publisher = OV.initPublisher(‘elementId’, publisherOptions); var localRecorder = OV.initLocalRecorder(publisher.stream); localRecorder.record(); // Record video.... localRecorder.stop(); // End recording localRecorder.preview('preview-div'); // Preview recording in element with id 'preview-div' localRecorder.download(); // Save the video file localRecorder.uploadAsBinary("https://my-http-endpoint.com"); // Upload to an http endpoint
OTHER
- Now available Docker container openvidu/testapp: this is the application used in OpenVidu CI environment to test most of the features provided by the platform. Extremely useful for testing OpenVidu capabilities. Give it a try!
docker run -p 8443:8443 openvidu/testapp
# Access the app through https://localhost:8443
BUG FIXES
- Empty CDR file not being created on openvidu-server startup if
openvidu.cdr
property is set to 'false' - Fix bug when
OpenVidu.initPublisher()
was called beforeOpenVidu.initSession()
: now it is possible to initialize a Publisher object without initializing or connecting to a Session. This can be useful for using OpenVidu Browser local recording feature without video-call capabilities or just to use the simple API for 'getUserMedia' that OpenVidu Browser implements. - Bug fix for ugly race condition regarding
streamCreated
event (was sometimes being called twice for Subscriber objects when a Publisher and a Subscriber joined a Session at the exact same time).
v1.7.0
Release v1.7.0
- Session Recording (first version): check Advanced features: Recording
v1.5.0
Release v1.5.0
-
Call Detail Record
-
Dynamic change of Publisher without leaving the Session:
Session.unpublish(oldPubliser); newPublisher = OpenVidu.initPublisher(newOptions); Session.publish(newPublisher);
v1.4.0
Release v1.4.0
- Session.unpublish(Publisher)