nttcom / skyway-siru-client

SkyWay IoT SDK room utility for client app
Other
0 stars 1 forks source link

create `sendStream` method #3

Closed KensakuKOMATSU closed 6 years ago

KensakuKOMATSU commented 6 years ago
This method will send mediaStream to device. This method is useful for playing voice at remote speaker, recording audio and remote audio recognition etc.

@param {string} uuid - uuid of target device
@param {Object} stream - media stream object
@param {Object} [options]
@param {string} [options.audioCodec='opus'] - audio codec
@return {Promise<NULL>}

@example
navigator.mediaDevices.getUserMedia({ audio: true, video: false })
  .then( stream => 
    client.sendStream( uuid, stream, { audioCodec: 'opus' })
  ).then( () => console.log('start sending local stream') )
  .catch( err => console.warn(err) );
KensakuKOMATSU commented 6 years ago

https://github.com/nttcom/skyway-siru-client/commit/731e6c3b71294b1d0c66130967c8c0e8fc7c3876