Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

amazon-chime-sdk-js

Package Overview
Dependencies
Maintainers
2
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amazon-chime-sdk-js - npm Package Compare versions

Comparing version 2.15.0 to 2.16.0

build/realtimecontroller/RealtimeSubscribeToAttendeeIdPresenceCallback.d.ts

1

build/audiovideocontroller/DefaultAudioVideoController.d.ts

@@ -40,2 +40,3 @@ import ActiveSpeakerDetector from '../activespeakerdetector/ActiveSpeakerDetector';

private enableSimulcast;
private useUpdateTransceiverControllerForUplink;
private totalRetryCount;

@@ -42,0 +43,0 @@ private startAudioVideoTimestamp;

@@ -82,2 +82,3 @@ "use strict";

this.enableSimulcast = false;
this.useUpdateTransceiverControllerForUplink = false;
this.totalRetryCount = 0;

@@ -357,2 +358,8 @@ this.startAudioVideoTimestamp = 0;

}
if (this.meetingSessionContext.videoUplinkBandwidthPolicy.setTransceiverController &&
this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController &&
this.meetingSessionContext.browserBehavior.requiresUnifiedPlan()) {
this.useUpdateTransceiverControllerForUplink = true;
this.meetingSessionContext.videoUplinkBandwidthPolicy.setTransceiverController(this.meetingSessionContext.transceiverController);
}
this.meetingSessionContext.audioProfile = this._audioProfile;

@@ -457,3 +464,8 @@ }

if (!this.meetingSessionContext.enableSimulcast) {
this.enforceBandwidthLimitationForSender(this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0]);
if (this.useUpdateTransceiverControllerForUplink) {
this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController();
}
else {
this.enforceBandwidthLimitationForSender(this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0]);
}
}

@@ -518,2 +530,3 @@ this.forEachObserver(observer => {

catch (cleanError) {
/* istanbul ignore next */
this.logger.info('fail to clean');

@@ -698,4 +711,9 @@ }

if (!this.meetingSessionContext.enableSimulcast) {
const maxBitrateKbps = this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0];
this.enforceBandwidthLimitationForSender(maxBitrateKbps);
if (this.useUpdateTransceiverControllerForUplink) {
this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController();
}
else {
const maxBitrateKbps = this.meetingSessionContext.videoCaptureAndEncodeParameter.encodeBitrates()[0];
this.enforceBandwidthLimitationForSender(maxBitrateKbps);
}
}

@@ -849,2 +867,7 @@ this.logger.info('updated audio-video session');

!this.meetingSessionContext.enableSimulcast) {
if (this.useUpdateTransceiverControllerForUplink) {
this.meetingSessionContext.videoUplinkBandwidthPolicy.setHasBandwidthPriority(hasBandwidthPriority);
yield this.meetingSessionContext.videoUplinkBandwidthPolicy.updateTransceiverController();
return;
}
const oldMaxBandwidth = this.meetingSessionContext.videoUplinkBandwidthPolicy.maxBandwidthKbps();

@@ -851,0 +874,0 @@ this.meetingSessionContext.videoUplinkBandwidthPolicy.setHasBandwidthPriority(hasBandwidthPriority);

@@ -37,2 +37,3 @@ import BrowserBehavior from './BrowserBehavior';

supportsSenderSideBandwidthEstimation(): boolean;
doesNotSupportMediaDeviceLabels(): boolean;
screenShareUnsupported(): boolean;

@@ -39,0 +40,0 @@ isSupported(): boolean;

@@ -32,2 +32,3 @@ "use strict";

'ios-webview': 605,
'chromium-webview': 92,
};

@@ -46,2 +47,3 @@ this.browserName = {

'ios-webview': 'WKWebView iOS',
'chromium-webview': 'Chrome WebView',
};

