@stream-io/video-client 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.browser.es.js +17 -9
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +17 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +17 -9
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/src/logger.ts +5 -0
- package/src/rtc/Publisher.ts +5 -1
- package/src/rtc/codecs.ts +5 -7
package/package.json
CHANGED
package/src/logger.ts
CHANGED
|
@@ -17,6 +17,11 @@ export const logToConsole: Logger = (logLevel, message, ...args) => {
|
|
|
17
17
|
let logMethod;
|
|
18
18
|
switch (logLevel) {
|
|
19
19
|
case 'error':
|
|
20
|
+
if (isReactNative()) {
|
|
21
|
+
message = `ERROR: ${message}`;
|
|
22
|
+
logMethod = console.info;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
20
25
|
logMethod = console.error;
|
|
21
26
|
break;
|
|
22
27
|
case 'warn':
|
package/src/rtc/Publisher.ts
CHANGED
|
@@ -294,7 +294,11 @@ export class Publisher {
|
|
|
294
294
|
`Setting ${TrackType[trackType]} codec preferences`,
|
|
295
295
|
codecPreferences,
|
|
296
296
|
);
|
|
297
|
-
|
|
297
|
+
try {
|
|
298
|
+
transceiver.setCodecPreferences(codecPreferences);
|
|
299
|
+
} catch (err) {
|
|
300
|
+
logger('warn', `Couldn't set codec preferences`, err);
|
|
301
|
+
}
|
|
298
302
|
}
|
|
299
303
|
} else {
|
|
300
304
|
const previousTrack = transceiver.sender.track;
|
package/src/rtc/codecs.ts
CHANGED
|
@@ -6,18 +6,18 @@ export const getPreferredCodecs = (
|
|
|
6
6
|
codecToRemove?: string,
|
|
7
7
|
): RTCRtpCodecCapability[] | undefined => {
|
|
8
8
|
const logger = getLogger(['codecs']);
|
|
9
|
-
if (!('getCapabilities' in
|
|
10
|
-
logger
|
|
9
|
+
if (!('getCapabilities' in RTCRtpReceiver)) {
|
|
10
|
+
logger('warn', 'RTCRtpReceiver.getCapabilities is not supported');
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
const cap =
|
|
13
|
+
const cap = RTCRtpReceiver.getCapabilities(kind);
|
|
14
14
|
if (!cap) return;
|
|
15
15
|
const matched: RTCRtpCodecCapability[] = [];
|
|
16
16
|
const partialMatched: RTCRtpCodecCapability[] = [];
|
|
17
17
|
const unmatched: RTCRtpCodecCapability[] = [];
|
|
18
18
|
cap.codecs.forEach((c) => {
|
|
19
19
|
const codec = c.mimeType.toLowerCase();
|
|
20
|
-
logger
|
|
20
|
+
logger('debug', `Found supported codec: ${codec}`);
|
|
21
21
|
const shouldRemoveCodec =
|
|
22
22
|
codecToRemove && codec === `${kind}/${codecToRemove.toLowerCase()}`;
|
|
23
23
|
if (shouldRemoveCodec) return;
|
|
@@ -39,9 +39,7 @@ export const getPreferredCodecs = (
|
|
|
39
39
|
matched.push(c);
|
|
40
40
|
});
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
logger?.('info', `Preffered codecs: `, result);
|
|
44
|
-
return result;
|
|
42
|
+
return [...matched, ...partialMatched, ...unmatched];
|
|
45
43
|
};
|
|
46
44
|
|
|
47
45
|
export const getGenericSdp = async (direction: RTCRtpTransceiverDirection) => {
|