@stream-io/video-react-sdk 1.39.2 → 1.40.0
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 +32 -0
- package/dist/css/embedded.css +69 -0
- package/dist/css/embedded.css.map +1 -1
- package/dist/css/styles.css +69 -0
- package/dist/css/styles.css.map +1 -1
- package/dist/embedded.cjs.js +21 -27
- package/dist/embedded.cjs.js.map +1 -1
- package/dist/embedded.es.js +22 -28
- package/dist/embedded.es.js.map +1 -1
- package/dist/index.cjs.js +23 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +24 -30
- package/dist/index.es.js.map +1 -1
- package/dist/src/core/components/CallLayout/hooks.d.ts +0 -1
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.d.ts +14 -1
- package/dist/src/translations/index.d.ts +2 -0
- package/package.json +6 -6
- package/src/core/components/CallLayout/SpeakerLayout.tsx +5 -2
- package/src/core/components/CallLayout/hooks.ts +0 -28
- package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +49 -0
- package/src/translations/en.json +3 -0
package/dist/index.cjs.js
CHANGED
|
@@ -1406,7 +1406,7 @@ const SpeakerTest = (props) => {
|
|
|
1406
1406
|
const audioElementRef = react.useRef(null);
|
|
1407
1407
|
const [isPlaying, setIsPlaying] = react.useState(false);
|
|
1408
1408
|
const { t } = videoReactBindings.useI18n();
|
|
1409
|
-
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.
|
|
1409
|
+
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.40.0"}/assets/piano.mp3`, } = props;
|
|
1410
1410
|
// Update audio output device when selection changes
|
|
1411
1411
|
react.useEffect(() => {
|
|
1412
1412
|
const audio = audioElementRef.current;
|
|
@@ -2392,15 +2392,30 @@ const DefaultScreenShareOverlay = () => {
|
|
|
2392
2392
|
};
|
|
2393
2393
|
return (jsxRuntime.jsxs("div", { className: "str-video__screen-share-overlay", children: [jsxRuntime.jsx(Icon, { icon: "screen-share-off" }), jsxRuntime.jsx("span", { className: "str-video__screen-share-overlay__title", children: t('You are presenting your screen') }), jsxRuntime.jsxs("button", { onClick: stopScreenShare, type: "button", className: "str-video__screen-share-overlay__button", children: [jsxRuntime.jsx(Icon, { icon: "close" }), " ", t('Stop Screen Sharing')] })] }));
|
|
2394
2394
|
};
|
|
2395
|
-
|
|
2395
|
+
/**
|
|
2396
|
+
* Rendered over a remote participant's tile when the browser's autoplay policy
|
|
2397
|
+
* has blocked their audio. Selecting it calls `call.resumeAudio()`, unblocking
|
|
2398
|
+
* every blocked element at once.
|
|
2399
|
+
*/
|
|
2400
|
+
const DefaultAudioBlockedNotification = () => {
|
|
2401
|
+
const call = videoReactBindings.useCall();
|
|
2402
|
+
const { t } = videoReactBindings.useI18n();
|
|
2403
|
+
return (jsxRuntime.jsx("button", { type: "button", className: "str-video__audio-blocked-notification", onClick: call?.resumeAudio, "aria-live": "polite", children: jsxRuntime.jsxs("span", { className: "str-video__audio-blocked-notification__message", children: [jsxRuntime.jsx(Icon, { icon: "speaker" }), jsxRuntime.jsxs("span", { className: "str-video__audio-blocked-notification__text", children: [jsxRuntime.jsx("span", { className: "str-video__audio-blocked-notification__title", children: t('Audio is blocked by your system') }), jsxRuntime.jsx("span", { className: "str-video__audio-blocked-notification__subtitle", children: t('Click or tap to play audio') })] })] }) }));
|
|
2404
|
+
};
|
|
2405
|
+
const DefaultParticipantViewUI = ({ indicatorsVisible = true, menuPlacement = 'bottom-start', showMenuButton = true, ParticipantActionsContextMenu: ParticipantActionsContextMenu$1 = ParticipantActionsContextMenu, AudioBlockedNotification = DefaultAudioBlockedNotification, }) => {
|
|
2396
2406
|
const { participant, trackType } = useParticipantViewContext();
|
|
2407
|
+
const { useAutoplayBlockedSessionIds } = videoReactBindings.useCallStateHooks();
|
|
2408
|
+
const blockedSessionIds = useAutoplayBlockedSessionIds();
|
|
2397
2409
|
const isScreenSharing = videoClient.hasScreenShare(participant);
|
|
2410
|
+
const shouldShowAudioBlockedNotification = !participant.isLocalParticipant &&
|
|
2411
|
+
trackType !== 'screenShareTrack' &&
|
|
2412
|
+
blockedSessionIds.includes(participant.sessionId);
|
|
2398
2413
|
if (participant.isLocalParticipant &&
|
|
2399
2414
|
isScreenSharing &&
|
|
2400
2415
|
trackType === 'screenShareTrack') {
|
|
2401
2416
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DefaultScreenShareOverlay, {}), jsxRuntime.jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible })] }));
|
|
2402
2417
|
}
|
|
2403
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showMenuButton && (jsxRuntime.jsx(MenuToggle, { strategy: "fixed", placement: menuPlacement, ToggleButton: ToggleButton, children: jsxRuntime.jsx(ParticipantActionsContextMenu$1, {}) })), jsxRuntime.jsx(Reaction, { participant: participant }), jsxRuntime.jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible })] }));
|
|
2418
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [showMenuButton && (jsxRuntime.jsx(MenuToggle, { strategy: "fixed", placement: menuPlacement, ToggleButton: ToggleButton, children: jsxRuntime.jsx(ParticipantActionsContextMenu$1, {}) })), jsxRuntime.jsx(Reaction, { participant: participant }), jsxRuntime.jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible }), AudioBlockedNotification && shouldShowAudioBlockedNotification && (jsxRuntime.jsx(AudioBlockedNotification, {}))] }));
|
|
2404
2419
|
};
|
|
2405
2420
|
const ParticipantDetails = ({ indicatorsVisible = true, }) => {
|
|
2406
2421
|
const { participant, trackType } = useParticipantViewContext();
|
|
@@ -2557,6 +2572,8 @@ var en = {
|
|
|
2557
2572
|
"You have no permission to share your audio": "You have no permission to share your audio",
|
|
2558
2573
|
"You are presenting your screen": "You are presenting your screen",
|
|
2559
2574
|
"Stop Screen Sharing": "Stop Screen Sharing",
|
|
2575
|
+
"Audio is blocked by your system": "Audio is blocked by your system",
|
|
2576
|
+
"Click or tap to play audio": "Click or tap to play audio",
|
|
2560
2577
|
Allow: Allow,
|
|
2561
2578
|
Revoke: Revoke,
|
|
2562
2579
|
Dismiss: Dismiss,
|
|
@@ -2791,22 +2808,6 @@ const usePaginatedLayoutSortPreset = (call) => {
|
|
|
2791
2808
|
};
|
|
2792
2809
|
}, [call]);
|
|
2793
2810
|
};
|
|
2794
|
-
const useSpeakerLayoutSortPreset = (call, isOneOnOneCall) => {
|
|
2795
|
-
react.useEffect(() => {
|
|
2796
|
-
if (!call)
|
|
2797
|
-
return;
|
|
2798
|
-
// always show the remote participant in the spotlight
|
|
2799
|
-
if (isOneOnOneCall) {
|
|
2800
|
-
call.setSortParticipantsBy(videoClient.combineComparators(videoClient.screenSharing, loggedIn));
|
|
2801
|
-
}
|
|
2802
|
-
else {
|
|
2803
|
-
call.setSortParticipantsBy(videoClient.speakerLayoutSortPreset);
|
|
2804
|
-
}
|
|
2805
|
-
return () => {
|
|
2806
|
-
resetSortPreset(call);
|
|
2807
|
-
};
|
|
2808
|
-
}, [call, isOneOnOneCall]);
|
|
2809
|
-
};
|
|
2810
2811
|
const useRawRemoteParticipants = () => {
|
|
2811
2812
|
const { useRawParticipants } = videoReactBindings.useCallStateHooks();
|
|
2812
2813
|
const rawParticipants = useRawParticipants();
|
|
@@ -2817,13 +2818,6 @@ const resetSortPreset = (call) => {
|
|
|
2817
2818
|
const callConfig = videoClient.CallTypes.get(call.type);
|
|
2818
2819
|
call.setSortParticipantsBy(callConfig.options.sortParticipantsBy || videoClient.defaultSortPreset);
|
|
2819
2820
|
};
|
|
2820
|
-
const loggedIn = (a, b) => {
|
|
2821
|
-
if (a.isLocalParticipant)
|
|
2822
|
-
return 1;
|
|
2823
|
-
if (b.isLocalParticipant)
|
|
2824
|
-
return -1;
|
|
2825
|
-
return 0;
|
|
2826
|
-
};
|
|
2827
2821
|
|
|
2828
2822
|
const LivestreamLayout = (props) => {
|
|
2829
2823
|
const { useParticipants, useHasOngoingScreenShare } = videoReactBindings.useCallStateHooks();
|
|
@@ -3080,7 +3074,7 @@ const SpeakerLayout = ({ ParticipantViewUIBar = DefaultParticipantViewUIBar, Par
|
|
|
3080
3074
|
return () => cleanup?.();
|
|
3081
3075
|
}, [participantsBarWrapperElement, call]);
|
|
3082
3076
|
const isOneOnOneCall = allParticipants.length === 2;
|
|
3083
|
-
useSpeakerLayoutSortPreset(call, isOneOnOneCall);
|
|
3077
|
+
videoReactBindings.useSpeakerLayoutSortPreset(call, isOneOnOneCall);
|
|
3084
3078
|
useDragToScroll(participantsBarWrapperElement, {
|
|
3085
3079
|
enabled: enableDragToScroll,
|
|
3086
3080
|
});
|
|
@@ -3284,7 +3278,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
|
|
|
3284
3278
|
return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
|
|
3285
3279
|
};
|
|
3286
3280
|
|
|
3287
|
-
const [major, minor, patch] = ("1.
|
|
3281
|
+
const [major, minor, patch] = ("1.40.0").split('.');
|
|
3288
3282
|
videoClient.setSdkInfo({
|
|
3289
3283
|
type: videoClient.SfuModels.SdkType.REACT,
|
|
3290
3284
|
major,
|
|
@@ -3313,6 +3307,7 @@ exports.CallStatsButton = CallStatsButton;
|
|
|
3313
3307
|
exports.CancelCallButton = CancelCallButton;
|
|
3314
3308
|
exports.CancelCallConfirmButton = CancelCallConfirmButton;
|
|
3315
3309
|
exports.CompositeButton = CompositeButton;
|
|
3310
|
+
exports.DefaultAudioBlockedNotification = DefaultAudioBlockedNotification;
|
|
3316
3311
|
exports.DefaultParticipantViewUI = DefaultParticipantViewUI;
|
|
3317
3312
|
exports.DefaultReactionsMenu = DefaultReactionsMenu;
|
|
3318
3313
|
exports.DefaultScreenShareOverlay = DefaultScreenShareOverlay;
|