@stream-io/video-react-sdk 1.35.2 → 1.36.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/CHANGELOG.md +26 -0
- package/dist/{embedded-BackgroundFilters-g6ozIvlN.es.js → background-filters-D2U5UBbH.es.js} +95 -32
- package/dist/background-filters-D2U5UBbH.es.js.map +1 -0
- package/dist/{background-filters-DdQqSx4T.cjs.js → background-filters-folwWrgs.cjs.js} +95 -32
- package/dist/background-filters-folwWrgs.cjs.js.map +1 -0
- package/dist/{background-filters-g6ozIvlN.es.js → embedded-BackgroundFilters-D2U5UBbH.es.js} +95 -32
- package/dist/embedded-BackgroundFilters-D2U5UBbH.es.js.map +1 -0
- package/dist/{embedded-BackgroundFilters-DdQqSx4T.cjs.js → embedded-BackgroundFilters-folwWrgs.cjs.js} +95 -32
- package/dist/embedded-BackgroundFilters-folwWrgs.cjs.js.map +1 -0
- package/dist/embedded.cjs.js +4 -28
- package/dist/embedded.cjs.js.map +1 -1
- package/dist/embedded.es.js +5 -29
- package/dist/embedded.es.js.map +1 -1
- package/dist/index.cjs.js +5 -29
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +6 -30
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/BackgroundFilters/types.d.ts +5 -4
- package/package.json +3 -3
- package/src/components/BackgroundFilters/BackgroundFilters.tsx +145 -53
- package/src/components/BackgroundFilters/types.ts +5 -4
- package/src/core/components/CallLayout/PaginatedGridLayout.tsx +1 -0
- package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +7 -35
- package/dist/background-filters-DdQqSx4T.cjs.js.map +0 -1
- package/dist/background-filters-g6ozIvlN.es.js.map +0 -1
- package/dist/embedded-BackgroundFilters-DdQqSx4T.cjs.js.map +0 -1
- package/dist/embedded-BackgroundFilters-g6ozIvlN.es.js.map +0 -1
package/dist/embedded.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useEffect, Fragment as Fragment$1, createContext, useContext, useCallback, useMemo, useRef, isValidElement, forwardRef, useLayoutEffect, lazy, Suspense } from 'react';
|
|
3
|
-
import { useCall, useCallStateHooks, useI18n, Restricted, useToggleCallRecording, useConnectedUser, StreamCallProvider, StreamVideoProvider, useEffectEvent } from '@stream-io/video-react-bindings';
|
|
3
|
+
import { useCall, useCallStateHooks, useI18n, Restricted, useToggleCallRecording, useConnectedUser, useIsAudioConnecting, StreamCallProvider, StreamVideoProvider, useEffectEvent } from '@stream-io/video-react-bindings';
|
|
4
4
|
import { hasAudio, hasScreenShareAudio, hasVideo, hasScreenShare, OwnCapability, Browsers, VisibilityState, hasPausedTrack, createSoundDetector, isPinned, name, NoiseCancellationSettingsModeEnum, CallingState, SfuModels, combineComparators, screenSharing, speakerLayoutSortPreset, paginatedLayoutSortPreset, CallTypes, defaultSortPreset, humanize, StreamVideoClient } from '@stream-io/video-client';
|
|
5
5
|
import { useFloating, offset, shift, flip, size, autoUpdate, FloatingOverlay, FloatingPortal, arrow, FloatingArrow, useListItem, useListNavigation, useTypeahead, useClick, useDismiss, useRole, useInteractions, FloatingFocusManager, FloatingList } from '@floating-ui/react';
|
|
6
6
|
import clsx from 'clsx';
|
|
@@ -684,7 +684,7 @@ const AvatarFallback = ({ className, names, style, }) => {
|
|
|
684
684
|
return (jsx("div", { className: clsx('str-video__avatar--initials-fallback', className), style: style, children: jsxs("div", { children: [names[0][0], names[1]?.[0]] }) }));
|
|
685
685
|
};
|
|
686
686
|
|
|
687
|
-
const BackgroundFiltersProviderImpl = lazy(() => import('./embedded-BackgroundFilters-
|
|
687
|
+
const BackgroundFiltersProviderImpl = lazy(() => import('./embedded-BackgroundFilters-D2U5UBbH.es.js').then((m) => ({
|
|
688
688
|
default: m.BackgroundFiltersProvider,
|
|
689
689
|
})));
|
|
690
690
|
/**
|
|
@@ -1205,7 +1205,7 @@ const SpeakerTest = (props) => {
|
|
|
1205
1205
|
const audioElementRef = useRef(null);
|
|
1206
1206
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
1207
1207
|
const { t } = useI18n();
|
|
1208
|
-
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.
|
|
1208
|
+
const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.36.1"}/assets/piano.mp3`, } = props;
|
|
1209
1209
|
// Update audio output device when selection changes
|
|
1210
1210
|
useEffect(() => {
|
|
1211
1211
|
const audio = audioElementRef.current;
|
|
@@ -1882,8 +1882,7 @@ const ParticipantDetails = ({ indicatorsVisible = true, }) => {
|
|
|
1882
1882
|
const hasVideoTrack = hasVideo(participant);
|
|
1883
1883
|
const canUnpin = !!pin && pin.isLocalPin;
|
|
1884
1884
|
const isTrackPaused = trackType !== 'none' ? hasPausedTrack(participant, trackType) : false;
|
|
1885
|
-
const
|
|
1886
|
-
const isAudioConnecting = hasAudioTrack && !isAudioTrackUnmuted;
|
|
1885
|
+
const isAudioConnecting = useIsAudioConnecting(participant);
|
|
1887
1886
|
return (jsxs(Fragment, { children: [jsx("div", { className: "str-video__participant-details", children: jsxs("div", { className: "str-video__participant-details__name", children: [name || userId, indicatorsVisible && isAudioConnecting && (jsx(LoadingIndicator, { className: "str-video__participant-details__name--audio-connecting", tooltip: t('Audio is connecting...') })), indicatorsVisible && !hasAudioTrack && (jsx("span", { className: "str-video__participant-details__name--audio-muted" })), indicatorsVisible && !hasVideoTrack && (jsx("span", { className: "str-video__participant-details__name--video-muted" })), indicatorsVisible && isTrackPaused && (jsx("span", { title: t('Video paused due to insufficient bandwidth'), className: "str-video__participant-details__name--track-paused" })), indicatorsVisible && pin && (jsx("span", { title: canUnpin ? t('Unpin') : t('Pinned'), onClick: canUnpin ? () => call?.unpin(sessionId) : undefined, className: "str-video__participant-details__name--pinned" })), indicatorsVisible && jsx(SpeechIndicator, {})] }) }), indicatorsVisible && (jsx(Notification, { isVisible: isLocalParticipant &&
|
|
1888
1887
|
connectionQuality === SfuModels.ConnectionQuality.POOR, message: t('Poor connection quality'), children: connectionQualityAsString && (jsx("span", { className: clsx('str-video__participant-details__connection-quality', `str-video__participant-details__connection-quality--${connectionQualityAsString}`), title: connectionQualityAsString })) }))] }));
|
|
1889
1888
|
};
|
|
@@ -1892,29 +1891,6 @@ const SpeechIndicator = () => {
|
|
|
1892
1891
|
const { isSpeaking, isDominantSpeaker } = participant;
|
|
1893
1892
|
return (jsxs("span", { className: clsx('str-video__speech-indicator', isSpeaking && 'str-video__speech-indicator--speaking', isDominantSpeaker && 'str-video__speech-indicator--dominant'), children: [jsx("span", { className: "str-video__speech-indicator__bar" }), jsx("span", { className: "str-video__speech-indicator__bar" }), jsx("span", { className: "str-video__speech-indicator__bar" })] }));
|
|
1894
1893
|
};
|
|
1895
|
-
const useIsTrackUnmuted = (participant) => {
|
|
1896
|
-
const audioStream = participant.audioStream;
|
|
1897
|
-
const [unmuted, setUnmuted] = useState(() => {
|
|
1898
|
-
const track = audioStream?.getAudioTracks()[0];
|
|
1899
|
-
return !!track && !track.muted;
|
|
1900
|
-
});
|
|
1901
|
-
useEffect(() => {
|
|
1902
|
-
const track = audioStream?.getAudioTracks()[0];
|
|
1903
|
-
if (!track)
|
|
1904
|
-
return;
|
|
1905
|
-
setUnmuted(!track.muted);
|
|
1906
|
-
const handler = () => {
|
|
1907
|
-
setUnmuted(!track.muted);
|
|
1908
|
-
};
|
|
1909
|
-
track.addEventListener('mute', handler);
|
|
1910
|
-
track.addEventListener('unmute', handler);
|
|
1911
|
-
return () => {
|
|
1912
|
-
track.removeEventListener('mute', handler);
|
|
1913
|
-
track.removeEventListener('unmute', handler);
|
|
1914
|
-
};
|
|
1915
|
-
}, [audioStream]);
|
|
1916
|
-
return unmuted;
|
|
1917
|
-
};
|
|
1918
1894
|
|
|
1919
1895
|
const ParticipantView = forwardRef(function ParticipantView({ participant, trackType = 'videoTrack', mirror, muteAudio, refs: { setVideoElement, setVideoPlaceholderElement } = {}, className, VideoPlaceholder, PictureInPicturePlaceholder, ParticipantViewUI = DefaultParticipantViewUI, }, ref) {
|
|
1920
1896
|
const { isLocalParticipant, isSpeaking, isDominantSpeaker, sessionId } = participant;
|
|
@@ -2420,7 +2396,7 @@ const formatDuration = (durationInMs) => {
|
|
|
2420
2396
|
|
|
2421
2397
|
const GROUP_SIZE = 16;
|
|
2422
2398
|
const PaginatedGridLayoutGroup = ({ group, mirror, VideoPlaceholder, PictureInPicturePlaceholder, ParticipantViewUI, }) => {
|
|
2423
|
-
return (jsx("div", { className: clsx('str-video__paginated-grid-layout__group', {
|
|
2399
|
+
return (jsx("div", { "data-group-size": group.length, className: clsx('str-video__paginated-grid-layout__group', {
|
|
2424
2400
|
'str-video__paginated-grid-layout--one': group.length === 1,
|
|
2425
2401
|
'str-video__paginated-grid-layout--two-four': group.length >= 2 && group.length <= 4,
|
|
2426
2402
|
'str-video__paginated-grid-layout--five-nine': group.length >= 5 && group.length <= 9,
|