@@ -129,3 +131,3 @@ this.chromeLike = [

requiresVideoElementWorkaround() {
return this.isSafari();
return this.isSafari() && this.majorVersion() === 12;
}

@@ -168,2 +170,7 @@ requiresNoExactMediaStreamConstraints() {

}
// There's a issue in Chormium WebView that causes enumerate devices to return empty labels, this is a check for this issue.
// https://bugs.chromium.org/p/chromium/issues/detail?id=669492
doesNotSupportMediaDeviceLabels() {
return this.browser.name === 'chromium-webview';
}
// TODO: Deprecated, needs to be removed

@@ -170,0 +177,0 @@ screenShareUnsupported() {

3

build/index.d.ts

@@ -191,2 +191,3 @@ import AGCOptions from './voicefocus/AGCOptions';

import RealtimeState from './realtimecontroller/RealtimeState';
import RealtimeSubscribeToAttendeeIdPresenceCallback from './realtimecontroller/RealtimeSubscribeToAttendeeIdPresenceCallback';
import RealtimeVolumeIndicator from './realtimecontroller/RealtimeVolumeIndicator';

@@ -299,2 +300,2 @@ import ReceiveAudioInputTask from './task/ReceiveAudioInputTask';

import { isVideoTransformDevice } from './devicecontroller/VideoTransformDevice';
export { AGCOptions, ActiveSpeakerDetector, ActiveSpeakerDetectorFacade, ActiveSpeakerPolicy, AllHighestVideoBandwidthPolicy, AssetSpec, AsyncScheduler, AttachMediaInputTask, Attendee, AudioInputDevice, AudioLogEvent, AudioMixController, AudioMixControllerFacade, AudioNodeSubgraph, AudioProfile, AudioTransformDevice, AudioVideoController, AudioVideoControllerFacade, AudioVideoControllerState, AudioVideoEventAttributes, AudioVideoFacade, AudioVideoObserver, Backoff, BackoffFactory, BaseConnectionHealthPolicy, BaseTask, BitrateParameters, BrowserBehavior, CanvasVideoFrameBuffer, CheckAudioConnectivityFeedback, CheckAudioInputFeedback, CheckAudioOutputFeedback, CheckCameraResolutionFeedback, CheckContentShareConnectivityFeedback, CheckNetworkTCPConnectivityFeedback, CheckNetworkUDPConnectivityFeedback, CheckVideoConnectivityFeedback, CheckVideoInputFeedback, CleanRestartedSessionTask, CleanStoppedSessionTask, ClientMetricReport, ClientMetricReportDirection, ClientMetricReportMediaType, ClientVideoStreamReceivingReport, ConnectionHealthData, ConnectionHealthPolicy, ConnectionHealthPolicyConfiguration, ConnectionMetrics, ConnectionMonitor, ConsoleLogger, ContentShareConstants, ContentShareController, ContentShareControllerFacade, ContentShareMediaStreamBroker, ContentShareObserver, CreatePeerConnectionTask, CreateSDPTask, DataMessage, DefaultActiveSpeakerDetector, DefaultActiveSpeakerPolicy, DefaultAudioMixController, DefaultAudioVideoController, DefaultAudioVideoFacade, DefaultBrowserBehavior, DefaultClientMetricReport, DefaultContentShareController, DefaultDeviceController, DefaultDevicePixelRatioMonitor, DefaultEventController, DefaultMediaDeviceFactory, DefaultMeetingEventReporter, DefaultMeetingReadinessChecker, DefaultMeetingSession, DefaultMessagingSession, DefaultModality, DefaultPingPong, DefaultRealtimeController, DefaultReconnectController, DefaultSDP, DefaultSessionStateController, DefaultSigV4, DefaultSignalingClient, DefaultSimulcastUplinkPolicy, DefaultStatsCollector, DefaultTransceiverController, DefaultTranscriptionController, DefaultUserAgentParser, DefaultVideoCaptureAndEncodeParameter, DefaultVideoFrameProcessorPipeline, DefaultVideoStreamIdSet, DefaultVideoStreamIndex, DefaultVideoTile, DefaultVideoTileController, DefaultVideoTileFactory, DefaultVideoTransformDevice, DefaultVideoTransformDeviceObserver, DefaultVolumeIndicatorAdapter, DefaultWebSocketAdapter, Destroyable, Device, DeviceChangeObserver, DeviceController, DeviceControllerBasedMediaStreamBroker, DeviceEventAttributes, DevicePixelRatioMonitor, DevicePixelRatioObserver, DevicePixelRatioSource, DevicePixelRatioWindowSource, DeviceSelection, Eq, EventAttributes, EventBuffer, EventBufferConfiguration, EventController, EventData, EventIngestionConfiguration, EventName, EventReporter, EventsClientConfiguration, EventsIngestionMetadata, ExtendedBrowserBehavior, FinishGatheringICECandidatesTask, FullJitterBackoff, FullJitterBackoffFactory, FullJitterLimitedBackoff, GetUserMediaError, GlobalMetricReport, InMemoryJSONEventBuffer, IntervalScheduler, JoinAndReceiveIndexTask, LeaveAndReceiveLeaveAckTask, ListenForVolumeIndicatorsTask, Log, LogLevel, Logger, Maybe, MaybeProvider, MediaDeviceFactory, MediaDeviceProxyHandler, MediaStreamBroker, MeetingEventsClientConfiguration, MeetingEventsClientConfigurationAttributes, MeetingHistoryState, MeetingReadinessChecker, MeetingReadinessCheckerConfiguration, MeetingSession, MeetingSessionConfiguration, MeetingSessionCredentials, MeetingSessionLifecycleEvent, MeetingSessionLifecycleEventCondition, MeetingSessionPOSTLogger, MeetingSessionStatus, MeetingSessionStatusCode, MeetingSessionTURNCredentials, MeetingSessionURLs, MeetingSessionVideoAvailability, Message, MessagingSession, MessagingSessionConfiguration, MessagingSessionObserver, Modality, MonitorTask, MultiLogger, MutableVideoPreferences, NScaleVideoUplinkBandwidthPolicy, NoOpAudioVideoController, NoOpDebugLogger, NoOpDeviceController, NoOpEventReporter, NoOpLogger, NoOpMediaStreamBroker, NoOpTask, NoOpVideoElementFactory, NoOpVideoFrameProcessor, NoVideoDownlinkBandwidthPolicy, NoVideoUplinkBandwidthPolicy, None, NotFoundError, NotReadableError, OnceTask, OpenSignalingConnectionTask, OverconstrainedError, ParallelGroupTask, PartialOrd, PermissionDeniedError, PingPong, PingPongObserver, RealtimeAttendeePositionInFrame, RealtimeController, RealtimeControllerFacade, RealtimeState, RealtimeVolumeIndicator, ReceiveAudioInputTask, ReceiveTURNCredentialsTask, ReceiveVideoInputTask, ReceiveVideoStreamIndexTask, ReconnectController, ReconnectionHealthPolicy, ReleaseMediaStreamsTask, RemovableAnalyserNode, RemovableObserver, RunnableTask, SDP, SDPCandidateType, Scheduler, SendAndReceiveDataMessagesTask, SerialGroupTask, SessionStateController, SessionStateControllerAction, SessionStateControllerDeferPriority, SessionStateControllerState, SessionStateControllerTransitionResult, SetLocalDescriptionTask, SetRemoteDescriptionTask, SigV4, SignalingAndMetricsConnectionMonitor, SignalingClient, SignalingClientConnectionRequest, SignalingClientEvent, SignalingClientEventType, SignalingClientJoin, SignalingClientObserver, SignalingClientSubscribe, SimulcastLayers, SimulcastTransceiverController, SimulcastUplinkObserver, SimulcastUplinkPolicy, SimulcastVideoStreamIndex, SingleNodeAudioTransformDevice, Some, StatsCollector, StreamMetricReport, SubscribeAndReceiveSubscribeAckTask, TargetDisplaySize, Task, TaskCanceler, TaskStatus, TimeoutScheduler, TimeoutTask, TransceiverController, Transcript, TranscriptAlternative, TranscriptEvent, TranscriptItem, TranscriptItemType, TranscriptResult, TranscriptionController, TranscriptionStatus, TranscriptionStatusType, TypeError, UnusableAudioWarningConnectionHealthPolicy, UserAgentParser, Versioning, VideoAdaptiveProbePolicy, VideoCaptureAndEncodeParameter, VideoDownlinkBandwidthPolicy, VideoDownlinkObserver, VideoElementFactory, VideoFrameBuffer, VideoFrameProcessor, VideoFrameProcessorPipeline, VideoFrameProcessorPipelineObserver, VideoInputDevice, VideoLogEvent, VideoOnlyTransceiverController, VideoPreference, VideoPreferences, VideoPriorityBasedPolicy, VideoPriorityBasedPolicyConfig, VideoQualitySettings, VideoSource, VideoStreamDescription, VideoStreamIdSet, VideoStreamIndex, VideoTile, VideoTileController, VideoTileControllerFacade, VideoTileFactory, VideoTileState, VideoTransformDevice, VideoUplinkBandwidthPolicy, VoiceFocusConfig, VoiceFocusDeviceOptions, VoiceFocusDeviceTransformer, VoiceFocusModelComplexity, VoiceFocusPaths, VoiceFocusSpec, VoiceFocusTransformDevice, VoiceFocusTransformDeviceObserver, VolumeIndicatorAdapter, VolumeIndicatorCallback, WaitForAttendeePresenceTask, WebSocketAdapter, WebSocketReadyState, isAudioTransformDevice, isDestroyable, isVideoTransformDevice, };
export { AGCOptions, ActiveSpeakerDetector, ActiveSpeakerDetectorFacade, ActiveSpeakerPolicy, AllHighestVideoBandwidthPolicy, AssetSpec, AsyncScheduler, AttachMediaInputTask, Attendee, AudioInputDevice, AudioLogEvent, AudioMixController, AudioMixControllerFacade, AudioNodeSubgraph, AudioProfile, AudioTransformDevice, AudioVideoController, AudioVideoControllerFacade, AudioVideoControllerState, AudioVideoEventAttributes, AudioVideoFacade, AudioVideoObserver, Backoff, BackoffFactory, BaseConnectionHealthPolicy, BaseTask, BitrateParameters, BrowserBehavior, CanvasVideoFrameBuffer, CheckAudioConnectivityFeedback, CheckAudioInputFeedback, CheckAudioOutputFeedback, CheckCameraResolutionFeedback, CheckContentShareConnectivityFeedback, CheckNetworkTCPConnectivityFeedback, CheckNetworkUDPConnectivityFeedback, CheckVideoConnectivityFeedback, CheckVideoInputFeedback, CleanRestartedSessionTask, CleanStoppedSessionTask, ClientMetricReport, ClientMetricReportDirection, ClientMetricReportMediaType, ClientVideoStreamReceivingReport, ConnectionHealthData, ConnectionHealthPolicy, ConnectionHealthPolicyConfiguration, ConnectionMetrics, ConnectionMonitor, ConsoleLogger, ContentShareConstants, ContentShareController, ContentShareControllerFacade, ContentShareMediaStreamBroker, ContentShareObserver, CreatePeerConnectionTask, CreateSDPTask, DataMessage, DefaultActiveSpeakerDetector, DefaultActiveSpeakerPolicy, DefaultAudioMixController, DefaultAudioVideoController, DefaultAudioVideoFacade, DefaultBrowserBehavior, DefaultClientMetricReport, DefaultContentShareController, DefaultDeviceController, DefaultDevicePixelRatioMonitor, DefaultEventController, DefaultMediaDeviceFactory, DefaultMeetingEventReporter, DefaultMeetingReadinessChecker, DefaultMeetingSession, DefaultMessagingSession, DefaultModality, DefaultPingPong, DefaultRealtimeController, DefaultReconnectController, DefaultSDP, DefaultSessionStateController, DefaultSigV4, DefaultSignalingClient, DefaultSimulcastUplinkPolicy, DefaultStatsCollector, DefaultTransceiverController, DefaultTranscriptionController, DefaultUserAgentParser, DefaultVideoCaptureAndEncodeParameter, DefaultVideoFrameProcessorPipeline, DefaultVideoStreamIdSet, DefaultVideoStreamIndex, DefaultVideoTile, DefaultVideoTileController, DefaultVideoTileFactory, DefaultVideoTransformDevice, DefaultVideoTransformDeviceObserver, DefaultVolumeIndicatorAdapter, DefaultWebSocketAdapter, Destroyable, Device, DeviceChangeObserver, DeviceController, DeviceControllerBasedMediaStreamBroker, DeviceEventAttributes, DevicePixelRatioMonitor, DevicePixelRatioObserver, DevicePixelRatioSource, DevicePixelRatioWindowSource, DeviceSelection, Eq, EventAttributes, EventBuffer, EventBufferConfiguration, EventController, EventData, EventIngestionConfiguration, EventName, EventReporter, EventsClientConfiguration, EventsIngestionMetadata, ExtendedBrowserBehavior, FinishGatheringICECandidatesTask, FullJitterBackoff, FullJitterBackoffFactory, FullJitterLimitedBackoff, GetUserMediaError, GlobalMetricReport, InMemoryJSONEventBuffer, IntervalScheduler, JoinAndReceiveIndexTask, LeaveAndReceiveLeaveAckTask, ListenForVolumeIndicatorsTask, Log, LogLevel, Logger, Maybe, MaybeProvider, MediaDeviceFactory, MediaDeviceProxyHandler, MediaStreamBroker, MeetingEventsClientConfiguration, MeetingEventsClientConfigurationAttributes, MeetingHistoryState, MeetingReadinessChecker, MeetingReadinessCheckerConfiguration, MeetingSession, MeetingSessionConfiguration, MeetingSessionCredentials, MeetingSessionLifecycleEvent, MeetingSessionLifecycleEventCondition, MeetingSessionPOSTLogger, MeetingSessionStatus, MeetingSessionStatusCode, MeetingSessionTURNCredentials, MeetingSessionURLs, MeetingSessionVideoAvailability, Message, MessagingSession, MessagingSessionConfiguration, MessagingSessionObserver, Modality, MonitorTask, MultiLogger, MutableVideoPreferences, NScaleVideoUplinkBandwidthPolicy, NoOpAudioVideoController, NoOpDebugLogger, NoOpDeviceController, NoOpEventReporter, NoOpLogger, NoOpMediaStreamBroker, NoOpTask, NoOpVideoElementFactory, NoOpVideoFrameProcessor, NoVideoDownlinkBandwidthPolicy, NoVideoUplinkBandwidthPolicy, None, NotFoundError, NotReadableError, OnceTask, OpenSignalingConnectionTask, OverconstrainedError, ParallelGroupTask, PartialOrd, PermissionDeniedError, PingPong, PingPongObserver, RealtimeAttendeePositionInFrame, RealtimeController, RealtimeControllerFacade, RealtimeState, RealtimeSubscribeToAttendeeIdPresenceCallback, RealtimeVolumeIndicator, ReceiveAudioInputTask, ReceiveTURNCredentialsTask, ReceiveVideoInputTask, ReceiveVideoStreamIndexTask, ReconnectController, ReconnectionHealthPolicy, ReleaseMediaStreamsTask, RemovableAnalyserNode, RemovableObserver, RunnableTask, SDP, SDPCandidateType, Scheduler, SendAndReceiveDataMessagesTask, SerialGroupTask, SessionStateController, SessionStateControllerAction, SessionStateControllerDeferPriority, SessionStateControllerState, SessionStateControllerTransitionResult, SetLocalDescriptionTask, SetRemoteDescriptionTask, SigV4, SignalingAndMetricsConnectionMonitor, SignalingClient, SignalingClientConnectionRequest, SignalingClientEvent, SignalingClientEventType, SignalingClientJoin, SignalingClientObserver, SignalingClientSubscribe, SimulcastLayers, SimulcastTransceiverController, SimulcastUplinkObserver, SimulcastUplinkPolicy, SimulcastVideoStreamIndex, SingleNodeAudioTransformDevice, Some, StatsCollector, StreamMetricReport, SubscribeAndReceiveSubscribeAckTask, TargetDisplaySize, Task, TaskCanceler, TaskStatus, TimeoutScheduler, TimeoutTask, TransceiverController, Transcript, TranscriptAlternative, TranscriptEvent, TranscriptItem, TranscriptItemType, TranscriptResult, TranscriptionController, TranscriptionStatus, TranscriptionStatusType, TypeError, UnusableAudioWarningConnectionHealthPolicy, UserAgentParser, Versioning, VideoAdaptiveProbePolicy, VideoCaptureAndEncodeParameter, VideoDownlinkBandwidthPolicy, VideoDownlinkObserver, VideoElementFactory, VideoFrameBuffer, VideoFrameProcessor, VideoFrameProcessorPipeline, VideoFrameProcessorPipelineObserver, VideoInputDevice, VideoLogEvent, VideoOnlyTransceiverController, VideoPreference, VideoPreferences, VideoPriorityBasedPolicy, VideoPriorityBasedPolicyConfig, VideoQualitySettings, VideoSource, VideoStreamDescription, VideoStreamIdSet, VideoStreamIndex, VideoTile, VideoTileController, VideoTileControllerFacade, VideoTileFactory, VideoTileState, VideoTransformDevice, VideoUplinkBandwidthPolicy, VoiceFocusConfig, VoiceFocusDeviceOptions, VoiceFocusDeviceTransformer, VoiceFocusModelComplexity, VoiceFocusPaths, VoiceFocusSpec, VoiceFocusTransformDevice, VoiceFocusTransformDeviceObserver, VolumeIndicatorAdapter, VolumeIndicatorCallback, WaitForAttendeePresenceTask, WebSocketAdapter, WebSocketReadyState, isAudioTransformDevice, isDestroyable, isVideoTransformDevice, };
import DataMessage from '../datamessage/DataMessage';
import TranscriptionController from '../transcript/TranscriptionController';
import RealtimeAttendeePositionInFrame from './RealtimeAttendeePositionInFrame';
import type RealtimeSubscribeToAttendeeIdPresenceCallback from './RealtimeSubscribeToAttendeeIdPresenceCallback';
import type VolumeIndicatorCallback from './VolumeIndicatorCallback';

@@ -39,7 +39,7 @@ /**

*/
realtimeSubscribeToAttendeeIdPresence(callback: (attendeeId: string, present: boolean, externalUserId?: string, dropped?: boolean, posInFrame?: RealtimeAttendeePositionInFrame | null) => void): void;
realtimeSubscribeToAttendeeIdPresence(callback: RealtimeSubscribeToAttendeeIdPresenceCallback): void;
/**
* Unsubscribes to changes in attendee ids
* Unsubscribes to changes in attendee ids.
*/
realtimeUnsubscribeToAttendeeIdPresence(callback: (attendeeId: string, present: boolean, externalUserId?: string, dropped?: boolean, posInFrame?: RealtimeAttendeePositionInFrame | null) => void): void;
realtimeUnsubscribeToAttendeeIdPresence(callback: RealtimeSubscribeToAttendeeIdPresenceCallback): void;
/**

@@ -46,0 +46,0 @@ * Sets the audio input and stores the current mute state. Any previous media

@@ -62,2 +62,5 @@ "use strict";

this.context.transceiverController.reset();
if (this.context.videoUplinkBandwidthPolicy.setTransceiverController) {
this.context.videoUplinkBandwidthPolicy.setTransceiverController(undefined);
}
const tile = this.context.videoTileController.getLocalVideoTile();

@@ -64,0 +67,0 @@ if (tile) {

@@ -14,2 +14,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const MeetingSessionStatus_1 = require("../meetingsession/MeetingSessionStatus");
const MeetingSessionStatusCode_1 = require("../meetingsession/MeetingSessionStatusCode");
const DefaultSDP_1 = require("../sdp/DefaultSDP");

@@ -82,2 +84,3 @@ const SignalingClientEventType_1 = require("../signalingclient/SignalingClientEventType");

return new Promise((resolve, reject) => {
const context = this.context;
class Interceptor {

@@ -92,2 +95,12 @@ constructor(signalingClient) {

handleSignalingClientEvent(event) {
if (event.isConnectionTerminated()) {
const message = `SubscribeAndReceiveSubscribeAckTask connection was terminated with code ${event.closeCode} and reason: ${event.closeReason}`;
context.logger.warn(message);
let statusCode = MeetingSessionStatusCode_1.default.TaskFailed;
if (event.closeCode >= 4500 && event.closeCode < 4600) {
statusCode = MeetingSessionStatusCode_1.default.SignalingInternalServerError;
}
context.audioVideoController.handleMeetingSessionStatus(new MeetingSessionStatus_1.default(statusCode), new Error(message));
return;
}
if (event.type !== SignalingClientEventType_1.default.ReceivedSignalFrame ||

@@ -94,0 +107,0 @@ event.message.type !== SignalingProtocol_js_1.SdkSignalFrame.Type.SUBSCRIBE_ACK) {

@@ -15,3 +15,3 @@ import BrowserBehavior from '../browserbehavior/BrowserBehavior';

constructor(logger: Logger, browserBehavior: BrowserBehavior);
setEncodingParameters(_params: Map<string, RTCRtpEncodingParameters>): void;
setEncodingParameters(encodingParamMap: Map<string, RTCRtpEncodingParameters>): Promise<void>;
static setVideoSendingBitrateKbpsForSender(sender: RTCRtpSender, bitrateKbps: number, _logger: Logger): Promise<void>;

@@ -18,0 +18,0 @@ static replaceAudioTrackForSender(sender: RTCRtpSender, track: MediaStreamTrack): Promise<boolean>;

@@ -24,4 +24,38 @@ "use strict";

}
setEncodingParameters(_params) {
return;
setEncodingParameters(encodingParamMap) {
return __awaiter(this, void 0, void 0, function* () {
if (!this._localCameraTransceiver || this._localCameraTransceiver.direction !== 'sendrecv') {
return;
}
const sender = this._localCameraTransceiver.sender;
if (!encodingParamMap || encodingParamMap.size === 0) {
return;
}
const newEncodingParams = Array.from(encodingParamMap.values());
const oldParam = sender.getParameters();
if (!oldParam.encodings || oldParam.encodings.length === 0) {
oldParam.encodings = newEncodingParams;
}
else {
for (const existing of oldParam.encodings) {
for (const changed of newEncodingParams) {
if ((existing.rid || changed.rid) && existing.rid !== changed.rid) {
continue;
}
let key;
for (key in changed) {
// These properties can't be changed.
if (key === 'rid' || key === 'codecPayloadType') {
continue;
}
/* istanbul ignore else */
if (changed.hasOwnProperty(key)) {
existing[key] = changed[key];
}
}
}
}
}
yield sender.setParameters(oldParam);
});
}

