@stream-io/video-react-native-sdk 1.29.4 → 1.30.1-beta.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 +11 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +13 -7
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +50 -14
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/commonjs/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +12 -9
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +19 -4
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/commonjs/contexts/ThemeContext.js +14 -3
- package/dist/commonjs/contexts/ThemeContext.js.map +1 -1
- package/dist/commonjs/utils/hooks/index.js +0 -11
- package/dist/commonjs/utils/hooks/index.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +10 -4
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js +52 -16
- package/dist/module/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js +27 -0
- package/dist/module/components/Call/CallContent/RTCViewPipNative.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +19 -10
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +15 -12
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js +20 -5
- package/dist/module/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/module/contexts/ThemeContext.js +13 -1
- package/dist/module/contexts/ThemeContext.js.map +1 -1
- package/dist/module/utils/hooks/index.js +0 -1
- package/dist/module/utils/hooks/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Call/CallContent/CallContent.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipIOS.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +18 -0
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsGrid.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallLayout/CallParticipantsSpotlight.d.ts.map +1 -1
- package/dist/typescript/components/Call/CallParticipantsList/CallParticipantsList.d.ts.map +1 -1
- package/dist/typescript/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/typescript/utils/hooks/index.d.ts +0 -1
- package/dist/typescript/utils/hooks/index.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/ios/PictureInPicture/PictureInPictureAvatarView.swift +273 -0
- package/ios/PictureInPicture/PictureInPictureConnectionQualityIndicator.swift +162 -0
- package/ios/PictureInPicture/PictureInPictureContent.swift +173 -0
- package/ios/PictureInPicture/PictureInPictureContentState.swift +123 -0
- package/ios/PictureInPicture/PictureInPictureDelegateProxy.swift +89 -0
- package/ios/PictureInPicture/PictureInPictureEnforcedStopAdapter.swift +166 -0
- package/ios/PictureInPicture/PictureInPictureLogger.swift +16 -0
- package/ios/PictureInPicture/PictureInPictureParticipantOverlayView.swift +217 -0
- package/ios/PictureInPicture/PictureInPictureReconnectionView.swift +193 -0
- package/ios/PictureInPicture/StreamAVPictureInPictureVideoCallViewController.swift +125 -7
- package/ios/PictureInPicture/StreamPictureInPictureController.swift +237 -63
- package/ios/PictureInPicture/StreamPictureInPictureControllerProtocol.swift +30 -0
- package/ios/PictureInPicture/StreamPictureInPictureVideoRenderer.swift +384 -12
- package/ios/RTCViewPip.swift +187 -21
- package/ios/RTCViewPipManager.mm +9 -0
- package/ios/RTCViewPipManager.swift +3 -3
- package/ios/StreamVideoReactNative.xcodeproj/project.xcworkspace/xcuserdata/santhoshvaiyapuri.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StreamVideoReactNative.xcodeproj/xcuserdata/santhoshvaiyapuri.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/package.json +5 -7
- package/src/components/Call/CallContent/CallContent.tsx +16 -8
- package/src/components/Call/CallContent/RTCViewPipIOS.tsx +81 -15
- package/src/components/Call/CallContent/RTCViewPipNative.tsx +36 -0
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +28 -14
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +19 -10
- package/src/components/Call/CallParticipantsList/CallParticipantsList.tsx +20 -5
- package/src/contexts/ThemeContext.tsx +20 -2
- package/src/utils/hooks/index.ts +0 -1
- package/src/version.ts +1 -1
- package/dist/commonjs/utils/hooks/useDebouncedValue.js +0 -24
- package/dist/commonjs/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/module/utils/hooks/useDebouncedValue.js +0 -19
- package/dist/module/utils/hooks/useDebouncedValue.js.map +0 -1
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts +0 -8
- package/dist/typescript/utils/hooks/useDebouncedValue.d.ts.map +0 -1
- package/src/utils/hooks/useDebouncedValue.ts +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","useState","FlatList","StyleSheet","VisibilityState","Subject","debounceTime","useCall","ComponentTestIds","ParticipantView","DefaultParticipantView","useTheme","VIEWABILITY_CONFIG","waitForInteraction","itemVisiblePercentThreshold","CallParticipantsList","numberOfColumns","horizontal","participants","ParticipantLabel","ParticipantNetworkQualityIndicator","ParticipantReaction","ParticipantVideoFallback","VideoRenderer","supportedReactions","landscape","mirror","styles","useStyles","containerLayout","setContainerLayout","width","height","viewableParticipantSessionIds","current","Set","forceUpdate$Ref","forceUpdate$","forceUpdateValue","setForceUpdateValue","sub","pipe","subscribe","v","unsubscribe","forceUpdate","next","activeCall","activeCallRef","onViewableItemsChanged","viewableItems","participantPatches","mustUpdate","newVisibleParticipantSessionIds","map","key","oldVisibleParticipantSessionIds","forEach","has","viewportVisibilityState","videoTrack","VISIBLE","screenShareTrack","UNKNOWN","state","updateParticipants","keyExtractor","item","sessionId","onLayout","event","nativeEvent","layout","prev","itemHeight","itemWidth","calculateParticipantViewSize","containerHeight","containerWidth","participantsLength","length","margin","participant","itemContainerStyle","style","participantWrapperHorizontal","landScapeStyle","participantProps","renderItem","isVisible","createElement","Fragment","_extends","trackType","shouldWrapByColumns","index","flexed","undefined","data","viewabilityConfig","numColumns","showsHorizontalScrollIndicator","extraData","testID","CALL_PARTICIPANTS_LIST","theme","create","flex","marginHorizontal","variants","spacingSizes","sm","borderRadius","borderRadiusSizes","xs"],"sourceRoot":"../../../../../src","sources":["components/Call/CallParticipantsList/CallParticipantsList.tsx"],"mappings":";AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,QAAQ,EAERC,UAAU,QAEL,cAAc;AAErB,SAGEC,eAAe,QACV,yBAAyB;AAChC,SAASC,OAAO,EAAEC,YAAY,QAAQ,MAAM;AAC5C,SAASC,OAAO,QAAQ,iCAAiC;AACzD,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7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AuB,gBAAgB,EAAEH,KAAK,CAACI,QAAQ,CAACC,YAAY,CAACC,EAAE;MAChDC,YAAY,EAAEP,KAAK,CAACI,QAAQ,CAACI,iBAAiB,CAACF;IACjD,CAAC;IACDzB,cAAc,EAAE;MACd0B,YAAY,EAAEP,KAAK,CAACI,QAAQ,CAACI,iBAAiB,CAACF;IACjD,CAAC;IACD7B,WAAW,EAAE;MACXD,MAAM,EAAEwB,KAAK,CAACI,QAAQ,CAACC,YAAY,CAACI;IACtC;EACF,CAAC,CAAC,EACJ,CAACT,KAAK,CACR,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS7B,4BAA4BA,CAAC;EACpCC,eAAe;EACfC,cAAc;EACdC,kBAAkB;EAClB/D,eAAe;EACfC,UAAU;EACVgE;AAQF,CAAC,EAAE;EACD,IAAIP,UAAU,GAAGG,eAAe;EAChC;EACA,IAAI,CAAC5D,UAAU,EAAE;IACf,IAAI8D,kBAAkB,IAAI,CAAC,EAAE;MAC3B;MACAL,UAAU,GAAGG,eAAe,GAAG,CAAC;IAClC,CAAC,MAAM;MACL;MACAH,UAAU,GAAGG,eAAe,GAAG,CAAC;IAClC;EACF;EAEA,IAAIF,SAAS,GAAGG,cAAc,GAAG9D,eAAe;EAChD,IAAIC,UAAU,EAAE;IACd;IACA0D,SAAS,GAAGA,SAAS,GAAG,CAAC,GAAG,CAAC;EAC/B;EAEAD,UAAU,GAAGA,UAAU,GAAGO,MAAM;EAChCN,SAAS,GAAGA,SAAS,GAAGM,MAAM;EAC9B,OAAO;IAAEP,UAAU;IAAEC;EAAU,CAAC;AAClC","ignoreList":[]}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import React, { createContext, useContext, useMemo } from 'react';
|
|
2
|
-
import merge from 'lodash.merge';
|
|
3
2
|
import { defaultTheme } from '../theme/theme';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* @deprecated Use StreamThemeInputValue instead.
|
|
7
6
|
*/
|
|
8
7
|
|
|
8
|
+
const isObject = value => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
9
|
+
const merge = (target, source) => {
|
|
10
|
+
for (const key in source) {
|
|
11
|
+
const sourceValue = source[key];
|
|
12
|
+
if (sourceValue === undefined) continue;
|
|
13
|
+
const targetValue = target[key];
|
|
14
|
+
if (isObject(sourceValue) && isObject(targetValue)) {
|
|
15
|
+
merge(targetValue, sourceValue);
|
|
16
|
+
} else {
|
|
17
|
+
target[key] = sourceValue;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
9
21
|
export const mergeThemes = params => {
|
|
10
22
|
const {
|
|
11
23
|
style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","useMemo","merge","
|
|
1
|
+
{"version":3,"names":["React","createContext","useContext","useMemo","defaultTheme","isObject","value","Array","isArray","merge","target","source","key","sourceValue","undefined","targetValue","mergeThemes","params","style","theme","finalTheme","Object","keys","length","JSON","parse","stringify","DEFAULT_BASE_CONTEXT_VALUE","ThemeContext","StreamTheme","props","children","mergedStyle","modifiedTheme","createElement","Provider","ThemeProvider","useTheme","Error"],"sourceRoot":"../../../src","sources":["contexts/ThemeContext.tsx"],"mappings":"AAAA,OAAOA,KAAK,IACVC,aAAa,EAEbC,UAAU,EACVC,OAAO,QACF,OAAO;AAEd,SAASC,YAAY,QAAoB,gBAAgB;;AAWzD;AACA;AACA;;AAYA,MAAMC,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC;AAEtE,MAAMG,KAAK,GAAGA,CACZC,MAAS,EACTC,MAAsB,KACnB;EACH,KAAK,MAAMC,GAAG,IAAID,MAAM,EAAE;IACxB,MAAME,WAAW,GAAGF,MAAM,CAACC,GAAG,CAAC;IAC/B,IAAIC,WAAW,KAAKC,SAAS,EAA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CAACO,QAAQ;IAAC7B,KAAK,EAAE2B;EAAc,GACzCF,QACoB,CAAC;AAE5B,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMK,aAAa,GAAGP,WAAW;AAExC,OAAO,MAAMQ,QAAQ,GAAGA,CAAA,KAAM;EAC5B,MAAMlB,KAAK,GAAGjB,UAAU,CAAC0B,YAAY,CAAC;EAEtC,IAAIT,KAAK,KAAKQ,0BAA0B,EAAE;IACxC,MAAM,IAAIW,KAAK,CACb,sOACF,CAAC;EACH;EACA,OAAO;IAAEnB;EAAM,CAAC;AAClB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["utils/hooks/index.ts"],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["utils/hooks/index.ts"],"mappings":"AAAA,cAAc,eAAe","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.30.1-beta.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"names":["version"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":"AAAA,OAAO,MAAMA,OAAO,GAAG,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/CallContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAcpE,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,KAAK,cAAc,
|
|
1
|
+
{"version":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IACH,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAK1C,SAAS,CAAC,EAAE,OAAO,CAAC;IAIpB,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;OAOG;IACH,6BAA6B,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CACnD,CAAC;AAEJ,eAAO,MAAM,WAAW,GAAI,2XAmBzB,gBAAgB,sBAwKlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCViewPipIOS.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipIOS.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RTCViewPipIOS.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipIOS.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAYhE,KAAK,KAAK,GAAG;IACX,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,aAAa,oCAAsB,KAAK,uBAuLnD,CAAC"}
|
|
@@ -8,6 +8,24 @@ type RTCViewPipNativeProps = {
|
|
|
8
8
|
onPiPChange?: (event: {
|
|
9
9
|
nativeEvent: PiPChangeEvent;
|
|
10
10
|
}) => void;
|
|
11
|
+
/** The participant's name for the avatar placeholder when video is disabled */
|
|
12
|
+
participantName?: string;
|
|
13
|
+
/** The URL string for the participant's profile image */
|
|
14
|
+
participantImageURL?: string;
|
|
15
|
+
/** Whether the call is reconnecting - when true, shows reconnection view */
|
|
16
|
+
isReconnecting?: boolean;
|
|
17
|
+
/** Whether screen sharing is active (used for content state tracking) */
|
|
18
|
+
isScreenSharing?: boolean;
|
|
19
|
+
/** Whether the participant has audio enabled (shown in participant overlay) */
|
|
20
|
+
hasAudio?: boolean;
|
|
21
|
+
/** Whether the video track is paused (shown in participant overlay) */
|
|
22
|
+
isTrackPaused?: boolean;
|
|
23
|
+
/** Whether the participant is pinned (shown in participant overlay) */
|
|
24
|
+
isPinned?: boolean;
|
|
25
|
+
/** Whether the participant is currently speaking (shows border highlight) */
|
|
26
|
+
isSpeaking?: boolean;
|
|
27
|
+
/** The connection quality level (0: unknown, 1: poor, 2: good, 3: excellent) */
|
|
28
|
+
connectionQuality?: number;
|
|
11
29
|
};
|
|
12
30
|
export declare function onNativeCallClosed(reactTag: number): void;
|
|
13
31
|
export declare function onNativeDimensionsUpdated(reactTag: number, width: number, height: number): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,cAAc,CAAA;KAAE,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,cAAc,CAAA;KAAE,KAAK,IAAI,CAAC;IAC/D,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gFAAgF;IAChF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAKF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,QAMlD;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,QAaf;AAED;2CAC2C;AAC3C,eAAO,MAAM,gBAAgB,yFAqC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallParticipantsGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallLayout/CallParticipantsGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CallParticipantsGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallLayout/CallParticipantsGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,8CAA8C,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAIvE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,6BAA6B,GACnE,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,GAAG,sBAAsB,CAAC,GACrE,IAAI,CAAC,kCAAkC,EAAE,iBAAiB,GAAG,QAAQ,CAAC,GAAG;IACvE;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,6NAYlC,yBAAyB,sBAgG3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallParticipantsSpotlight.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallLayout/CallParticipantsSpotlight.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CallParticipantsSpotlight.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallLayout/CallParticipantsSpotlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,6BAA6B,GACxE,IAAI,CACF,gBAAgB,EAChB,oBAAoB,GAAG,sBAAsB,GAAG,oBAAoB,CACrE,GACD,IAAI,CAAC,kCAAkC,EAAE,iBAAiB,GAAG,QAAQ,CAAC,GAAG;IACvE;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,yBAAyB,GAAI,2NAYvC,8BAA8B,sBAiHhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallParticipantsList.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallParticipantsList/CallParticipantsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAQf,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYvD,MAAM,MAAM,kCAAkC,GAC5C,6BAA6B,GAAG;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACnE;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,kCAAkC,GACxE,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GAAG;IAC7C;;OAEG;IACH,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,4NAalC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"CallParticipantsList.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallParticipantsList/CallParticipantsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAQf,OAAO,EACL,KAAK,sBAAsB,EAG5B,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EAC1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYvD,MAAM,MAAM,kCAAkC,GAC5C,6BAA6B,GAAG;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACnE;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,kCAAkC,GACxE,IAAI,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,GAAG;IAC7C;;OAEG;IACH,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,4NAalC,yBAAyB,sBA8L3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAgB,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE1D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAsBF,eAAO,MAAM,WAAW,GAAI,QAAQ,kBAAkB,UAarD,CAAC;AAIF,eAAO,MAAM,YAAY,sBAExB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAChC,iBAAiB,CAAC,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAiBtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,uFAAc,CAAC;AAEzC,eAAO,MAAM,QAAQ;;CASpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.30.1-beta.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2024 Stream.io Inc. All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import UIKit
|
|
6
|
+
|
|
7
|
+
/// A view that displays an avatar placeholder when video is disabled in PiP mode.
|
|
8
|
+
/// Shows either a loaded image from URL, initials, or a default person icon.
|
|
9
|
+
final class PictureInPictureAvatarView: UIView {
|
|
10
|
+
|
|
11
|
+
// MARK: - Properties
|
|
12
|
+
|
|
13
|
+
/// The participant's name, used to generate initials
|
|
14
|
+
var participantName: String? {
|
|
15
|
+
didSet {
|
|
16
|
+
PictureInPictureLogger.log("AvatarView.participantName didSet: '\(participantName ?? "nil")'")
|
|
17
|
+
updateInitials()
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/// The URL string for the participant's profile image
|
|
22
|
+
var imageURL: String? {
|
|
23
|
+
didSet {
|
|
24
|
+
loadImage()
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// Whether video is enabled - when true, the avatar should be hidden (alpha = 0)
|
|
29
|
+
/// Note: We use alpha instead of isHidden to match upstream SwiftUI behavior.
|
|
30
|
+
/// Using isHidden can cause layout issues because iOS may skip layoutSubviews for hidden views.
|
|
31
|
+
var isVideoEnabled: Bool = true {
|
|
32
|
+
didSet {
|
|
33
|
+
updateVisibility()
|
|
34
|
+
// When becoming visible (video disabled), refresh content to ensure initials are shown
|
|
35
|
+
// This is needed when the same avatarView instance is reused across PiP sessions
|
|
36
|
+
if !isVideoEnabled {
|
|
37
|
+
PictureInPictureLogger.log("AvatarView isVideoEnabled=false, refreshing content")
|
|
38
|
+
updateInitials()
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// MARK: - Private Properties
|
|
44
|
+
|
|
45
|
+
private let containerView: UIView = {
|
|
46
|
+
let view = UIView()
|
|
47
|
+
view.translatesAutoresizingMaskIntoConstraints = false
|
|
48
|
+
view.backgroundColor = UIColor(red: 0.12, green: 0.13, blue: 0.15, alpha: 1.0) // Dark background
|
|
49
|
+
return view
|
|
50
|
+
}()
|
|
51
|
+
|
|
52
|
+
private let avatarContainerView: UIView = {
|
|
53
|
+
let view = UIView()
|
|
54
|
+
view.translatesAutoresizingMaskIntoConstraints = false
|
|
55
|
+
view.backgroundColor = UIColor(red: 0.0, green: 0.47, blue: 1.0, alpha: 1.0) // Stream blue
|
|
56
|
+
view.clipsToBounds = true
|
|
57
|
+
return view
|
|
58
|
+
}()
|
|
59
|
+
|
|
60
|
+
private let initialsLabel: UILabel = {
|
|
61
|
+
let label = UILabel()
|
|
62
|
+
label.translatesAutoresizingMaskIntoConstraints = false
|
|
63
|
+
label.textColor = .white
|
|
64
|
+
label.textAlignment = .center
|
|
65
|
+
label.font = UIFont.systemFont(ofSize: 32, weight: .semibold)
|
|
66
|
+
label.adjustsFontSizeToFitWidth = true
|
|
67
|
+
label.minimumScaleFactor = 0.5
|
|
68
|
+
return label
|
|
69
|
+
}()
|
|
70
|
+
|
|
71
|
+
private let imageView: UIImageView = {
|
|
72
|
+
let imageView = UIImageView()
|
|
73
|
+
imageView.translatesAutoresizingMaskIntoConstraints = false
|
|
74
|
+
imageView.contentMode = .scaleAspectFill
|
|
75
|
+
imageView.clipsToBounds = true
|
|
76
|
+
imageView.isHidden = true
|
|
77
|
+
return imageView
|
|
78
|
+
}()
|
|
79
|
+
|
|
80
|
+
private let placeholderImageView: UIImageView = {
|
|
81
|
+
let imageView = UIImageView()
|
|
82
|
+
imageView.translatesAutoresizingMaskIntoConstraints = false
|
|
83
|
+
imageView.contentMode = .scaleAspectFit
|
|
84
|
+
imageView.tintColor = .white
|
|
85
|
+
// Use SF Symbol for person icon
|
|
86
|
+
if let personImage = UIImage(systemName: "person.fill") {
|
|
87
|
+
imageView.image = personImage
|
|
88
|
+
}
|
|
89
|
+
imageView.isHidden = true
|
|
90
|
+
return imageView
|
|
91
|
+
}()
|
|
92
|
+
|
|
93
|
+
private var currentImageLoadTask: URLSessionDataTask?
|
|
94
|
+
private var avatarSizeConstraints: [NSLayoutConstraint] = []
|
|
95
|
+
|
|
96
|
+
// MARK: - Lifecycle
|
|
97
|
+
|
|
98
|
+
override init(frame: CGRect) {
|
|
99
|
+
super.init(frame: frame)
|
|
100
|
+
setUp()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
required init?(coder: NSCoder) {
|
|
104
|
+
fatalError("init(coder:) has not been implemented")
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
override func layoutSubviews() {
|
|
108
|
+
super.layoutSubviews()
|
|
109
|
+
PictureInPictureLogger.log("AvatarView layoutSubviews: bounds=\(bounds), isHidden=\(isHidden)")
|
|
110
|
+
updateAvatarSize()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// MARK: - Private Helpers
|
|
114
|
+
|
|
115
|
+
private func setUp() {
|
|
116
|
+
addSubview(containerView)
|
|
117
|
+
containerView.addSubview(avatarContainerView)
|
|
118
|
+
avatarContainerView.addSubview(initialsLabel)
|
|
119
|
+
avatarContainerView.addSubview(imageView)
|
|
120
|
+
avatarContainerView.addSubview(placeholderImageView)
|
|
121
|
+
|
|
122
|
+
NSLayoutConstraint.activate([
|
|
123
|
+
containerView.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
124
|
+
containerView.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
125
|
+
containerView.topAnchor.constraint(equalTo: topAnchor),
|
|
126
|
+
containerView.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
127
|
+
|
|
128
|
+
avatarContainerView.centerXAnchor.constraint(equalTo: containerView.centerXAnchor),
|
|
129
|
+
avatarContainerView.centerYAnchor.constraint(equalTo: containerView.centerYAnchor),
|
|
130
|
+
|
|
131
|
+
initialsLabel.leadingAnchor.constraint(equalTo: avatarContainerView.leadingAnchor, constant: 4),
|
|
132
|
+
initialsLabel.trailingAnchor.constraint(equalTo: avatarContainerView.trailingAnchor, constant: -4),
|
|
133
|
+
initialsLabel.topAnchor.constraint(equalTo: avatarContainerView.topAnchor, constant: 4),
|
|
134
|
+
initialsLabel.bottomAnchor.constraint(equalTo: avatarContainerView.bottomAnchor, constant: -4),
|
|
135
|
+
|
|
136
|
+
imageView.leadingAnchor.constraint(equalTo: avatarContainerView.leadingAnchor),
|
|
137
|
+
imageView.trailingAnchor.constraint(equalTo: avatarContainerView.trailingAnchor),
|
|
138
|
+
imageView.topAnchor.constraint(equalTo: avatarContainerView.topAnchor),
|
|
139
|
+
imageView.bottomAnchor.constraint(equalTo: avatarContainerView.bottomAnchor),
|
|
140
|
+
|
|
141
|
+
placeholderImageView.centerXAnchor.constraint(equalTo: avatarContainerView.centerXAnchor),
|
|
142
|
+
placeholderImageView.centerYAnchor.constraint(equalTo: avatarContainerView.centerYAnchor),
|
|
143
|
+
placeholderImageView.widthAnchor.constraint(equalTo: avatarContainerView.widthAnchor, multiplier: 0.5),
|
|
144
|
+
placeholderImageView.heightAnchor.constraint(equalTo: avatarContainerView.heightAnchor, multiplier: 0.5)
|
|
145
|
+
])
|
|
146
|
+
|
|
147
|
+
updateAvatarSize()
|
|
148
|
+
updateVisibility()
|
|
149
|
+
// Ensure initial content state is correct (show placeholder when no name/image)
|
|
150
|
+
updateInitials()
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
private func updateAvatarSize() {
|
|
154
|
+
// Remove old constraints
|
|
155
|
+
NSLayoutConstraint.deactivate(avatarSizeConstraints)
|
|
156
|
+
|
|
157
|
+
// Avatar size should be about 40% of the smaller dimension
|
|
158
|
+
let minDimension = min(bounds.width, bounds.height)
|
|
159
|
+
let avatarSize = max(minDimension * 0.4, 60) // Minimum 60pt
|
|
160
|
+
|
|
161
|
+
PictureInPictureLogger.log("AvatarView updateAvatarSize: bounds=\(bounds), minDimension=\(minDimension), avatarSize=\(avatarSize)")
|
|
162
|
+
|
|
163
|
+
avatarSizeConstraints = [
|
|
164
|
+
avatarContainerView.widthAnchor.constraint(equalToConstant: avatarSize),
|
|
165
|
+
avatarContainerView.heightAnchor.constraint(equalToConstant: avatarSize)
|
|
166
|
+
]
|
|
167
|
+
NSLayoutConstraint.activate(avatarSizeConstraints)
|
|
168
|
+
|
|
169
|
+
// Force immediate layout to apply the new constraints
|
|
170
|
+
// This is needed because constraints set during layoutSubviews
|
|
171
|
+
// won't be resolved until the next layout pass otherwise
|
|
172
|
+
containerView.setNeedsLayout()
|
|
173
|
+
containerView.layoutIfNeeded()
|
|
174
|
+
|
|
175
|
+
// Update corner radius after layout is complete
|
|
176
|
+
avatarContainerView.layer.cornerRadius = avatarContainerView.bounds.width / 2
|
|
177
|
+
|
|
178
|
+
PictureInPictureLogger.log("AvatarView updateAvatarSize FINAL: avatarContainer.frame=\(avatarContainerView.frame)")
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
private func updateVisibility() {
|
|
182
|
+
// Hide avatar when video is enabled using alpha (not isHidden)
|
|
183
|
+
// Using alpha instead of isHidden ensures layoutSubviews is always called,
|
|
184
|
+
// which is critical for proper constraint-based layout. This matches
|
|
185
|
+
// upstream SwiftUI's opacity-based visibility switching.
|
|
186
|
+
let newAlpha: CGFloat = isVideoEnabled ? 0 : 1
|
|
187
|
+
PictureInPictureLogger.log("AvatarView updateVisibility: isVideoEnabled=\(isVideoEnabled), setting alpha=\(newAlpha)")
|
|
188
|
+
alpha = newAlpha
|
|
189
|
+
|
|
190
|
+
// Force layout update when becoming visible to ensure proper sizing
|
|
191
|
+
if !isVideoEnabled {
|
|
192
|
+
PictureInPictureLogger.log("AvatarView updateVisibility: becoming visible, forcing layout")
|
|
193
|
+
setNeedsLayout()
|
|
194
|
+
layoutIfNeeded()
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
private func updateInitials() {
|
|
199
|
+
guard let name = participantName, !name.isEmpty else {
|
|
200
|
+
PictureInPictureLogger.log("AvatarView updateInitials: no name, showing placeholder. avatarContainer.frame=\(avatarContainerView.frame)")
|
|
201
|
+
initialsLabel.text = nil
|
|
202
|
+
initialsLabel.isHidden = true
|
|
203
|
+
// Show placeholder when there's no image loaded
|
|
204
|
+
placeholderImageView.isHidden = imageView.image != nil
|
|
205
|
+
return
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
let initials = generateInitials(from: name)
|
|
209
|
+
PictureInPictureLogger.log("AvatarView updateInitials: name=\(name), initials=\(initials), imageView.image=\(imageView.image != nil ? "loaded" : "nil"), avatarContainer.frame=\(avatarContainerView.frame)")
|
|
210
|
+
initialsLabel.text = initials
|
|
211
|
+
initialsLabel.isHidden = imageView.image != nil
|
|
212
|
+
placeholderImageView.isHidden = true
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
private func generateInitials(from name: String) -> String {
|
|
216
|
+
let components = name.split(separator: " ")
|
|
217
|
+
if components.count >= 2 {
|
|
218
|
+
let first = components[0].prefix(1)
|
|
219
|
+
let last = components[1].prefix(1)
|
|
220
|
+
return "\(first)\(last)".uppercased()
|
|
221
|
+
} else if let first = components.first {
|
|
222
|
+
return String(first.prefix(2)).uppercased()
|
|
223
|
+
}
|
|
224
|
+
return ""
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
private func loadImage() {
|
|
228
|
+
// Cancel any existing task
|
|
229
|
+
currentImageLoadTask?.cancel()
|
|
230
|
+
currentImageLoadTask = nil
|
|
231
|
+
|
|
232
|
+
guard let urlString = imageURL, !urlString.isEmpty, let url = URL(string: urlString) else {
|
|
233
|
+
imageView.image = nil
|
|
234
|
+
imageView.isHidden = true
|
|
235
|
+
updateInitials()
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
let requestURLString = urlString
|
|
240
|
+
|
|
241
|
+
// Load image asynchronously
|
|
242
|
+
var requestTask: URLSessionDataTask?
|
|
243
|
+
let task = URLSession.shared.dataTask(with: url) { [weak self] data, _, error in
|
|
244
|
+
DispatchQueue.main.async { [weak self] in
|
|
245
|
+
guard let self = self else { return }
|
|
246
|
+
guard let requestTask else { return }
|
|
247
|
+
guard self.currentImageLoadTask === requestTask else { return }
|
|
248
|
+
defer { self.currentImageLoadTask = nil }
|
|
249
|
+
|
|
250
|
+
// Ignore stale/cancelled responses so only the latest request can mutate UI.
|
|
251
|
+
if let nsError = error as NSError?, nsError.code == NSURLErrorCancelled {
|
|
252
|
+
return
|
|
253
|
+
}
|
|
254
|
+
guard self.imageURL == requestURLString else { return }
|
|
255
|
+
|
|
256
|
+
guard error == nil, let data = data, let image = UIImage(data: data) else {
|
|
257
|
+
self.imageView.image = nil
|
|
258
|
+
self.imageView.isHidden = true
|
|
259
|
+
self.updateInitials()
|
|
260
|
+
return
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
self.imageView.image = image
|
|
264
|
+
self.imageView.isHidden = false
|
|
265
|
+
self.initialsLabel.isHidden = true
|
|
266
|
+
self.placeholderImageView.isHidden = true
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
requestTask = task
|
|
270
|
+
currentImageLoadTask = task
|
|
271
|
+
task.resume()
|
|
272
|
+
}
|
|
273
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright © 2024 Stream.io Inc. All rights reserved.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import UIKit
|
|
6
|
+
|
|
7
|
+
/// A view representing a connection quality indicator for Picture-in-Picture.
|
|
8
|
+
/// Displays three vertical bars that indicate connection quality levels:
|
|
9
|
+
/// - Excellent: All 3 bars green
|
|
10
|
+
/// - Good: 2 bars green, 1 bar gray
|
|
11
|
+
/// - Poor: 1 bar red, 2 bars gray
|
|
12
|
+
/// - Unknown: All bars hidden
|
|
13
|
+
/// This aligns with upstream stream-video-swift ConnectionQualityIndicator.
|
|
14
|
+
final class PictureInPictureConnectionQualityIndicator: UIView {
|
|
15
|
+
|
|
16
|
+
// MARK: - Connection Quality Enum
|
|
17
|
+
|
|
18
|
+
/// Connection quality levels matching the stream-video-swift/video-client enum
|
|
19
|
+
enum ConnectionQuality: Int {
|
|
20
|
+
case unspecified = 0 // Unknown
|
|
21
|
+
case poor = 1
|
|
22
|
+
case good = 2
|
|
23
|
+
case excellent = 3
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// MARK: - Properties
|
|
27
|
+
|
|
28
|
+
/// The current connection quality level
|
|
29
|
+
var connectionQuality: ConnectionQuality = .unspecified {
|
|
30
|
+
didSet {
|
|
31
|
+
updateIndicator()
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/// Size of the indicator view
|
|
36
|
+
private let indicatorSize: CGFloat = 24
|
|
37
|
+
|
|
38
|
+
/// Width of each bar
|
|
39
|
+
private let barWidth: CGFloat = 3
|
|
40
|
+
|
|
41
|
+
/// Spacing between bars
|
|
42
|
+
private let barSpacing: CGFloat = 2
|
|
43
|
+
|
|
44
|
+
// MARK: - Colors
|
|
45
|
+
|
|
46
|
+
private let goodColor = UIColor(red: 0.2, green: 0.8, blue: 0.4, alpha: 1.0) // Green
|
|
47
|
+
private let badColor = UIColor(red: 0.9, green: 0.3, blue: 0.3, alpha: 1.0) // Red
|
|
48
|
+
private let inactiveColor = UIColor.white.withAlphaComponent(0.5)
|
|
49
|
+
|
|
50
|
+
// MARK: - UI Components
|
|
51
|
+
|
|
52
|
+
/// Background container with rounded corner
|
|
53
|
+
private lazy var containerView: UIView = {
|
|
54
|
+
let view = UIView()
|
|
55
|
+
view.translatesAutoresizingMaskIntoConstraints = false
|
|
56
|
+
view.backgroundColor = UIColor.black.withAlphaComponent(0.6)
|
|
57
|
+
// Apply rounded corner only to top-left
|
|
58
|
+
view.layer.cornerRadius = 8
|
|
59
|
+
view.layer.maskedCorners = [.layerMinXMinYCorner] // top-left only
|
|
60
|
+
return view
|
|
61
|
+
}()
|
|
62
|
+
|
|
63
|
+
/// Stack view containing the three bars
|
|
64
|
+
private lazy var barsStackView: UIStackView = {
|
|
65
|
+
let stack = UIStackView()
|
|
66
|
+
stack.translatesAutoresizingMaskIntoConstraints = false
|
|
67
|
+
stack.axis = .horizontal
|
|
68
|
+
stack.alignment = .bottom
|
|
69
|
+
stack.spacing = barSpacing
|
|
70
|
+
stack.distribution = .equalSpacing
|
|
71
|
+
return stack
|
|
72
|
+
}()
|
|
73
|
+
|
|
74
|
+
/// First (shortest) bar
|
|
75
|
+
private lazy var bar1: UIView = {
|
|
76
|
+
createBar(height: barWidth * 2)
|
|
77
|
+
}()
|
|
78
|
+
|
|
79
|
+
/// Second (medium) bar
|
|
80
|
+
private lazy var bar2: UIView = {
|
|
81
|
+
createBar(height: barWidth * 3)
|
|
82
|
+
}()
|
|
83
|
+
|
|
84
|
+
/// Third (tallest) bar
|
|
85
|
+
private lazy var bar3: UIView = {
|
|
86
|
+
createBar(height: barWidth * 4)
|
|
87
|
+
}()
|
|
88
|
+
|
|
89
|
+
// MARK: - Initialization
|
|
90
|
+
|
|
91
|
+
override init(frame: CGRect) {
|
|
92
|
+
super.init(frame: frame)
|
|
93
|
+
setUp()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
required init?(coder: NSCoder) {
|
|
97
|
+
fatalError("init(coder:) has not been implemented")
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// MARK: - Private Methods
|
|
101
|
+
|
|
102
|
+
private func setUp() {
|
|
103
|
+
isUserInteractionEnabled = false
|
|
104
|
+
isHidden = true // Hidden by default (unknown quality)
|
|
105
|
+
|
|
106
|
+
addSubview(containerView)
|
|
107
|
+
containerView.addSubview(barsStackView)
|
|
108
|
+
|
|
109
|
+
barsStackView.addArrangedSubview(bar1)
|
|
110
|
+
barsStackView.addArrangedSubview(bar2)
|
|
111
|
+
barsStackView.addArrangedSubview(bar3)
|
|
112
|
+
|
|
113
|
+
NSLayoutConstraint.activate([
|
|
114
|
+
containerView.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
115
|
+
containerView.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
116
|
+
containerView.widthAnchor.constraint(equalToConstant: indicatorSize),
|
|
117
|
+
containerView.heightAnchor.constraint(equalToConstant: indicatorSize),
|
|
118
|
+
|
|
119
|
+
barsStackView.centerXAnchor.constraint(equalTo: containerView.centerXAnchor),
|
|
120
|
+
barsStackView.centerYAnchor.constraint(equalTo: containerView.centerYAnchor)
|
|
121
|
+
])
|
|
122
|
+
|
|
123
|
+
updateIndicator()
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private func createBar(height: CGFloat) -> UIView {
|
|
127
|
+
let bar = UIView()
|
|
128
|
+
bar.translatesAutoresizingMaskIntoConstraints = false
|
|
129
|
+
bar.backgroundColor = inactiveColor
|
|
130
|
+
bar.layer.cornerRadius = 1
|
|
131
|
+
bar.layer.masksToBounds = true
|
|
132
|
+
|
|
133
|
+
NSLayoutConstraint.activate([
|
|
134
|
+
bar.widthAnchor.constraint(equalToConstant: barWidth),
|
|
135
|
+
bar.heightAnchor.constraint(equalToConstant: height)
|
|
136
|
+
])
|
|
137
|
+
|
|
138
|
+
return bar
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private func updateIndicator() {
|
|
142
|
+
switch connectionQuality {
|
|
143
|
+
case .excellent:
|
|
144
|
+
isHidden = false
|
|
145
|
+
bar1.backgroundColor = goodColor
|
|
146
|
+
bar2.backgroundColor = goodColor
|
|
147
|
+
bar3.backgroundColor = goodColor
|
|
148
|
+
case .good:
|
|
149
|
+
isHidden = false
|
|
150
|
+
bar1.backgroundColor = goodColor
|
|
151
|
+
bar2.backgroundColor = goodColor
|
|
152
|
+
bar3.backgroundColor = inactiveColor
|
|
153
|
+
case .poor:
|
|
154
|
+
isHidden = false
|
|
155
|
+
bar1.backgroundColor = badColor
|
|
156
|
+
bar2.backgroundColor = inactiveColor
|
|
157
|
+
bar3.backgroundColor = inactiveColor
|
|
158
|
+
case .unspecified:
|
|
159
|
+
isHidden = true
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|