Appendix contains JSON Payloads and JSON Objects received with Callbacks of many methods and with Event Notifications. These are listed in random order.

Table of Contents

Token

Given below a decoded version of the JWT Token you receive when you create a Token using 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 his privileges within the session. EnxRoom.whoami() returns connected user information using this JSON structure. Further, the same JSON structure is used to carry user-information by many event notifications, e.g. room-connected, user-connected, user-disconnected, user-awaited etc.

{
     "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

Room Meta information contains complete Room Definition (Using Server API) along with many Run-Time parameters with their current values. This is received by all end-points after getting connected to Room along with room-connected event. Some of the run-time parameters are updated internally 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": ""
	},
     "streams":  [{			// 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
     "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
}

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
     "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  
     "forceTurn": true       // Boolean. Default false
			     // true: Stream flow through TURN Server only
			     // false: Steam flow through best available route
 }

Player Options

EnableX Player may be configured in a JSON Structure and passed in EnxRtc.joinRoom() or EnxStream.play() method.

{
	"playerID": "",			// Player ID 
	"elementID": "",		// DIV DOM Element ID 
	"backgroundImg": "",		// Image URL. To shown when no-video 
	"branding": {			// Logo Information on Player Area 
		 "clickthru":"",	// Clickt-hrough URL 
		 "logo": "",		// Logo URL 
		 "title": "",		// Title of Branding / Logo 
		 "position":""		// Enum: topLeft, topRight, bottomLeft, bottomRight 
	},
	"loader": {
		 "show": Boolean,	// Whether to show loader animationn Animation 
		 "url": "",		// Animation URL to overwrite default Animation 
		 "class": ""		// Custom CSS Class Name 
	},
	"player": {
		"autoplay": "",		// Enum: autoplay (default) 
		"name": "",		// Use stream.attributes.name preferably    
		"nameDisplayMode": "",  // Enum: auto (default), on, off
		"frameFitMode": "",	// Enum: bestFit (default), coverMax
		"skin":"default",	// Enum: default (default) 
		"class": "",		// Custom CSS Class Name 
		"height": "",		// Player Height in Px 
		"width":"",		// Player Width in Px 
		"minHeight": "",	// Player Min Height in Px 
		"minWidth": "",		// Player Min Width in Px 
		"volume": "0",		// Numeric. Use 0 to start with audio muted 
		"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 toolbar
		displayMode: false,	// To show/hide default toolbar
		branding: {		// To show/hide branding information i.e.logo 
			display: false
		}
	}
 }

Subscribed Stream Information

The following JSON Object you receive about a Stream you subscribed successfully along with the event stream-subscribed

{
     "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":{}
     }
 }