Temasys / SkylinkJS

SkylinkJS Javascript WebRTC SDK
http://skylink.io/web
Other
275 stars 57 forks source link

Getting issues on media-stream/helpers/prepMediaAccessRequest.js #468

Closed stardustdev closed 2 years ago

stardustdev commented 3 years ago

The original code looks like the below.

const prepMediaAccessRequest = params => new Promise((resolve, reject) =>{ const { roomKey, ...rest } = params; const audioSettings = helpers.parseStreamSettings(rest, TRACK_KIND.AUDIO); const videoSettings = helpers.parseStreamSettings(rest, TRACK_KIND.VIDEO); ... } But it doesn't work on my side. So I updated the code like the following.

const { roomKey } = params; const audioSettings = helpers.parseStreamSettings(params, TRACK_KIND.AUDIO); const videoSettings = helpers.parseStreamSettings(params, TRACK_KIND.VIDEO);

What's wrong with this?

dinawee commented 3 years ago

@stardustdev The above rest parameters syntax should work on all modern browsers. For more information on the rest parameters syntax please refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters.