Release Notes

Version 5.3.3 - June 29, 2019

Fixes

New

Internal changes

Version 5.2.1 - June 12, 2019

New

/**
 * Perform a GET network request directly to CS
 *
 * @param {string} url the request url to CS
 * @param {string} data_type the type of data expected back from the request (events, conversations, users)
 * @param {object} [params] network request params
 * @param {string} [params.cursor] cursor parameter to access the next or previous page of a data set
 * @param {number} [params.page_size] the number of resources returned in a single request list
 * @param {string} [params.order] 'asc' or 'desc' ordering of resources (usually based on creation time)
 * @param {string} [params.event_type] the type of event used to filter event requests ('member:joined', 'audio:dtmf', etc)
 *
 * @returns {Promise<XMLHttpRequest.response>} the XMLHttpRequest.response
 * @static
 * @example <caption>Sending a nexmo GET request</caption>
 */
  nexmoGetRequest(url, data_type, params).then((response) => {
    response.body: {},
    response.cursor: {
        prev: '',
        next: '',
        self: ''
    },
    response.page_size: 10
 });
//listening for member:left with reason
conversation.on('member:left', (member, event) => {
  console.log(event.body.reason);
});

/**
* Reason object format
*
* @param {object} [reason] the reason for kicking out a member
* @param {string} [reason.code] the code of the reason
* @param {string} [reason.text] the description of the reason
*/
conversation.on("member:call:status", (member) => {
   console.log(member.callStatus);
});

Version 5.2.0 - May 30, 2019

New

/**
  * Conversation listening for leg:status:update events.
  *
  * @event Conversation#leg:status:update
  *
  * @property {Member} member - the member whose leg status changed
  * @property {Event} event - leg:status:update event
  * @param {string} event.cid - the conversation id
  * @param {string} event.body.leg_id - the conversation leg id
  * @param {string} event.body.type - the conversation leg type (phone or app)
  * @param {string} event.body.status - the conversation member leg status
  * @param {Array} event.body.statusHistory - array of previous leg statuses
*/
conversation.on("leg:status:update", (member, event) {
  console.log(member, event);
});
conversation.on(<member_event>, (member, event) {
  console.log(event);
  // member_id: <member_id>,
  // conversation_id: <conversation_id>,
  // ...
  // channel: {
  //  to: {
  //    type: app
  //  },
  //  type: app,
  //  leg_ids: [<leg_id>]
  //  legs : [{ leg_id: <leg_id>, status: <leg_status>}],
  //  leg_settings: {},
  // },
  // state: <state>,
  // leg_ids: []
});

Version 5.1.0 - May 29, 2019

New

  * Send DTMF in a conversation
  *
  * @param {string} digits - the DTMF digit(s) to send
  * @returns {Promise<Event>}
 conversation.media.sendDTMF('digits')
conversation.on("audio:dtmf",(from, event)=>{
  event.digit // the dtmf digit(s) received
  event.from //id of the user who sent the dtmf
  event.timestamp //timestamp of the event
  event.cid // conversation id the event was sent to
  event.body // additional context about the dtmf
});
 conversation.media.enable({
    'audioConstraints': audioConstraints
 })
  * Replaces the stream's audio tracks currently being used as the sender's sources with a new one with new audio constraints
  * @param {object} constraints - audio constraints
  * @returns {Promise<MediaStream>} - Returns the new stream with the updated audio constraints.
  * @example
  * conversation.media.updateAudioConstraints({'autoGainControl': true})
  **/
  conversation.media.updateAudioConstraints(audioConstraints)
 })

Fixes

Internal breaking changes


Version 5.0.3 - May 23, 2019

Changes


Version 5.0.2 - May 30, 2019

New

media.enable({
  autoPlayAudio: true | false
})

Changes (internally)


Version 5.0.1 - April 30, 2019

Fixes

Breaking changes


Version 4.1.0 - April 26, 2019

Fixes

Changes


Version 4.0.2 - April 17, 2019

Changes

New

 * @class ConversationClient
 *
 * @param {object} param.log_reporter configure log reports for bugsnag tool
 * @param {Boolean} param.log_reporter.enabled=false
 * @param {string} param.log_reporter.bugsnag_key your bugsnag api key / defaults to Nexmo api key
member.on("media:connection:fail",(connection_details)=>{
  connection_details.rtc_id // my member's call id / leg id
  connection_details.remote_member_id // the id of the Member the stream belongs to
  connection_details.connection_event: // the connection fail event
  connection_details.type // the type of the connection (video or screenshare)
  connection_details.streamIndex // the streamIndex of the specific stream
});
* @event Member#media:connection:fail
*
* @property {number} payload.rtc_id the rtc_id / leg_id
* @property {string} payload.remote_member_id the id of the Member the stream belongs to
* @property {event} payload.connection_event the connection fail event

Breaking changes (internally)

type: 'member:media',
  from: member.member_id,
  conversation_id: member.conversation_id,
  body: {
    media: member.media,
    channel: member.channel
  }
type: 'member:invited',
  body: {
    media: {
      audio_settings: {
        enabled: false,
        earmuffed: false,
        muted: false
      }
    }
  }

Version 4.0.1 - March 4, 2019

New

if the Cache module is enabled the manual fetch of a conversation will store them in internal storage

usage:

  new ConverationClient({'sync':'full'});

Fixes

Breaking changes (internally)


Version 4.0.0 - February 1, 2019

Breaking Changes

 * @event Member#media:stream:on
 *
 * @property {number} payload.streamIndex the index number of this stream
 * @property {number} [payload.rtc_id] the rtc_id / leg_id
 * @property {string} [payload.remote_member_id] the id of the Member the stream belongs to
 * @property {string} [payload.name] the stream's display name
 * @property {MediaStream} payload.stream the stream that is activated
 * @property {boolean} [payload.video_mute] if the video is hidden
 * @property {boolean} [payload.audio_mute] if the audio is muted

New