Closed stardustdev closed 2 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.
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?