Appendix
This appendix contains JSON payloads and JSON objects with event notifications received with callbacks for numerous methods.
Token
Below is a decoded version of the JSON Web Token (JWT) token that you receive when you create a token using the Server API call.
{"tokenId": "", // Token ID"room": { // Room Definition"name": "","owner_ref": "","settings": { },"sip": { },"data": { },"created": "","_id": ""},"host": "", // EnableX Server hosting the session"secure": true, // Boolean. Whether to use Secured Web Socket"logId": "", // Unique Log ID for logging of session events"gateway": "", // EnableX Gateway"signature": "", // Token Signature"version": "0.1" // Toolkit Version used}
User Meta Information
User meta information contains connected user's data and privileges within a session. The EnxRoom.whoami() method returns this information using a JSON structure. Event notifications such as room-connected, user-connected, user-disconnected, and user-awaited use the same JSON structure to carry the user information.
{"clientId": "", // Unique Client ID assigned by EnableX"name": "", // User's name"user_ref": "", // User's Reference"role": "participant", // Enum: moderator, participant"permissions": { // In-Session Permission of User"publish": Boolean, // Whether user can pubish local stream"subscribe": Boolean, // Whether user can subscribe remote streams"record": Boolean, // Whether user can initiate recording"stats": Boolean, // Whether user can view stream status"controlhandlers": Boolean}}
Room Meta Information
The meta information of a room contains complete room definition (using the Server API) along with many runtime parameters with their current values. After getting connected to a room, this information is received by all endpoints along with the room-connected event. Some of the runtime parameters are internally updated by the toolkit on various events.
{"user": { // Connected User Meta Information/* user-meta-info-json-structure */},"room": {"name": "!", // Room Name"owner_ref": "", // Owner Reference"settings": { }, // Settings - Config"sip": { }, // SIP Config"data": { }, // Custom Data"created": "", // Room Creation Timestamp UTC"_id": ""},"remoteStreams": [{ // Streams in Room - to subscribe"id": 1,"audio": true,"video": true,"data": true,"screen": false,"attributes": {}}],"userList": [{ // Meta Information of connected users/* user-meta-info-json-structure */}],"awaitedParticipants": [ /*client-ids*/ ], // Users awaited to connect"raisedHands": [ /*client-ids*/ ], // Users seeking floor access"approvedHands": [ /*client-ids*/ ], // Users with floor access"pinnedUsers": [ /*client-ids*/ ], // Pinned User List"recording": false, // True if room is being recorded"hardmute": false, // True if room is on hard-mute state"defaultVideoBW": Number, // Default Video Bandwidth"maxVideoBW": Number // Max Video Bandwidth - Deprecated in Android SDK v2.0.1+}
Stream Options to initialize
{"audio": true, // Whether to add Audio to stream"video": true, // Whether to add Video to stream"data": true, // Whether to add Data to stream"screen": false, // Whether to add Screen Share to stream"videoSize": [minWidth, minHeight, maxWidth, maxHeight], // Video Frame Size - Deprecated in Android SDK v2.0.1+, iOS SDK v2.0.1+, React Native SDK v1.6+ & Flutter SDK v1.6+."audioMuted": true, // Audio muted on entry to room"videoMuted": true, // Video muted on entry to room"attributes": { // Object to carry custom data"custom1": ""},"options": {} // Video Player Options */"videoSize": [minWidth, minHeight, maxWidth, maxHeight],"maxVideoLayers": Number// Number of Video Layers in Stream// Enumerated Values: 1, 2, 3// 1=HD 720p layer only// 2=HD 720p & SD 480p layers only// 3=HD 720p, SD 480p & LD 240p/180p layers}
Player Options
You can configure EnableX Player in a JSON structure and pass it in EnxRtc.joinRoom or EnxStream.play method.
{"player": {"height": "", // Player Height in Px"width":"", // Player Width in Px - Deprecated in Android SDK v2.0.1+"minHeight": "", // Player Min Height in Px - Deprecated in Android SDK v2.0.1+"minWidth": "", // Player Min Width in Px"abwd": { // Video Drop Notice on Player on low bandwidth"receiveNotification": Boolean, // true to show Notice"language": "" // Enum: en, zh.// Default: en - Notice Language}},toolbar: { // To configure default player toolbardisplayMode: false, // To show/hide default toolbarbranding: { // To show/hide branding information i.e.logodisplay: false}}}
Subscribed Stream Information
If you successfully subscribed to a stream, the following JSON object is received about the stream along with the stream-subscribed event.
{"type":"stream-subscribed","stream":{"eventsList":{},"config":{"streamID":21,"local":false,"audio":false,"video":true,"data":false,"canvas":true,"attributes":{}},"stream":{},"showing":false,"local":false,"video":true,"audio":false,"audioMuted":false,"videoMuted":false,"hardAudioMuted":false,"hardVideoMuted":false,"selfMuteVideo":false,"selfMuteAudio":false,"ATVideoMuted":false,"processingVideoMute":false,"attributes":{},"Connection":{},"playerDivs":[],"canvas":true,"transactions":{},"pc":{}}}