@stream-io/video-client 0.3.20 → 0.3.22
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 +14 -0
- package/dist/index.browser.es.js +69 -49
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +69 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +69 -49
- package/dist/index.es.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -3
- package/src/__tests__/server-side/call.test.ts +1 -1
- package/src/helpers/DynascaleManager.ts +37 -15
- package/src/helpers/__tests__/DynascaleManager.test.ts +51 -11
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.3.22](https://github.com/GetStream/stream-video-js/compare/client0.3.21...client0.3.22) (2023-09-25)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Add extra delay before attempting to play video in Safari and Firefox ([#1106](https://github.com/GetStream/stream-video-js/issues/1106)) ([5b4a589](https://github.com/GetStream/stream-video-js/commit/5b4a58918240a7b63807726609d6d54b92cfe1d2))
|
|
11
|
+
|
|
12
|
+
### [0.3.21](https://github.com/GetStream/stream-video-js/compare/client0.3.20...client0.3.21) (2023-09-20)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* unmount video element when there is no video track or participant is invisible ([#1096](https://github.com/GetStream/stream-video-js/issues/1096)) ([bd01835](https://github.com/GetStream/stream-video-js/commit/bd01835f4e93c981ca2e5a7e4e09142ea4e326cf)), closes [#1094](https://github.com/GetStream/stream-video-js/issues/1094)
|
|
18
|
+
|
|
5
19
|
### [0.3.20](https://github.com/GetStream/stream-video-js/compare/client0.3.19...client0.3.20) (2023-09-19)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -9366,6 +9366,40 @@ class ViewportTracker {
|
|
|
9366
9366
|
}
|
|
9367
9367
|
}
|
|
9368
9368
|
|
|
9369
|
+
/**
|
|
9370
|
+
* Checks whether the current browser is Safari.
|
|
9371
|
+
*/
|
|
9372
|
+
const isSafari = () => {
|
|
9373
|
+
if (typeof navigator === 'undefined')
|
|
9374
|
+
return false;
|
|
9375
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent || '');
|
|
9376
|
+
};
|
|
9377
|
+
/**
|
|
9378
|
+
* Checks whether the current browser is Firefox.
|
|
9379
|
+
*/
|
|
9380
|
+
const isFirefox = () => {
|
|
9381
|
+
var _a;
|
|
9382
|
+
if (typeof navigator === 'undefined')
|
|
9383
|
+
return false;
|
|
9384
|
+
return (_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes('Firefox');
|
|
9385
|
+
};
|
|
9386
|
+
/**
|
|
9387
|
+
* Checks whether the current browser is Google Chrome.
|
|
9388
|
+
*/
|
|
9389
|
+
const isChrome = () => {
|
|
9390
|
+
var _a;
|
|
9391
|
+
if (typeof navigator === 'undefined')
|
|
9392
|
+
return false;
|
|
9393
|
+
return (_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes('Chrome');
|
|
9394
|
+
};
|
|
9395
|
+
|
|
9396
|
+
var browsers = /*#__PURE__*/Object.freeze({
|
|
9397
|
+
__proto__: null,
|
|
9398
|
+
isChrome: isChrome,
|
|
9399
|
+
isFirefox: isFirefox,
|
|
9400
|
+
isSafari: isSafari
|
|
9401
|
+
});
|
|
9402
|
+
|
|
9369
9403
|
const DEFAULT_VIEWPORT_VISIBILITY_STATE = {
|
|
9370
9404
|
videoTrack: VisibilityState.UNKNOWN,
|
|
9371
9405
|
screenShareTrack: VisibilityState.UNKNOWN,
|
|
@@ -9454,9 +9488,23 @@ class DynascaleManager {
|
|
|
9454
9488
|
if (!boundParticipant)
|
|
9455
9489
|
return;
|
|
9456
9490
|
const requestTrackWithDimensions = (debounceType, dimension) => {
|
|
9491
|
+
if (dimension && (dimension.width === 0 || dimension.height === 0)) {
|
|
9492
|
+
// ignore 0x0 dimensions. this can happen when the video element
|
|
9493
|
+
// is not visible (e.g., has display: none).
|
|
9494
|
+
// we treat this as "unsubscription" as we don't want to keep
|
|
9495
|
+
// consuming bandwidth for a video that is not visible on the screen.
|
|
9496
|
+
this.logger('debug', `Ignoring 0x0 dimension`, boundParticipant);
|
|
9497
|
+
dimension = undefined;
|
|
9498
|
+
}
|
|
9457
9499
|
this.call.updateSubscriptionsPartial(trackType, { [sessionId]: { dimension } }, debounceType);
|
|
9458
9500
|
};
|
|
9459
9501
|
const participant$ = this.call.state.participants$.pipe(map$2((participants) => participants.find((participant) => participant.sessionId === sessionId)), takeWhile((participant) => !!participant), distinctUntilChanged$1(), shareReplay(1));
|
|
9502
|
+
/**
|
|
9503
|
+
* Since the video elements are now being removed from the DOM (React SDK) upon
|
|
9504
|
+
* visibility change, this subscription is not in use an stays here only for the
|
|
9505
|
+
* plain JS integrations where integrators might choose not to remove the video
|
|
9506
|
+
* elements from the DOM.
|
|
9507
|
+
*/
|
|
9460
9508
|
// keep copy for resize observer handler
|
|
9461
9509
|
let viewportVisibilityState;
|
|
9462
9510
|
const viewportVisibilityStateSubscription = boundParticipant.isLocalParticipant
|
|
@@ -9501,6 +9549,8 @@ class DynascaleManager {
|
|
|
9501
9549
|
lastDimensions = currentDimensions;
|
|
9502
9550
|
});
|
|
9503
9551
|
resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.observe(videoElement);
|
|
9552
|
+
// element renders and gets bound - track subscription gets
|
|
9553
|
+
// triggered first other ones get skipped on initial subscriptions
|
|
9504
9554
|
const publishedTracksSubscription = boundParticipant.isLocalParticipant
|
|
9505
9555
|
? null
|
|
9506
9556
|
: participant$
|
|
@@ -9510,39 +9560,43 @@ class DynascaleManager {
|
|
|
9510
9560
|
.subscribe((isPublishing) => {
|
|
9511
9561
|
if (isPublishing) {
|
|
9512
9562
|
// the participant just started to publish a track
|
|
9513
|
-
requestTrackWithDimensions(DebounceType.
|
|
9563
|
+
requestTrackWithDimensions(DebounceType.FAST, {
|
|
9514
9564
|
width: videoElement.clientWidth,
|
|
9515
9565
|
height: videoElement.clientHeight,
|
|
9516
9566
|
});
|
|
9517
9567
|
}
|
|
9518
9568
|
else {
|
|
9519
9569
|
// the participant just stopped publishing a track
|
|
9520
|
-
requestTrackWithDimensions(DebounceType.
|
|
9570
|
+
requestTrackWithDimensions(DebounceType.FAST, undefined);
|
|
9521
9571
|
}
|
|
9522
9572
|
});
|
|
9573
|
+
videoElement.autoplay = true;
|
|
9574
|
+
videoElement.playsInline = true;
|
|
9575
|
+
// explicitly marking the element as muted will allow autoplay to work
|
|
9576
|
+
// without prior user interaction:
|
|
9577
|
+
// https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
|
|
9578
|
+
videoElement.muted = true;
|
|
9523
9579
|
const streamSubscription = participant$
|
|
9524
9580
|
.pipe(distinctUntilKeyChanged(trackType === 'videoTrack' ? 'videoStream' : 'screenShareStream'))
|
|
9525
9581
|
.subscribe((p) => {
|
|
9526
9582
|
const source = trackType === 'videoTrack' ? p.videoStream : p.screenShareStream;
|
|
9527
9583
|
if (videoElement.srcObject === source)
|
|
9528
9584
|
return;
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9585
|
+
videoElement.srcObject = source !== null && source !== void 0 ? source : null;
|
|
9586
|
+
if (isSafari() || isFirefox()) {
|
|
9587
|
+
setTimeout(() => {
|
|
9588
|
+
videoElement.srcObject = source !== null && source !== void 0 ? source : null;
|
|
9532
9589
|
videoElement.play().catch((e) => {
|
|
9533
9590
|
this.logger('warn', `Failed to play stream`, e);
|
|
9534
9591
|
});
|
|
9535
|
-
|
|
9536
|
-
|
|
9592
|
+
// we add extra delay until we attempt to force-play
|
|
9593
|
+
// the participant's media stream in Firefox and Safari,
|
|
9594
|
+
// as they seem to have some timing issues
|
|
9595
|
+
}, 25);
|
|
9596
|
+
}
|
|
9537
9597
|
});
|
|
9538
|
-
videoElement.playsInline = true;
|
|
9539
|
-
videoElement.autoplay = true;
|
|
9540
|
-
// explicitly marking the element as muted will allow autoplay to work
|
|
9541
|
-
// without prior user interaction:
|
|
9542
|
-
// https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
|
|
9543
|
-
videoElement.muted = true;
|
|
9544
9598
|
return () => {
|
|
9545
|
-
requestTrackWithDimensions(DebounceType.
|
|
9599
|
+
requestTrackWithDimensions(DebounceType.FAST, undefined);
|
|
9546
9600
|
viewportVisibilityStateSubscription === null || viewportVisibilityStateSubscription === void 0 ? void 0 : viewportVisibilityStateSubscription.unsubscribe();
|
|
9547
9601
|
publishedTracksSubscription === null || publishedTracksSubscription === void 0 ? void 0 : publishedTracksSubscription.unsubscribe();
|
|
9548
9602
|
streamSubscription.unsubscribe();
|
|
@@ -13108,7 +13162,7 @@ class WSConnectionFallback {
|
|
|
13108
13162
|
}
|
|
13109
13163
|
}
|
|
13110
13164
|
|
|
13111
|
-
const version = '0.3.
|
|
13165
|
+
const version = '0.3.22';
|
|
13112
13166
|
|
|
13113
13167
|
const logger = getLogger(['location']);
|
|
13114
13168
|
const HINT_URL = `https://hint.stream-io-video.com/`;
|
|
@@ -14088,39 +14142,5 @@ class StreamVideoServerClient extends StreamVideoClient {
|
|
|
14088
14142
|
}
|
|
14089
14143
|
}
|
|
14090
14144
|
|
|
14091
|
-
/**
|
|
14092
|
-
* Checks whether the current browser is Safari.
|
|
14093
|
-
*/
|
|
14094
|
-
const isSafari = () => {
|
|
14095
|
-
if (typeof navigator === 'undefined')
|
|
14096
|
-
return false;
|
|
14097
|
-
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent || '');
|
|
14098
|
-
};
|
|
14099
|
-
/**
|
|
14100
|
-
* Checks whether the current browser is Firefox.
|
|
14101
|
-
*/
|
|
14102
|
-
const isFirefox = () => {
|
|
14103
|
-
var _a;
|
|
14104
|
-
if (typeof navigator === 'undefined')
|
|
14105
|
-
return false;
|
|
14106
|
-
return (_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes('Firefox');
|
|
14107
|
-
};
|
|
14108
|
-
/**
|
|
14109
|
-
* Checks whether the current browser is Google Chrome.
|
|
14110
|
-
*/
|
|
14111
|
-
const isChrome = () => {
|
|
14112
|
-
var _a;
|
|
14113
|
-
if (typeof navigator === 'undefined')
|
|
14114
|
-
return false;
|
|
14115
|
-
return (_a = navigator.userAgent) === null || _a === void 0 ? void 0 : _a.includes('Chrome');
|
|
14116
|
-
};
|
|
14117
|
-
|
|
14118
|
-
var browsers = /*#__PURE__*/Object.freeze({
|
|
14119
|
-
__proto__: null,
|
|
14120
|
-
isChrome: isChrome,
|
|
14121
|
-
isFirefox: isFirefox,
|
|
14122
|
-
isSafari: isSafari
|
|
14123
|
-
});
|
|
14124
|
-
|
|
14125
14145
|
export { AudioSettingsDefaultDeviceEnum, AudioSettingsRequestDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, InputMediaDeviceManager, InputMediaDeviceManagerState, MicrophoneManager, MicrophoneManagerState, OwnCapability, RecordSettingsModeEnum, RecordSettingsQualityEnum, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, events as SfuEvents, models as SfuModels, SpeakerManager, SpeakerState, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoServerClient, StreamVideoWriteableStateStore, TranscriptionSettingsModeEnum, TranscriptionSettingsRequestModeEnum, VideoSettingsCameraFacingEnum, VideoSettingsRequestCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, disposeOfMediaStream, dominantSpeaker, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceInfo, getLogger, getOSInfo, getScreenShareStream, getSdkInfo, getVideoDevices, getVideoStream, isStreamVideoLocalParticipant, livestreamOrAudioRoomSortPreset, logLevels, logToConsole, name, noopComparator, pinned, publishingAudio, publishingVideo, reactionType, role, screenSharing, setDeviceInfo, setLogLevel, setLogger, setOSInfo, setSdkInfo, speakerLayoutSortPreset, speaking, watchForAddedDefaultAudioDevice, watchForAddedDefaultAudioOutputDevice, watchForAddedDefaultVideoDevice, watchForDisconnectedAudioDevice, watchForDisconnectedAudioOutputDevice, watchForDisconnectedVideoDevice };
|
|
14126
14146
|
//# sourceMappingURL=index.browser.es.js.map
|