@@ -60,3 +94,2 @@ static setVideoSendingBitrateKbpsForSender(sender, bitrateKbps, _logger) {

return __awaiter(this, void 0, void 0, function* () {
// this won't set bandwidth limitation for video in Chrome
if (!this._localCameraTransceiver || this._localCameraTransceiver.direction !== 'sendrecv') {

@@ -63,0 +96,0 @@ return;

@@ -61,5 +61,15 @@ import VideoStreamIdSet from '../videostreamidset/VideoStreamIdSet';

/**
* Set [[RTCRtpEncodingParameters]] on the sender of transceiver
* Set [[RTCRtpEncodingParameters]] on the sender of transceiver.
* This method should be called whenever the sender's encoding parameters of the local video transceiver need to
* be updated.
* For example, the default NScaleVideoUplinkBandwidthPolicy calls this method whenever a video is on/off or the
* active speaker changes.
* This method assumes that the sender of the local video transceiver is available and the input parameters should
* not be empty.
* The encoding parameters for sender should be retrieved using sender.getParameters and updated using
* sender.setParameters method.
* @param {Map<string, RTCRtpEncodingParameters>} params - The encoding parameters. If you have multiple encoding
* parameters for different video layers, the key should be the rid corresponding to the RTCRtpEncodingParameters.
*/
setEncodingParameters(params: Map<string, RTCRtpEncodingParameters>): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
"hash": "bf282c7",
"raw": "v2.15.0",
"semverString": "2.15.0"
"hash": "271dd7d",
"raw": "v2.16.0",
"semverString": "2.16.0"
};
//# sourceMappingURL=version.js.map

@@ -8,3 +8,4 @@ import VideoCaptureAndEncodeParameter from './VideoCaptureAndEncodeParameter';

private isSimulcast;
constructor(cameraWidth: number, cameraHeight: number, cameraFrameRate: number, maxEncodeBitrateKbps: number, isSimulcast: boolean);
private scaleResolutionDownBy;
constructor(cameraWidth: number, cameraHeight: number, cameraFrameRate: number, maxEncodeBitrateKbps: number, isSimulcast: boolean, scaleResolutionDownBy?: number);
equal(other: DefaultVideoCaptureAndEncodeParameter): boolean;

@@ -16,4 +17,5 @@ clone(): DefaultVideoCaptureAndEncodeParameter;

encodeBitrates(): number[];
encodeScaleResolutionDownBy(): number[];
encodeWidths(): number[];
encodeHeights(): number[];
}

@@ -6,3 +6,3 @@ "use strict";

class DefaultVideoCaptureAndEncodeParameter {
constructor(cameraWidth, cameraHeight, cameraFrameRate, maxEncodeBitrateKbps, isSimulcast) {
constructor(cameraWidth, cameraHeight, cameraFrameRate, maxEncodeBitrateKbps, isSimulcast, scaleResolutionDownBy = 1) {
this.cameraWidth = cameraWidth;

@@ -13,2 +13,3 @@ this.cameraHeight = cameraHeight;

this.isSimulcast = isSimulcast;
this.scaleResolutionDownBy = scaleResolutionDownBy;
}

@@ -20,2 +21,3 @@ equal(other) {

other.encodeBitrates().length === this.encodeBitrates().length &&
other.encodeScaleResolutionDownBy().length === this.encodeScaleResolutionDownBy().length &&
other.encodeWidths().length === this.encodeWidths().length &&

@@ -27,3 +29,4 @@ other.encodeHeights().length === this.encodeHeights().length;

other.encodeHeights()[i] !== this.encodeHeights()[i] ||
other.encodeBitrates()[i] !== this.encodeBitrates()[i]) {
other.encodeBitrates()[i] !== this.encodeBitrates()[i] ||
other.encodeScaleResolutionDownBy()[i] !== this.encodeScaleResolutionDownBy()[i]) {
checkForEqual = false;

@@ -37,3 +40,3 @@ return checkForEqual;

clone() {
return new DefaultVideoCaptureAndEncodeParameter(this.cameraWidth, this.cameraHeight, this.cameraFrameRate, this.maxEncodeBitrateKbps, this.isSimulcast);
return new DefaultVideoCaptureAndEncodeParameter(this.cameraWidth, this.cameraHeight, this.cameraFrameRate, this.maxEncodeBitrateKbps, this.isSimulcast, this.scaleResolutionDownBy);
}

@@ -53,2 +56,5 @@ captureWidth() {

}
encodeScaleResolutionDownBy() {
return [this.scaleResolutionDownBy];
}
encodeWidths() {

@@ -55,0 +61,0 @@ return [this.cameraWidth];

@@ -95,4 +95,7 @@ "use strict";

if (new DefaultBrowserBehavior_1.default().requiresVideoElementWorkaround()) {
const prevSrcObject = videoElement.srcObject;
AsyncScheduler_1.default.nextTick(() => {
videoElement.srcObject = null;
if (videoElement.srcObject === prevSrcObject) {
videoElement.srcObject = null;
}
});

@@ -99,0 +102,0 @@ }

@@ -0,1 +1,2 @@

import TransceiverController from '../transceivercontroller/TransceiverController';
import DefaultVideoAndEncodeParameter from '../videocaptureandencodeparameter/DefaultVideoCaptureAndEncodeParameter';

@@ -8,5 +9,8 @@ import VideoStreamIndex from '../videostreamindex/VideoStreamIndex';

* traditional native clients, except for a modification to
* maxBandwidthKbps described below. */
* maxBandwidthKbps and scaleResolutionDownBy described below. */
export default class NScaleVideoUplinkBandwidthPolicy implements VideoUplinkBandwidthPolicy {
private selfAttendeeId;
private scaleResolution;
static readonly encodingMapKey = "video";
static readonly targetHeightArray: number[];
private numParticipants;

@@ -17,3 +21,5 @@ private optimalParameters;

private hasBandwidthPriority;
constructor(selfAttendeeId: string);
private encodingParamMap;
private transceiverController;
constructor(selfAttendeeId: string, scaleResolution?: boolean);
updateConnectionMetric(_metrics: ConnectionMetrics): void;

@@ -31,2 +37,7 @@ chooseMediaTrackConstraints(): MediaTrackConstraints;

setHasBandwidthPriority(hasBandwidthPriority: boolean): void;
setTransceiverController(transceiverController: TransceiverController | undefined): void;
updateTransceiverController(): Promise<void>;
private encodingParametersHaveSameBitrateAndScaling;
private calculateEncodingParameters;
private getStreamCaptureSetting;
}
"use strict";
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -9,11 +18,17 @@ const DefaultVideoCaptureAndEncodeParameter_1 = require("../videocaptureandencodeparameter/DefaultVideoCaptureAndEncodeParameter");

* traditional native clients, except for a modification to
* maxBandwidthKbps described below. */
* maxBandwidthKbps and scaleResolutionDownBy described below. */
class NScaleVideoUplinkBandwidthPolicy {
constructor(selfAttendeeId) {
constructor(selfAttendeeId, scaleResolution = true) {
this.selfAttendeeId = selfAttendeeId;
this.scaleResolution = scaleResolution;
this.numParticipants = 0;
this.idealMaxBandwidthKbps = 1400;
this.hasBandwidthPriority = false;
this.encodingParamMap = new Map();
this.optimalParameters = new DefaultVideoCaptureAndEncodeParameter_1.default(0, 0, 0, 0, false);
this.parametersInEffect = new DefaultVideoCaptureAndEncodeParameter_1.default(0, 0, 0, 0, false);
this.encodingParamMap.set(NScaleVideoUplinkBandwidthPolicy.encodingMapKey, {
scaleResolutionDownBy: 1,
maxBitrate: this.idealMaxBandwidthKbps * 1000,
});
}

@@ -30,7 +45,20 @@ updateConnectionMetric(_metrics) {

updateIndex(videoIndex) {
let hasLocalVideo = true;
let scale = 1;
if (this.transceiverController) {
hasLocalVideo = this.transceiverController.hasVideoInput();
}
// the +1 for self is assuming that we intend to send video, since
// the context here is VideoUplinkBandwidthPolicy
this.numParticipants =
videoIndex.numberOfVideoPublishingParticipantsExcludingSelf(this.selfAttendeeId) + 1;
this.optimalParameters = new DefaultVideoCaptureAndEncodeParameter_1.default(this.captureWidth(), this.captureHeight(), this.captureFrameRate(), this.maxBandwidthKbps(), false);
videoIndex.numberOfVideoPublishingParticipantsExcludingSelf(this.selfAttendeeId) +
(hasLocalVideo ? 1 : 0);
if (this.transceiverController) {
const settings = this.getStreamCaptureSetting();
if (settings) {
const encodingParams = this.calculateEncodingParameters(settings);
scale = encodingParams.scaleResolutionDownBy;
}
}
this.optimalParameters = new DefaultVideoCaptureAndEncodeParameter_1.default(this.captureWidth(), this.captureHeight(), this.captureFrameRate(), this.maxBandwidthKbps(), false, scale);
}

@@ -83,4 +111,71 @@ wantsResubscribe() {

}
setTransceiverController(transceiverController) {
this.transceiverController = transceiverController;
}
updateTransceiverController() {
return __awaiter(this, void 0, void 0, function* () {
const settings = this.getStreamCaptureSetting();
if (!settings) {
return;
}
const encodingParams = this.calculateEncodingParameters(settings);
if (!this.encodingParametersHaveSameBitrateAndScaling(encodingParams, this.encodingParamMap.get(NScaleVideoUplinkBandwidthPolicy.encodingMapKey))) {
this.encodingParamMap.set(NScaleVideoUplinkBandwidthPolicy.encodingMapKey, encodingParams);
this.transceiverController.setEncodingParameters(this.encodingParamMap);
}
});
}
encodingParametersHaveSameBitrateAndScaling(encoding1, encoding2) {
return (encoding1 === encoding2 ||
(encoding1.maxBitrate === encoding2.maxBitrate &&
encoding1.scaleResolutionDownBy === encoding2.scaleResolutionDownBy));
}
calculateEncodingParameters(setting) {
const maxBitrate = this.maxBandwidthKbps() * 1000;
let scale = 1;
if (setting && this.scaleResolution && !this.hasBandwidthPriority && this.numParticipants > 2) {
const targetHeight = NScaleVideoUplinkBandwidthPolicy.targetHeightArray[this.numParticipants];
scale = Math.max(setting.height / targetHeight, 1);
}
return {
scaleResolutionDownBy: scale,
maxBitrate: maxBitrate,
};
}
getStreamCaptureSetting() {
var _a, _b, _c, _d;
return (_d = (_c = (_b = (_a = this.transceiverController) === null || _a === void 0 ? void 0 : _a.localVideoTransceiver()) === null || _b === void 0 ? void 0 : _b.sender) === null || _c === void 0 ? void 0 : _c.track) === null || _d === void 0 ? void 0 : _d.getSettings();
}
}
exports.default = NScaleVideoUplinkBandwidthPolicy;
NScaleVideoUplinkBandwidthPolicy.encodingMapKey = 'video';
// 0, 1, 2 have dummy value as we keep the original resolution if we have less than 2 videos.
NScaleVideoUplinkBandwidthPolicy.targetHeightArray = [
0,
0,
0,
540,
540,
480,
480,
480,
480,
360,
360,
360,
360,
270,
270,
270,
270,
180,
180,
180,
180,
180,
180,
180,
180,
180,
];
//# sourceMappingURL=NScaleVideoUplinkBandwidthPolicy.js.map

@@ -0,1 +1,2 @@

import TransceiverController from '../transceivercontroller/TransceiverController';
import VideoCaptureAndEncodeParameter from '../videocaptureandencodeparameter/VideoCaptureAndEncodeParameter';

@@ -48,2 +49,21 @@ import VideoStreamIndex from '../videostreamindex/VideoStreamIndex';

chooseMediaTrackConstraints(): MediaTrackConstraints;
/**
* Set a reference to the current transceiver controller.
* The audio video controller should call this method to pass down a transceiver controller to the policy
* when the meeting starts and set it to undefined when the meeting ends.
* If a meeting is stopped and started repeatedly, this pair of calls will be repeated to match.
* All calls to updateTransceiverController will occur between this pair of calls.
* This method should not throw.
* @param {TransceiverController} transceiverController - The transceiver controller
*/
setTransceiverController?(transceiverController: TransceiverController | undefined): void;
/**
* Update the transceiver controller that is set from setTransceiverController such as setEncodingParameters.
* Only used when unified plan is enabled but not available for simulcast for now.
* This method should be called when the policy needs to update the local video encoding parameters such as after
* setHasBandwidthPriority has been called.
* The default audio video controller calls this after a video is on/off or when an active speakers changes.
* This method should not throw.
*/
updateTransceiverController?(): void;
}

@@ -8,2 +8,19 @@ # Changelog

## [2.16.0] - 2021-08-17
### Added
- Add `RealtimeSubscribeToAttendeeIdPresenceCallback` type for `realtimeSubscribeToAttendeeIdPresence` callback to document the callback parameters.
- Added support for Android WebView
- Add a SignalClientEvent check in `SubscribeAndReceiveSubscribeAckTask` to immediately cancel the task when websocket connection is terminated.≈
### Changed
- Update the default behavior of NScale video uplink bandwidth policy to scale down resolution based on the number
of videos.
### Removed
### Fixed
- Fix race condition in Safari when disconnect and connect stream from video element.
## [2.15.0] - 2021-08-04

@@ -10,0 +27,0 @@

{
"name": "amazon-chime-sdk-js",
"version": "2.15.0",
"version": "2.16.0",
"description": "Amazon Chime SDK for JavaScript",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -75,3 +75,3 @@ # Amazon Chime SDK for JavaScript

- [Serverless Meeting Demo](https://github.com/aws/amazon-chime-sdk-js/tree/master/demos/serverless) — A self-contained serverless meeting application
- [Single JS](https://github.com/aws/amazon-chime-sdk-js/tree/master/demos/singlejs) — A script to bundle the SDK into a single `.js` file
- [Single JS](https://github.com/aws-samples/amazon-chime-sdk/tree/main/utils/singlejs) — A script to bundle the SDK into a single `.js` file
- [Recording Demo](https://aws.amazon.com/blogs/business-productivity/how-to-enable-client-side-recording-using-the-amazon-chime-sdk/) — Recording the meeting's audio, video and screen share in high definition

@@ -78,0 +78,0 @@ - [Virtual Classroom](https://aws.amazon.com/blogs/business-productivity/building-a-virtual-classroom-application-using-the-amazon-chime-sdk/) — An online classroom built with Electron and React

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc