Dolby.io Communications APIs SDK for Web Extensions
This project is a series of extensions for the Dolby.io Communications SDK for Web.
Install this project
Run the npm command to install the package @dolbyio/comms-sdk-web-extensions
into your project:
npm install @dolbyio/comms-sdk-web-extensions --save
Capabilities
Private Zones
Using the Spatial Audio capability, you now have the possibility to create private zones. Those are areas in your audio scene where only people in the zone can talk to each other.
const zone = {
origin: {
x: 0,
y: 0,
z: 0,
},
dimension: {
x: 100,
y: 100,
z: 100,
},
scale: {
x: 10,
y: 10,
z: 10,
},
};
const zoneId = await VoxeetSDKExt.privateZones.createZone(zone);
When using private zone, you MUST rely on the setSpatialPosition
function from the privateZones
object to move a participant at a different location.
const position = { x: 22, y: 33, z: 44 };
await VoxeetSDKExt.privateZones.setSpatialPosition(participant, position);
zone.origin = {
x: 100,
y: 50,
z: 0,
};
await VoxeetSDKExt.privateZones.updateZone(zoneId, zone);
await VoxeetSDKExt.privateZones.deleteZone(zoneId);
Conference
Add the possibility to switch from a user to a listener and from a listener to a user. Get an HTML video element for a specified participant.
const videoElement = VoxeetSDKExt.conference.attachMediaStreamToHTMLVideoElement(participant);
await VoxeetSDKExt.conference.switchToListener();
await VoxeetSDKExt.conference.switchToUser({
constraints: { video: false, audio: true },
});
Commands
Send a command to a specific participant in a conference.
Note: The commands are sent to all participants and filtered by this extension if the local participant is not in the target list.
VoxeetSDKExt.commands.on('received', (participant, message) => {
console.log(`The participant ${participant.id} has sent the following message: ${message}`);
});
await VoxeetSDKExt.commands.send('message', [participantA, participantB]);
await VoxeetSDKExt.commands.send('message', []);
Breakout Rooms
Create dynamic breakout rooms within a conference. By default all new participant join the main room. Then, you can create new breakout rooms and move participants into them.
await VoxeetSDKExt.breakout.initialize();
const room = {
name: 'Video games',
participants: [participantA, participantB, participantC],
};
const roomId = await VoxeetSDKExt.breakout.createRoom(room);
await VoxeetSDKExt.breakout.moveTo(roomId, [participantD]);
await VoxeetSDKExt.breakout.moveToMainRoom([participantA]);
await VoxeetSDKExt.breakout.closeRoom(roomId);
How to
Run tests:
npm run test
Create distribution package:
npm run build