openvidu-java-client API


This is a Java library wrapping OpenVidu Server REST API

Check JavaDoc documentation


Code samples

Create a session

OpenVidu openvidu = new OpenVidu(OPENVIDU_URL, OPENVIDU_SECRET);
SessionProperties properties = new SessionProperties.Builder().build();
Session session = openVidu.createSession(properties);

Generate a token

TokenOptions tokenOptions = new TokenOptions.Builder()
    .role(OpenViduRole.PUBLISHER)
    .data("user_data")
    .build();
String token = session.generateToken(tokenOptions);

Manage recordings

// Start recording
String sessionId = session.getSessionId();
RecordingProperties properties = new RecordingProperties.Builder().build();
Recording recordingStarted = openVidu.startRecording(sessionId, properties);

// Stop recording
String recordingId = recordingStarted.getId();
Recording recordingStopped = openvidu.stopRecording(recordingId);

// Get recording
Recording recordingRetrieved = openvidu.getRecording(recordingId);

// List recordings
List<Recording> recordingList = openVidu.listRecordings();

// Delete recording
openVidu.deleteRecording(recordingId);