Emit this socket event when the media session's state has changed. Eg.: the user has muted their microphone or disabled video.

Payload Parameters

NameDescriptionJSON type
categoryThe type of media session event.string
contentCurrent state of media session:
  • mediaSession: (object) Current media session state
    • audio: (boolean) Is the user sending audio enabled
    • connected: (boolean) Is the media session connected
    • screenshare: (boolean) Is the user sharing their screen
    • selfMuted: (boolean) Is the user muted locally
    • video: (boolean) Is the user sending video enabled
  • streamId: (string, optional) Unique identifier of the local media feed
  • Content-Type: (string) Content type of screenshare frames. 'image/jpeg'
  • image: (string) URL of screenshare frame image uploaded
  • timeUploaded: (int) UTC timestamp when client uploaded screenshare frame image
  • width: (int) Pixel width of screenshare frame image
  • height: (int) Pixel height of screenshare frame image
Object
commentOptional text description of socket event.string
createdTimestamp of when message item was created.string
topicIdUnique identifier of the space the media session is part of.string
loopbackMetadataOptional. This field will be passed back unchanged from server in MEDIA_SESSION_RESPONSE. This property is only sent to the socket connection that created it.Any

Media Session Event Categories

NameDescription
trackstatusChange in state of media session (eg.: user muted/unmuted). The first time trackstatus is sent/received is treated as starting the call.
video.endEnd audio/video call
video.startscreenshareStart sharing screen
video.screenshare.uploadurlRequest a set of urls to upload screen share frames
video.stopscreenshareScreen shared ended
video.screensharedataScreen share frame has been uploaded

Authorization

Subscribed to channel.

Example

socketConnection.emit('SEND_MEDIA_SESSION_EVENTS', payload);

Payload ('trackstatus')

{
  "category": "trackstatus",
  "content": {
      "mediaSession": {
        "audio": false,
        "connected": true,
        "screenshare": false,
        "selfMuted": true,
        "video": true
      },
      "streamId": "cadSY6i2Wp6owLgr76aVGqMw1fu6TXhJBLc1"
  },
  "topicId": "594140a11d108619100a7361",
  "loopbackMetadata": "some metadata"
}

Payload ('video.end')

{
  "topicId":"59665be02c305405b327c2d1",
  "created":"2017-07-20T13:14:52.130Z",
  "comment":"toggle Video Session",
  "category":"video.end"
}

Payload ('video.startscreenshare')

{
  "topicId":"59665be02c305405b327c2d7",
  "created":"2017-07-20T13:24:39.692Z",
  "category":"video.startscreenshare",
  "content":{
      "streamId":"ww4gCXQ4ghvgR7uoLmkVOfvSEcIN7kPltY11"
  }
}

Payload ('video.screenshare.uploadurl')

{
  "topicId":"59665be02c305405b327c2d7",
  "created":"2017-07-20T13:24:39.708Z",
  "category":"video.screenshare.uploadurl",
  "content":{
      "Content-Type":"image/jpeg"
  }
}

Payload ('video.screensharedata')

{
  "topicId":"59665be02c305405b327c2d1",
  "created":"2017-07-20T13:24:42.815Z",
  "category":"video.screensharedata",
  "content":{
      "image":"https://storage.googleapis.com/onesna/logan%2Fscreen_59665be02c305405b321c2d7%2F1?GoogleAccessId=logan-gcs@onesna-all.esna.com.iam.gserviceaccount.com&Expires=1500564280&Signature=a%2BJ3FDlp1noxBHtlPkSjGnVXSSxVNNifqmDJc8P8BPnNVzbQgITB0FKl7v5wDbWiel2Krpija5P3DcJerQE%2Fn3sgViIrNY0lU8RYCGN2Ap5KecJ%2BVO3wOCrLwk9tvzNc8%2FN%2BTHpZh1gHNZkC7YHI5Z1RS1okdd5sN6RaMMKD8DKi3298oCyw7R8VFYzfEIaBMnWEpPFSqXBoZ5wTHi0uGh4uCvR27E%2Bhkv1RSXrYLJn9F2kgjR5%2BX%2BTKZyjEr5rHODHUhZX8Qu1ieyzo786fO4BioCXuTC6Nd74dd8UaH4z2PuCQ%2FjhaPH7aBOC3%2BLjtbVrFWBNevgmL1LRdhcV6hQ%3D%3D&scrtm=1500557082814",
      "timeUploaded":1500557082251,
      "width":1920,
      "height":1080
  }
}

Payload ('video.stopscreenshare')

{
  "topicId":"59665be02c305405b327c2d1",
  "created":"2017-07-20T13:49:43.922Z",
  "category":"video.stopscreenshare",
  "content":{
      "streamId":"TndeYt1yiXxDJHwDz2I2icDvJLY5O6xmWxbN"
  }
}