@stream-io/video-client 1.11.5 → 1.11.6
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 +11 -9
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +11 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -9
- package/dist/index.es.js.map +1 -1
- package/dist/src/rtc/codecs.d.ts +2 -1
- package/package.json +1 -1
- package/src/rtc/Publisher.ts +8 -3
- package/src/rtc/codecs.ts +7 -3
package/dist/index.cjs.js
CHANGED
|
@@ -3349,7 +3349,7 @@ const retryable = async (rpc, signal) => {
|
|
|
3349
3349
|
return result;
|
|
3350
3350
|
};
|
|
3351
3351
|
|
|
3352
|
-
const version = "1.11.
|
|
3352
|
+
const version = "1.11.6";
|
|
3353
3353
|
const [major, minor, patch] = version.split('.');
|
|
3354
3354
|
let sdkInfo = {
|
|
3355
3355
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -3453,11 +3453,13 @@ var browsers = /*#__PURE__*/Object.freeze({
|
|
|
3453
3453
|
* @param kind the kind of codec to get.
|
|
3454
3454
|
* @param preferredCodec the codec to prioritize (vp8, h264, vp9, av1...).
|
|
3455
3455
|
* @param codecToRemove the codec to exclude from the list.
|
|
3456
|
+
* @param codecPreferencesSource the source of the codec preferences.
|
|
3456
3457
|
*/
|
|
3457
|
-
const getPreferredCodecs = (kind, preferredCodec, codecToRemove) => {
|
|
3458
|
-
|
|
3458
|
+
const getPreferredCodecs = (kind, preferredCodec, codecToRemove, codecPreferencesSource = 'receiver') => {
|
|
3459
|
+
const source = codecPreferencesSource === 'receiver' ? RTCRtpReceiver : RTCRtpSender;
|
|
3460
|
+
if (!('getCapabilities' in source))
|
|
3459
3461
|
return;
|
|
3460
|
-
const capabilities =
|
|
3462
|
+
const capabilities = source.getCapabilities(kind);
|
|
3461
3463
|
if (!capabilities)
|
|
3462
3464
|
return;
|
|
3463
3465
|
const preferred = [];
|
|
@@ -5895,9 +5897,9 @@ class Publisher {
|
|
|
5895
5897
|
this.getStats = (selector) => {
|
|
5896
5898
|
return this.pc.getStats(selector);
|
|
5897
5899
|
};
|
|
5898
|
-
this.getCodecPreferences = (trackType, preferredCodec) => {
|
|
5900
|
+
this.getCodecPreferences = (trackType, preferredCodec, codecPreferencesSource) => {
|
|
5899
5901
|
if (trackType === TrackType.VIDEO) {
|
|
5900
|
-
return getPreferredCodecs('video', preferredCodec || 'vp8');
|
|
5902
|
+
return getPreferredCodecs('video', preferredCodec || 'vp8', codecPreferencesSource);
|
|
5901
5903
|
}
|
|
5902
5904
|
if (trackType === TrackType.AUDIO) {
|
|
5903
5905
|
const defaultAudioCodec = this.isRedEnabled ? 'red' : 'opus';
|
|
@@ -6129,8 +6131,8 @@ class Publisher {
|
|
|
6129
6131
|
const opts = this.publishOptsForTrack.get(trackType);
|
|
6130
6132
|
if (!opts || !opts.forceSingleCodec)
|
|
6131
6133
|
return sdp;
|
|
6132
|
-
const codec = opts.forceCodec || opts.preferredCodec;
|
|
6133
|
-
const orderedCodecs = this.getCodecPreferences(trackType, codec);
|
|
6134
|
+
const codec = opts.forceCodec || getOptimalVideoCodec(opts.preferredCodec);
|
|
6135
|
+
const orderedCodecs = this.getCodecPreferences(trackType, codec, 'sender');
|
|
6134
6136
|
if (!orderedCodecs || orderedCodecs.length === 0)
|
|
6135
6137
|
return sdp;
|
|
6136
6138
|
const transceiver = this.transceiverCache.get(trackType);
|
|
@@ -13082,7 +13084,7 @@ class StreamClient {
|
|
|
13082
13084
|
});
|
|
13083
13085
|
};
|
|
13084
13086
|
this.getUserAgent = () => {
|
|
13085
|
-
const version = "1.11.
|
|
13087
|
+
const version = "1.11.6";
|
|
13086
13088
|
return (this.userAgent ||
|
|
13087
13089
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
13088
13090
|
};
|