@whereby.com/media 8.1.0 → 8.2.1
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/dist/index.cjs +26 -2
- package/dist/index.d.cts +16 -3
- package/dist/index.d.mts +16 -3
- package/dist/index.d.ts +16 -3
- package/dist/index.mjs +26 -2
- package/dist/legacy-esm.js +26 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -489,7 +489,7 @@ var _a$5;
|
|
|
489
489
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
490
490
|
const logger$a = new Logger();
|
|
491
491
|
class Session {
|
|
492
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
492
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }) {
|
|
493
493
|
this.relayCandidateSeen = false;
|
|
494
494
|
this.serverReflexiveCandidateSeen = false;
|
|
495
495
|
this.publicHostCandidateSeen = false;
|
|
@@ -498,6 +498,7 @@ class Session {
|
|
|
498
498
|
this.ipv6HostCandidate6to4Seen = false;
|
|
499
499
|
this.mdnsHostCandidateSeen = false;
|
|
500
500
|
this.pendingReplaceTrackActions = [];
|
|
501
|
+
this._mediaPrefs = mediaPrefs;
|
|
501
502
|
this.peerConnectionConfig = peerConnectionConfig;
|
|
502
503
|
this.clientId = clientId;
|
|
503
504
|
this.pc = new RTCPeerConnection(this.peerConnectionConfig);
|
|
@@ -530,16 +531,24 @@ class Session {
|
|
|
530
531
|
this._incrementAnalyticMetric = incrementAnalyticMetric;
|
|
531
532
|
}
|
|
532
533
|
addStream(stream) {
|
|
534
|
+
var _a;
|
|
533
535
|
this.streamIds.push(stream.id);
|
|
534
536
|
this.streams.push(stream);
|
|
535
537
|
stream.getAudioTracks().forEach((track) => {
|
|
536
538
|
this.pc.addTrack(track, stream);
|
|
537
539
|
});
|
|
540
|
+
if (((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
538
543
|
stream.getVideoTracks().forEach((track) => {
|
|
539
544
|
this.pc.addTrack(track, stream);
|
|
540
545
|
});
|
|
541
546
|
}
|
|
542
547
|
addTrack(track, stream) {
|
|
548
|
+
var _a;
|
|
549
|
+
if (track.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
543
552
|
if (!stream) {
|
|
544
553
|
stream = this.streams[0];
|
|
545
554
|
}
|
|
@@ -663,10 +672,14 @@ class Session {
|
|
|
663
672
|
}
|
|
664
673
|
replaceTrack(oldTrack, newTrack) {
|
|
665
674
|
return __awaiter(this, void 0, void 0, function* () {
|
|
675
|
+
var _a;
|
|
666
676
|
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
667
677
|
if (newTrack.readyState === "ended") {
|
|
668
678
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
669
679
|
}
|
|
680
|
+
if (newTrack.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
670
683
|
const pc = this.pc;
|
|
671
684
|
if (oldTrack) {
|
|
672
685
|
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
@@ -2471,6 +2484,7 @@ if (browserName$1 === "chrome") {
|
|
|
2471
2484
|
}
|
|
2472
2485
|
class P2pRtcManager {
|
|
2473
2486
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features }) {
|
|
2487
|
+
this._remoteClientMediaPrefs = {};
|
|
2474
2488
|
const { name, session, iceServers, turnServers, mediaserverConfigTtlSeconds } = room;
|
|
2475
2489
|
this._selfId = selfId;
|
|
2476
2490
|
this._roomName = name;
|
|
@@ -2757,6 +2771,12 @@ class P2pRtcManager {
|
|
|
2757
2771
|
this._screenshareVideoTrackIds.push(localScreenShareTrack.id);
|
|
2758
2772
|
}
|
|
2759
2773
|
}
|
|
2774
|
+
setRemoteClientMediaPrefs(clientId, mediaPrefs) {
|
|
2775
|
+
this._remoteClientMediaPrefs[clientId] = mediaPrefs;
|
|
2776
|
+
}
|
|
2777
|
+
removeRemoteClientMediaPrefs(clientId) {
|
|
2778
|
+
delete this._remoteClientMediaPrefs[clientId];
|
|
2779
|
+
}
|
|
2760
2780
|
setRoomSessionId(roomSessionId) {
|
|
2761
2781
|
this._roomSessionId = roomSessionId;
|
|
2762
2782
|
}
|
|
@@ -2836,6 +2856,7 @@ class P2pRtcManager {
|
|
|
2836
2856
|
bandwidth: initialBandwidth,
|
|
2837
2857
|
deprioritizeH264Encoding,
|
|
2838
2858
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2859
|
+
mediaPrefs: this._remoteClientMediaPrefs[clientId],
|
|
2839
2860
|
});
|
|
2840
2861
|
this.peerConnections[clientId] = session;
|
|
2841
2862
|
setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
|
|
@@ -3079,7 +3100,7 @@ class P2pRtcManager {
|
|
|
3079
3100
|
this._setJitterBufferTarget(pc);
|
|
3080
3101
|
}
|
|
3081
3102
|
if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
|
|
3082
|
-
|
|
3103
|
+
session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
|
|
3083
3104
|
}
|
|
3084
3105
|
return session;
|
|
3085
3106
|
}
|
|
@@ -3089,6 +3110,7 @@ class P2pRtcManager {
|
|
|
3089
3110
|
logger$6.warn("No RTCPeerConnection in RTCManager.disconnect()", clientId);
|
|
3090
3111
|
return;
|
|
3091
3112
|
}
|
|
3113
|
+
this.removeRemoteClientMediaPrefs(session.clientId);
|
|
3092
3114
|
session.close();
|
|
3093
3115
|
delete this.peerConnections[clientId];
|
|
3094
3116
|
}
|
|
@@ -5288,6 +5310,8 @@ class VegaRtcManager {
|
|
|
5288
5310
|
(_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.message(audioOnly ? "enableAudioOnly" : "disableAudioOnly");
|
|
5289
5311
|
}
|
|
5290
5312
|
setRemoteScreenshareVideoTrackIds() { }
|
|
5313
|
+
setRemoteClientMediaPrefs() { }
|
|
5314
|
+
removeRemoteClientMediaPrefs() { }
|
|
5291
5315
|
setRoomSessionId(roomSessionId) {
|
|
5292
5316
|
this._roomSessionId = roomSessionId;
|
|
5293
5317
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -448,6 +448,9 @@ interface VegaConnectionOptions {
|
|
|
448
448
|
protocol?: string;
|
|
449
449
|
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
450
450
|
}
|
|
451
|
+
type MediaPrefs = {
|
|
452
|
+
wantsVideo: boolean;
|
|
453
|
+
};
|
|
451
454
|
interface RtcManager {
|
|
452
455
|
acceptNewStream: ({ clientId, streamId }: {
|
|
453
456
|
clientId: string;
|
|
@@ -473,6 +476,9 @@ interface RtcManager {
|
|
|
473
476
|
isSfu: boolean;
|
|
474
477
|
}): boolean;
|
|
475
478
|
setEventClaim?(eventClaim: string): void;
|
|
479
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds: string[]): void;
|
|
480
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
481
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
476
482
|
hasClient(clientId: string): boolean;
|
|
477
483
|
}
|
|
478
484
|
interface RtcManagerCreatedPayload {
|
|
@@ -1257,6 +1263,7 @@ interface P2PSessionOptions {
|
|
|
1257
1263
|
peerConnectionConfig: RTCConfiguration;
|
|
1258
1264
|
deprioritizeH264Encoding: boolean;
|
|
1259
1265
|
incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1266
|
+
mediaPrefs?: MediaPrefs;
|
|
1260
1267
|
}
|
|
1261
1268
|
declare class Session {
|
|
1262
1269
|
relayCandidateSeen: boolean;
|
|
@@ -1278,13 +1285,14 @@ declare class Session {
|
|
|
1278
1285
|
afterConnected: Promise<unknown>;
|
|
1279
1286
|
registerConnected?: (value: unknown) => void;
|
|
1280
1287
|
_deprioritizeH264Encoding: boolean;
|
|
1288
|
+
_mediaPrefs?: MediaPrefs;
|
|
1281
1289
|
clientId: any;
|
|
1282
1290
|
peerConnectionConfig: RTCConfiguration;
|
|
1283
1291
|
signalingState: any;
|
|
1284
1292
|
srdComplete: any;
|
|
1285
1293
|
_incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1286
1294
|
pendingReplaceTrackActions: (() => Promise<void>)[];
|
|
1287
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
|
|
1295
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }: P2PSessionOptions);
|
|
1288
1296
|
addStream(stream: MediaStream): void;
|
|
1289
1297
|
addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
|
|
1290
1298
|
removeTrack(track: MediaStreamTrack): void;
|
|
@@ -1348,6 +1356,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1348
1356
|
_localCameraStream?: MediaStream;
|
|
1349
1357
|
_localScreenshareStream?: MediaStream;
|
|
1350
1358
|
_screenshareVideoTrackIds: string[];
|
|
1359
|
+
_remoteClientMediaPrefs: Record<string, MediaPrefs>;
|
|
1351
1360
|
_socketListenerDeregisterFunctions: any[];
|
|
1352
1361
|
_localStreamDeregisterFunction: any;
|
|
1353
1362
|
_emitter: any;
|
|
@@ -1394,7 +1403,9 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1394
1403
|
rtcStatsDisconnect(): void;
|
|
1395
1404
|
rtcStatsReconnect(): void;
|
|
1396
1405
|
setAudioOnly(audioOnly: boolean): void;
|
|
1397
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?:
|
|
1406
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: string[]): void;
|
|
1407
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
1408
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
1398
1409
|
setRoomSessionId(roomSessionId: string): void;
|
|
1399
1410
|
_setConnectionStatus(session: Session, newStatus: string, clientId: string): void;
|
|
1400
1411
|
_setJitterBufferTarget(pc: RTCPeerConnection): void;
|
|
@@ -1740,6 +1751,8 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1740
1751
|
setColocation(colocation: any): void;
|
|
1741
1752
|
setAudioOnly(audioOnly: boolean): void;
|
|
1742
1753
|
setRemoteScreenshareVideoTrackIds(): void;
|
|
1754
|
+
setRemoteClientMediaPrefs(): void;
|
|
1755
|
+
removeRemoteClientMediaPrefs(): void;
|
|
1743
1756
|
setRoomSessionId(roomSessionId: string): void;
|
|
1744
1757
|
disconnect(clientId: string, eventClaim?: string): void;
|
|
1745
1758
|
replaceTrack(_: MediaStreamTrack | null, track: MediaStreamTrack): void;
|
|
@@ -1970,4 +1983,4 @@ declare const STREAM_TYPES: {
|
|
|
1970
1983
|
};
|
|
1971
1984
|
|
|
1972
1985
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1973
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1986
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.d.mts
CHANGED
|
@@ -448,6 +448,9 @@ interface VegaConnectionOptions {
|
|
|
448
448
|
protocol?: string;
|
|
449
449
|
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
450
450
|
}
|
|
451
|
+
type MediaPrefs = {
|
|
452
|
+
wantsVideo: boolean;
|
|
453
|
+
};
|
|
451
454
|
interface RtcManager {
|
|
452
455
|
acceptNewStream: ({ clientId, streamId }: {
|
|
453
456
|
clientId: string;
|
|
@@ -473,6 +476,9 @@ interface RtcManager {
|
|
|
473
476
|
isSfu: boolean;
|
|
474
477
|
}): boolean;
|
|
475
478
|
setEventClaim?(eventClaim: string): void;
|
|
479
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds: string[]): void;
|
|
480
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
481
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
476
482
|
hasClient(clientId: string): boolean;
|
|
477
483
|
}
|
|
478
484
|
interface RtcManagerCreatedPayload {
|
|
@@ -1257,6 +1263,7 @@ interface P2PSessionOptions {
|
|
|
1257
1263
|
peerConnectionConfig: RTCConfiguration;
|
|
1258
1264
|
deprioritizeH264Encoding: boolean;
|
|
1259
1265
|
incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1266
|
+
mediaPrefs?: MediaPrefs;
|
|
1260
1267
|
}
|
|
1261
1268
|
declare class Session {
|
|
1262
1269
|
relayCandidateSeen: boolean;
|
|
@@ -1278,13 +1285,14 @@ declare class Session {
|
|
|
1278
1285
|
afterConnected: Promise<unknown>;
|
|
1279
1286
|
registerConnected?: (value: unknown) => void;
|
|
1280
1287
|
_deprioritizeH264Encoding: boolean;
|
|
1288
|
+
_mediaPrefs?: MediaPrefs;
|
|
1281
1289
|
clientId: any;
|
|
1282
1290
|
peerConnectionConfig: RTCConfiguration;
|
|
1283
1291
|
signalingState: any;
|
|
1284
1292
|
srdComplete: any;
|
|
1285
1293
|
_incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1286
1294
|
pendingReplaceTrackActions: (() => Promise<void>)[];
|
|
1287
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
|
|
1295
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }: P2PSessionOptions);
|
|
1288
1296
|
addStream(stream: MediaStream): void;
|
|
1289
1297
|
addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
|
|
1290
1298
|
removeTrack(track: MediaStreamTrack): void;
|
|
@@ -1348,6 +1356,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1348
1356
|
_localCameraStream?: MediaStream;
|
|
1349
1357
|
_localScreenshareStream?: MediaStream;
|
|
1350
1358
|
_screenshareVideoTrackIds: string[];
|
|
1359
|
+
_remoteClientMediaPrefs: Record<string, MediaPrefs>;
|
|
1351
1360
|
_socketListenerDeregisterFunctions: any[];
|
|
1352
1361
|
_localStreamDeregisterFunction: any;
|
|
1353
1362
|
_emitter: any;
|
|
@@ -1394,7 +1403,9 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1394
1403
|
rtcStatsDisconnect(): void;
|
|
1395
1404
|
rtcStatsReconnect(): void;
|
|
1396
1405
|
setAudioOnly(audioOnly: boolean): void;
|
|
1397
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?:
|
|
1406
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: string[]): void;
|
|
1407
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
1408
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
1398
1409
|
setRoomSessionId(roomSessionId: string): void;
|
|
1399
1410
|
_setConnectionStatus(session: Session, newStatus: string, clientId: string): void;
|
|
1400
1411
|
_setJitterBufferTarget(pc: RTCPeerConnection): void;
|
|
@@ -1740,6 +1751,8 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1740
1751
|
setColocation(colocation: any): void;
|
|
1741
1752
|
setAudioOnly(audioOnly: boolean): void;
|
|
1742
1753
|
setRemoteScreenshareVideoTrackIds(): void;
|
|
1754
|
+
setRemoteClientMediaPrefs(): void;
|
|
1755
|
+
removeRemoteClientMediaPrefs(): void;
|
|
1743
1756
|
setRoomSessionId(roomSessionId: string): void;
|
|
1744
1757
|
disconnect(clientId: string, eventClaim?: string): void;
|
|
1745
1758
|
replaceTrack(_: MediaStreamTrack | null, track: MediaStreamTrack): void;
|
|
@@ -1970,4 +1983,4 @@ declare const STREAM_TYPES: {
|
|
|
1970
1983
|
};
|
|
1971
1984
|
|
|
1972
1985
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1973
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1986
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -448,6 +448,9 @@ interface VegaConnectionOptions {
|
|
|
448
448
|
protocol?: string;
|
|
449
449
|
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
450
450
|
}
|
|
451
|
+
type MediaPrefs = {
|
|
452
|
+
wantsVideo: boolean;
|
|
453
|
+
};
|
|
451
454
|
interface RtcManager {
|
|
452
455
|
acceptNewStream: ({ clientId, streamId }: {
|
|
453
456
|
clientId: string;
|
|
@@ -473,6 +476,9 @@ interface RtcManager {
|
|
|
473
476
|
isSfu: boolean;
|
|
474
477
|
}): boolean;
|
|
475
478
|
setEventClaim?(eventClaim: string): void;
|
|
479
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds: string[]): void;
|
|
480
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
481
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
476
482
|
hasClient(clientId: string): boolean;
|
|
477
483
|
}
|
|
478
484
|
interface RtcManagerCreatedPayload {
|
|
@@ -1257,6 +1263,7 @@ interface P2PSessionOptions {
|
|
|
1257
1263
|
peerConnectionConfig: RTCConfiguration;
|
|
1258
1264
|
deprioritizeH264Encoding: boolean;
|
|
1259
1265
|
incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1266
|
+
mediaPrefs?: MediaPrefs;
|
|
1260
1267
|
}
|
|
1261
1268
|
declare class Session {
|
|
1262
1269
|
relayCandidateSeen: boolean;
|
|
@@ -1278,13 +1285,14 @@ declare class Session {
|
|
|
1278
1285
|
afterConnected: Promise<unknown>;
|
|
1279
1286
|
registerConnected?: (value: unknown) => void;
|
|
1280
1287
|
_deprioritizeH264Encoding: boolean;
|
|
1288
|
+
_mediaPrefs?: MediaPrefs;
|
|
1281
1289
|
clientId: any;
|
|
1282
1290
|
peerConnectionConfig: RTCConfiguration;
|
|
1283
1291
|
signalingState: any;
|
|
1284
1292
|
srdComplete: any;
|
|
1285
1293
|
_incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1286
1294
|
pendingReplaceTrackActions: (() => Promise<void>)[];
|
|
1287
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
|
|
1295
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }: P2PSessionOptions);
|
|
1288
1296
|
addStream(stream: MediaStream): void;
|
|
1289
1297
|
addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
|
|
1290
1298
|
removeTrack(track: MediaStreamTrack): void;
|
|
@@ -1348,6 +1356,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1348
1356
|
_localCameraStream?: MediaStream;
|
|
1349
1357
|
_localScreenshareStream?: MediaStream;
|
|
1350
1358
|
_screenshareVideoTrackIds: string[];
|
|
1359
|
+
_remoteClientMediaPrefs: Record<string, MediaPrefs>;
|
|
1351
1360
|
_socketListenerDeregisterFunctions: any[];
|
|
1352
1361
|
_localStreamDeregisterFunction: any;
|
|
1353
1362
|
_emitter: any;
|
|
@@ -1394,7 +1403,9 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1394
1403
|
rtcStatsDisconnect(): void;
|
|
1395
1404
|
rtcStatsReconnect(): void;
|
|
1396
1405
|
setAudioOnly(audioOnly: boolean): void;
|
|
1397
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?:
|
|
1406
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: string[]): void;
|
|
1407
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
1408
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
1398
1409
|
setRoomSessionId(roomSessionId: string): void;
|
|
1399
1410
|
_setConnectionStatus(session: Session, newStatus: string, clientId: string): void;
|
|
1400
1411
|
_setJitterBufferTarget(pc: RTCPeerConnection): void;
|
|
@@ -1740,6 +1751,8 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1740
1751
|
setColocation(colocation: any): void;
|
|
1741
1752
|
setAudioOnly(audioOnly: boolean): void;
|
|
1742
1753
|
setRemoteScreenshareVideoTrackIds(): void;
|
|
1754
|
+
setRemoteClientMediaPrefs(): void;
|
|
1755
|
+
removeRemoteClientMediaPrefs(): void;
|
|
1743
1756
|
setRoomSessionId(roomSessionId: string): void;
|
|
1744
1757
|
disconnect(clientId: string, eventClaim?: string): void;
|
|
1745
1758
|
replaceTrack(_: MediaStreamTrack | null, track: MediaStreamTrack): void;
|
|
@@ -1970,4 +1983,4 @@ declare const STREAM_TYPES: {
|
|
|
1970
1983
|
};
|
|
1971
1984
|
|
|
1972
1985
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1973
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1986
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.mjs
CHANGED
|
@@ -468,7 +468,7 @@ var _a$5;
|
|
|
468
468
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
469
469
|
const logger$a = new Logger();
|
|
470
470
|
class Session {
|
|
471
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
471
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }) {
|
|
472
472
|
this.relayCandidateSeen = false;
|
|
473
473
|
this.serverReflexiveCandidateSeen = false;
|
|
474
474
|
this.publicHostCandidateSeen = false;
|
|
@@ -477,6 +477,7 @@ class Session {
|
|
|
477
477
|
this.ipv6HostCandidate6to4Seen = false;
|
|
478
478
|
this.mdnsHostCandidateSeen = false;
|
|
479
479
|
this.pendingReplaceTrackActions = [];
|
|
480
|
+
this._mediaPrefs = mediaPrefs;
|
|
480
481
|
this.peerConnectionConfig = peerConnectionConfig;
|
|
481
482
|
this.clientId = clientId;
|
|
482
483
|
this.pc = new RTCPeerConnection(this.peerConnectionConfig);
|
|
@@ -509,16 +510,24 @@ class Session {
|
|
|
509
510
|
this._incrementAnalyticMetric = incrementAnalyticMetric;
|
|
510
511
|
}
|
|
511
512
|
addStream(stream) {
|
|
513
|
+
var _a;
|
|
512
514
|
this.streamIds.push(stream.id);
|
|
513
515
|
this.streams.push(stream);
|
|
514
516
|
stream.getAudioTracks().forEach((track) => {
|
|
515
517
|
this.pc.addTrack(track, stream);
|
|
516
518
|
});
|
|
519
|
+
if (((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
517
522
|
stream.getVideoTracks().forEach((track) => {
|
|
518
523
|
this.pc.addTrack(track, stream);
|
|
519
524
|
});
|
|
520
525
|
}
|
|
521
526
|
addTrack(track, stream) {
|
|
527
|
+
var _a;
|
|
528
|
+
if (track.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
522
531
|
if (!stream) {
|
|
523
532
|
stream = this.streams[0];
|
|
524
533
|
}
|
|
@@ -642,10 +651,14 @@ class Session {
|
|
|
642
651
|
}
|
|
643
652
|
replaceTrack(oldTrack, newTrack) {
|
|
644
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
654
|
+
var _a;
|
|
645
655
|
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
646
656
|
if (newTrack.readyState === "ended") {
|
|
647
657
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
648
658
|
}
|
|
659
|
+
if (newTrack.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
649
662
|
const pc = this.pc;
|
|
650
663
|
if (oldTrack) {
|
|
651
664
|
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
@@ -2450,6 +2463,7 @@ if (browserName$1 === "chrome") {
|
|
|
2450
2463
|
}
|
|
2451
2464
|
class P2pRtcManager {
|
|
2452
2465
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features }) {
|
|
2466
|
+
this._remoteClientMediaPrefs = {};
|
|
2453
2467
|
const { name, session, iceServers, turnServers, mediaserverConfigTtlSeconds } = room;
|
|
2454
2468
|
this._selfId = selfId;
|
|
2455
2469
|
this._roomName = name;
|
|
@@ -2736,6 +2750,12 @@ class P2pRtcManager {
|
|
|
2736
2750
|
this._screenshareVideoTrackIds.push(localScreenShareTrack.id);
|
|
2737
2751
|
}
|
|
2738
2752
|
}
|
|
2753
|
+
setRemoteClientMediaPrefs(clientId, mediaPrefs) {
|
|
2754
|
+
this._remoteClientMediaPrefs[clientId] = mediaPrefs;
|
|
2755
|
+
}
|
|
2756
|
+
removeRemoteClientMediaPrefs(clientId) {
|
|
2757
|
+
delete this._remoteClientMediaPrefs[clientId];
|
|
2758
|
+
}
|
|
2739
2759
|
setRoomSessionId(roomSessionId) {
|
|
2740
2760
|
this._roomSessionId = roomSessionId;
|
|
2741
2761
|
}
|
|
@@ -2815,6 +2835,7 @@ class P2pRtcManager {
|
|
|
2815
2835
|
bandwidth: initialBandwidth,
|
|
2816
2836
|
deprioritizeH264Encoding,
|
|
2817
2837
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2838
|
+
mediaPrefs: this._remoteClientMediaPrefs[clientId],
|
|
2818
2839
|
});
|
|
2819
2840
|
this.peerConnections[clientId] = session;
|
|
2820
2841
|
setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
|
|
@@ -3058,7 +3079,7 @@ class P2pRtcManager {
|
|
|
3058
3079
|
this._setJitterBufferTarget(pc);
|
|
3059
3080
|
}
|
|
3060
3081
|
if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
|
|
3061
|
-
|
|
3082
|
+
session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
|
|
3062
3083
|
}
|
|
3063
3084
|
return session;
|
|
3064
3085
|
}
|
|
@@ -3068,6 +3089,7 @@ class P2pRtcManager {
|
|
|
3068
3089
|
logger$6.warn("No RTCPeerConnection in RTCManager.disconnect()", clientId);
|
|
3069
3090
|
return;
|
|
3070
3091
|
}
|
|
3092
|
+
this.removeRemoteClientMediaPrefs(session.clientId);
|
|
3071
3093
|
session.close();
|
|
3072
3094
|
delete this.peerConnections[clientId];
|
|
3073
3095
|
}
|
|
@@ -5267,6 +5289,8 @@ class VegaRtcManager {
|
|
|
5267
5289
|
(_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.message(audioOnly ? "enableAudioOnly" : "disableAudioOnly");
|
|
5268
5290
|
}
|
|
5269
5291
|
setRemoteScreenshareVideoTrackIds() { }
|
|
5292
|
+
setRemoteClientMediaPrefs() { }
|
|
5293
|
+
removeRemoteClientMediaPrefs() { }
|
|
5270
5294
|
setRoomSessionId(roomSessionId) {
|
|
5271
5295
|
this._roomSessionId = roomSessionId;
|
|
5272
5296
|
}
|
package/dist/legacy-esm.js
CHANGED
|
@@ -468,7 +468,7 @@ var _a$5;
|
|
|
468
468
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
469
469
|
const logger$a = new Logger();
|
|
470
470
|
class Session {
|
|
471
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
471
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }) {
|
|
472
472
|
this.relayCandidateSeen = false;
|
|
473
473
|
this.serverReflexiveCandidateSeen = false;
|
|
474
474
|
this.publicHostCandidateSeen = false;
|
|
@@ -477,6 +477,7 @@ class Session {
|
|
|
477
477
|
this.ipv6HostCandidate6to4Seen = false;
|
|
478
478
|
this.mdnsHostCandidateSeen = false;
|
|
479
479
|
this.pendingReplaceTrackActions = [];
|
|
480
|
+
this._mediaPrefs = mediaPrefs;
|
|
480
481
|
this.peerConnectionConfig = peerConnectionConfig;
|
|
481
482
|
this.clientId = clientId;
|
|
482
483
|
this.pc = new RTCPeerConnection(this.peerConnectionConfig);
|
|
@@ -509,16 +510,24 @@ class Session {
|
|
|
509
510
|
this._incrementAnalyticMetric = incrementAnalyticMetric;
|
|
510
511
|
}
|
|
511
512
|
addStream(stream) {
|
|
513
|
+
var _a;
|
|
512
514
|
this.streamIds.push(stream.id);
|
|
513
515
|
this.streams.push(stream);
|
|
514
516
|
stream.getAudioTracks().forEach((track) => {
|
|
515
517
|
this.pc.addTrack(track, stream);
|
|
516
518
|
});
|
|
519
|
+
if (((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
517
522
|
stream.getVideoTracks().forEach((track) => {
|
|
518
523
|
this.pc.addTrack(track, stream);
|
|
519
524
|
});
|
|
520
525
|
}
|
|
521
526
|
addTrack(track, stream) {
|
|
527
|
+
var _a;
|
|
528
|
+
if (track.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
522
531
|
if (!stream) {
|
|
523
532
|
stream = this.streams[0];
|
|
524
533
|
}
|
|
@@ -642,10 +651,14 @@ class Session {
|
|
|
642
651
|
}
|
|
643
652
|
replaceTrack(oldTrack, newTrack) {
|
|
644
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
654
|
+
var _a;
|
|
645
655
|
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
646
656
|
if (newTrack.readyState === "ended") {
|
|
647
657
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
648
658
|
}
|
|
659
|
+
if (newTrack.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
649
662
|
const pc = this.pc;
|
|
650
663
|
if (oldTrack) {
|
|
651
664
|
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
@@ -2450,6 +2463,7 @@ if (browserName$1 === "chrome") {
|
|
|
2450
2463
|
}
|
|
2451
2464
|
class P2pRtcManager {
|
|
2452
2465
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features }) {
|
|
2466
|
+
this._remoteClientMediaPrefs = {};
|
|
2453
2467
|
const { name, session, iceServers, turnServers, mediaserverConfigTtlSeconds } = room;
|
|
2454
2468
|
this._selfId = selfId;
|
|
2455
2469
|
this._roomName = name;
|
|
@@ -2736,6 +2750,12 @@ class P2pRtcManager {
|
|
|
2736
2750
|
this._screenshareVideoTrackIds.push(localScreenShareTrack.id);
|
|
2737
2751
|
}
|
|
2738
2752
|
}
|
|
2753
|
+
setRemoteClientMediaPrefs(clientId, mediaPrefs) {
|
|
2754
|
+
this._remoteClientMediaPrefs[clientId] = mediaPrefs;
|
|
2755
|
+
}
|
|
2756
|
+
removeRemoteClientMediaPrefs(clientId) {
|
|
2757
|
+
delete this._remoteClientMediaPrefs[clientId];
|
|
2758
|
+
}
|
|
2739
2759
|
setRoomSessionId(roomSessionId) {
|
|
2740
2760
|
this._roomSessionId = roomSessionId;
|
|
2741
2761
|
}
|
|
@@ -2815,6 +2835,7 @@ class P2pRtcManager {
|
|
|
2815
2835
|
bandwidth: initialBandwidth,
|
|
2816
2836
|
deprioritizeH264Encoding,
|
|
2817
2837
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2838
|
+
mediaPrefs: this._remoteClientMediaPrefs[clientId],
|
|
2818
2839
|
});
|
|
2819
2840
|
this.peerConnections[clientId] = session;
|
|
2820
2841
|
setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
|
|
@@ -3058,7 +3079,7 @@ class P2pRtcManager {
|
|
|
3058
3079
|
this._setJitterBufferTarget(pc);
|
|
3059
3080
|
}
|
|
3060
3081
|
if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
|
|
3061
|
-
|
|
3082
|
+
session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
|
|
3062
3083
|
}
|
|
3063
3084
|
return session;
|
|
3064
3085
|
}
|
|
@@ -3068,6 +3089,7 @@ class P2pRtcManager {
|
|
|
3068
3089
|
logger$6.warn("No RTCPeerConnection in RTCManager.disconnect()", clientId);
|
|
3069
3090
|
return;
|
|
3070
3091
|
}
|
|
3092
|
+
this.removeRemoteClientMediaPrefs(session.clientId);
|
|
3071
3093
|
session.close();
|
|
3072
3094
|
delete this.peerConnections[clientId];
|
|
3073
3095
|
}
|
|
@@ -5267,6 +5289,8 @@ class VegaRtcManager {
|
|
|
5267
5289
|
(_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.message(audioOnly ? "enableAudioOnly" : "disableAudioOnly");
|
|
5268
5290
|
}
|
|
5269
5291
|
setRemoteScreenshareVideoTrackIds() { }
|
|
5292
|
+
setRemoteClientMediaPrefs() { }
|
|
5293
|
+
removeRemoteClientMediaPrefs() { }
|
|
5270
5294
|
setRoomSessionId(roomSessionId) {
|
|
5271
5295
|
this._roomSessionId = roomSessionId;
|
|
5272
5296
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whereby.com/media",
|
|
3
3
|
"description": "Media library for Whereby",
|
|
4
|
-
"version": "8.1
|
|
4
|
+
"version": "8.2.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/whereby/sdk",
|
|
7
7
|
"repository": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"check-ip": "^1.1.1",
|
|
42
42
|
"events": "^3.3.0",
|
|
43
43
|
"ip-address": "^9.0.5",
|
|
44
|
-
"@whereby.com/mediasoup-client": "3.
|
|
44
|
+
"@whereby.com/mediasoup-client": "3.18.7",
|
|
45
45
|
"rtcstats": "github:whereby/rtcstats#5.4.1",
|
|
46
46
|
"sdp": "^3.2.0",
|
|
47
47
|
"sdp-transform": "^2.14.2",
|