Skip to main content

nanoMeet Web API

© 2021 nanocosmos.

This guide will help you to integrate nanoMeet into your development environment. Use the nanoMeet web API to to provide secure video meetings and broadcast them around the world in 1 second.

We also provide the following online samples:

nanoMeet is part of nanoStream Cloud. You need a nanoStream Cloud/Bintu account with nanoMeet enabled.

before getting started

If you do not have an account or nanoMeet enabled yet, please contact our sales team for a personal demo via contact form or sales(at)nanocosmos.de. To check if your organisation enables nanoMeet, check your organisation overview.

nanoMeet enabled

NanoMeet

NanoMeet Public Web API Class 1.0.0.

Kind: global class

Version: 1.0.0.

Integration

To integrate nanoMeet in your web page you need to load our nanoMeet Web API.

Example

<script src="https://nanomeet.pages.nanocosmos.de/nanomeet-frontend/js/nanomeet.js"></script>

new NanoMeet()

The instance of the NanoMeet web API. The source can be loaded via script tag.

Example

var nanoMeet = new NanoMeet();

nanoMeet.createNanoMeetRoom(apiKey, roomSetUp) => Promise.<success|error>

Creates a secure token that is needed to initialize and use nanoMeet.

Kind: Instance of the NanoMeet

ParamTypeDescription
apiKeyStringYour nanoStream Cloud/bintu API key.
roomSetUpObjectThe custom configuration for your custom nanoMeet room.
roomSetUp.nbfStringThe not before date for the secure token in ISO format.
roomSetUp.expStringThe expiration date for the secure token in ISO format.
roomSetUp.streamnameStringA passthrough streamname.
roomSetUp.serverStringThe server URL.
roomSetUp.roomStringThe room name. Valid Charset: a-z, A-Z, 0-9, _
roomSetUp.moderatorBooleanIf true the token gives the user permissions to create invite token, kick participants out and start the broadcast. Read here about the different roles.

Example roomSetUp Properties

var roomSetUp = {
nbf: "2021-01-22T06:00:01.000Z",
exp: "2021-01-29T06:00:01.000Z",
streamname: "XXXXX-YYYYY",
room: "my_nanoMeet_room",
server: "nanomeet-eu.nanocosmos.de",
moderator: true
}

Example

// Creation of a nanoMeet room
nanoMeet.createNanoMeetRoom(apikey, roomSetUp)
.then((success) => {
console.log("nanoMeet room:", success)
}).catch((error) => {
console.log("Error in creating a nanoMeet room:", error)
})

Success Response

data: {
expiration: "2021-01-29T06:00:01.000Z",
moderator: true,
notbefore: "2021-01-22T06:00:01.000Z",
room: "my_nanoMeet_room",
server: "nanomeet-eu.nanocosmos.de",
streamname: "XXXXX-YYYYY",
token: "SECURE-TOKEN" // secure token that needs to be provided when initializing nanoMeet on your webpage or creating an invite token
}

nanoMeet.createInviteToken(token, tokenSetup) => Promise.<success|error>

Creates an invite token for the nanoMeet room.

Kind: Instance of the NanoMeet

ParamTypeDescription
tokenStringA valid token with moderator rights for the room.
tokenSetup.moderatorBooleanIf true the token gives the user permissions to create invite token, kick participants out and start the broadcast. Read here about the different roles.
[tokenSetup.nbf]StringThe not before date for the secure token in ISO format. If it is not provided it will be the same as the date passed to the token.
[tokenSetup.exp]StringThe expiration date for the secure token in ISO format. If it is not provided it will be the same as the date passed to the token.

Example tokenSetup Properties

tokenSetup: {
token: "SECURE-TOKEN",
moderator: false,
exp: "2021-01-29T06:00:01.000Z",
nbf: "2021-01-22T06:00:01.000Z",
}

Example

// Creation of an invite token
nanoMeet.createInviteToken(token, tokenSetup)
.then((success) => {
console.log("Successful creation of a nanoMeet secure invite token:", success);
}).catch((error) => {
console.log("Error in creating a nanoMeet invite token:", error);
});

Success Response

data: {
moderator: false,
token: "SECURE-TOKEN", // secure token that needs to be provided to the invitee
inviteLink: "https://nanomeet.pages.nanocosmos.de/nanomeet-frontend/nanomeet-sample.html?token=token" // invite link to our nanoMeet sample
}

nanoMeet.init(config) => Promise.<(success|error)>

Initializes nanoMeet with the provided config object.

Kind: Instance of the NanoMeet

ParamTypeDescription
configObjectThe config object for nanoMeet including the secure token, id and styles.
config.tokenStringA valid secure token.
config.idStringThe ID of the div element the nanoMeet window will be embedded into.
[config.height]NumberThe height of the nanoMeet window. Default is 100%.
Note: The height you initialized can not be updated after you set it in the config. For dynamic changes regarding the height use the config.id selector (e.g. #nanoStream-meet { height: 500px; }).
[config.width]NumberThe width of the nanoMeet window. Default is 100%.
Note: The width you initialized can not be updated after you set it in the config. For dynamic changes regarding the width use the config.id selector (e.g. #nanoStream-meet { width: 500px; }).
[config.branding]StringThe branding URL that refers to a JSON file that brands nanoMeet. Default is nanocosmos branding. Read more here.

Example config Properties

config: {
token: "SECURE-TOKEN",
id: "nanoStream-meet",
height: 500,
width: 500,
branding: "https://nanomeet.pages.nanocosmos.de/nanomeet-frontend/nanomeet-branding.json"
}

Example

// Initialization of nanoMeet
nanoMeet.init(config)
.then((success) => {
console.log("nanoMeet setted up:", success);
}).catch((error) => {
console.log("Error setting up nanoMeet:", error);
});

Success Response

data: {
moderator: true
}

nanoMeet.startBroadcast(isVOD) => Promise.<(success|error)>

Starts a new broadcast. Can only be used if the nanoMeet.init(config) method was called before.

Kind: Instance of the NanoMeet

ParamTypeDescription
isVODBooleanIf true, the live stream will be available as VOD after stopping.

Example

// Initialization of nanoMeet
nanoMeet.startBroadcast(isVOD)
.then((success) => {
console.log("Starting broadcast of nanoMeet conference:", success);
console.log("Recording nanoMeet live stream:", isVOD);
}).catch((error) => {
console.log("Error starting broadcast:", error);
});

Success Response

data: {
playout: {
live: "https://demo.nanocosmos.de/nanoplayer/....",
vod: "https://bintu-vod.nanocosmos.de...."
}
}

nanoMeet.stopBroadcast() => Promise.<(success|error)>

Stops a running broadcast.

Kind: Instance of the NanoMeet

Example

// Initialization of nanoMeet
nanoMeet.stopBroadcast()
.then((success) => {
console.log("Stopped broadcast");
}).catch((error) => {
console.log("Error in stopping broadcast.");
});

Support

Do you need assistance using nanomeet?

Please use our support contact form for further assistance.