@stream-io/video-client 0.3.11 → 0.3.12
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 +126 -227
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +126 -227
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +126 -227
- package/dist/index.es.js.map +1 -1
- package/dist/src/rtc/codecs.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/Call.ts +1 -7
- package/src/rtc/codecs.ts +1 -35
package/dist/src/rtc/codecs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const getPreferredCodecs: (kind: 'audio' | 'video', preferredCodec: string, codecToRemove?: string) => RTCRtpCodecCapability[] | undefined;
|
|
2
|
-
export declare const getGenericSdp: (direction: RTCRtpTransceiverDirection
|
|
2
|
+
export declare const getGenericSdp: (direction: RTCRtpTransceiverDirection) => Promise<string>;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.3.
|
|
1
|
+
export declare const version = "0.3.12";
|
package/package.json
CHANGED
package/src/Call.ts
CHANGED
|
@@ -867,13 +867,7 @@ export class Call {
|
|
|
867
867
|
// prepare a generic SDP and send it to the SFU.
|
|
868
868
|
// this is a throw-away SDP that the SFU will use to determine
|
|
869
869
|
// the capabilities of the client (codec support, etc.)
|
|
870
|
-
.then(() =>
|
|
871
|
-
getGenericSdp(
|
|
872
|
-
'recvonly',
|
|
873
|
-
isRedEnabled,
|
|
874
|
-
this.streamClient.options.preferredVideoCodec,
|
|
875
|
-
),
|
|
876
|
-
)
|
|
870
|
+
.then(() => getGenericSdp('recvonly'))
|
|
877
871
|
.then((sdp) => {
|
|
878
872
|
const subscriptions = getCurrentValue(this.trackSubscriptionsSubject);
|
|
879
873
|
const migration: Migration | undefined = isMigrating
|
package/src/rtc/codecs.ts
CHANGED
|
@@ -46,48 +46,14 @@ export const getPreferredCodecs = (
|
|
|
46
46
|
return result;
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
export const getGenericSdp = async (
|
|
50
|
-
direction: RTCRtpTransceiverDirection,
|
|
51
|
-
isRedEnabled: boolean,
|
|
52
|
-
preferredVideoCodec: string | undefined,
|
|
53
|
-
) => {
|
|
49
|
+
export const getGenericSdp = async (direction: RTCRtpTransceiverDirection) => {
|
|
54
50
|
const tempPc = new RTCPeerConnection();
|
|
55
51
|
tempPc.addTransceiver('video', { direction });
|
|
56
|
-
|
|
57
|
-
// if ('setCodecPreferences' in videoTransceiver) {
|
|
58
|
-
// const videoCodecPreferences = getPreferredCodecs(
|
|
59
|
-
// 'audio',
|
|
60
|
-
// preferredVideoCodec ?? 'vp8',
|
|
61
|
-
// );
|
|
62
|
-
// videoTransceiver.setCodecPreferences([...(videoCodecPreferences ?? [])]);
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
52
|
tempPc.addTransceiver('audio', { direction });
|
|
66
|
-
const preferredAudioCodec = isRedEnabled ? 'red' : 'opus';
|
|
67
|
-
const audioCodecToRemove = !isRedEnabled ? 'red' : undefined;
|
|
68
|
-
|
|
69
|
-
// if ('setCodecPreferences' in audioTransceiver) {
|
|
70
|
-
// const audioCodecPreferences = getPreferredCodecs(
|
|
71
|
-
// 'audio',
|
|
72
|
-
// preferredAudioCodec,
|
|
73
|
-
// // audioCodecToRemove,
|
|
74
|
-
// );
|
|
75
|
-
// audioTransceiver.setCodecPreferences([...(audioCodecPreferences || [])]);
|
|
76
|
-
// }
|
|
77
53
|
|
|
78
54
|
const offer = await tempPc.createOffer();
|
|
79
55
|
let sdp = offer.sdp ?? '';
|
|
80
56
|
|
|
81
|
-
if (isReactNative()) {
|
|
82
|
-
if (preferredVideoCodec) {
|
|
83
|
-
sdp = setPreferredCodec(sdp, 'video', preferredVideoCodec);
|
|
84
|
-
}
|
|
85
|
-
sdp = setPreferredCodec(sdp, 'audio', preferredAudioCodec);
|
|
86
|
-
if (audioCodecToRemove) {
|
|
87
|
-
sdp = removeCodec(sdp, 'audio', audioCodecToRemove);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
57
|
tempPc.getTransceivers().forEach((t) => {
|
|
92
58
|
t.stop();
|
|
93
59
|
});
|