@stream-io/video-react-native-sdk 1.12.0 → 1.13.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 +13 -0
- package/android/build.gradle +2 -0
- package/android/src/main/java/com/streamvideo/reactnative/StreamVideoReactNativeModule.kt +72 -0
- package/android/src/main/java/com/streamvideo/reactnative/util/YuvFrame.kt +97 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +1 -2
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js +1 -2
- package/dist/commonjs/components/Call/CallContent/RTCViewPipIOS.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/AcceptCallButton.js +1 -2
- package/dist/commonjs/components/Call/CallControls/AcceptCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/LobbyControls.js +1 -2
- package/dist/commonjs/components/Call/CallControls/LobbyControls.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/ReactionsButton.js +1 -2
- package/dist/commonjs/components/Call/CallControls/ReactionsButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/RejectCallButton.js +1 -2
- package/dist/commonjs/components/Call/CallControls/RejectCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/ScreenShareToggleButton.js +1 -2
- package/dist/commonjs/components/Call/CallControls/ScreenShareToggleButton.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js +1 -2
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +1 -2
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js +1 -2
- package/dist/commonjs/components/Call/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js +1 -2
- package/dist/commonjs/components/Call/Lobby/JoinCallButton.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +1 -2
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js +1 -2
- package/dist/commonjs/components/Call/Lobby/LobbyFooter.js.map +1 -1
- package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js +1 -2
- package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +1 -2
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +1 -2
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js +1 -2
- package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js +1 -2
- package/dist/commonjs/components/Livestream/LivestreamPlayer/LivestreamPlayer.js.map +1 -1
- package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js +1 -2
- package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -1
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +1 -2
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js +1 -2
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/AnimatedFloatingView.js.map +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +1 -2
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js +1 -2
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantLabel.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js +1 -2
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantReaction.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js +1 -2
- package/dist/commonjs/components/Participant/ParticipantView/ParticipantView.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/SpeechIndicator.js +1 -2
- package/dist/commonjs/components/Participant/ParticipantView/SpeechIndicator.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js +18 -4
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/commonjs/contexts/BackgroundFilters.js +1 -2
- package/dist/commonjs/contexts/BackgroundFilters.js.map +1 -1
- package/dist/commonjs/contexts/StreamVideoContext.js +1 -2
- package/dist/commonjs/contexts/StreamVideoContext.js.map +1 -1
- package/dist/commonjs/contexts/ThemeContext.js +1 -2
- package/dist/commonjs/contexts/ThemeContext.js.map +1 -1
- package/dist/commonjs/contexts/internal/ScreenshotIosContext.js +77 -0
- package/dist/commonjs/contexts/internal/ScreenshotIosContext.js.map +1 -0
- package/dist/commonjs/hooks/index.js +11 -0
- package/dist/commonjs/hooks/index.js.map +1 -1
- package/dist/commonjs/hooks/useScreenshot.js +54 -0
- package/dist/commonjs/hooks/useScreenshot.js.map +1 -0
- package/dist/commonjs/icons/Lock.js +1 -2
- package/dist/commonjs/icons/Lock.js.map +1 -1
- package/dist/commonjs/icons/ScreenShare.js +1 -2
- package/dist/commonjs/icons/ScreenShare.js.map +1 -1
- package/dist/commonjs/icons/ScreenShareIndicator.js +1 -2
- package/dist/commonjs/icons/ScreenShareIndicator.js.map +1 -1
- package/dist/commonjs/icons/Settings.js +1 -2
- package/dist/commonjs/icons/Settings.js.map +1 -1
- package/dist/commonjs/icons/StopScreenShare.js +1 -2
- package/dist/commonjs/icons/StopScreenShare.js.map +1 -1
- package/dist/commonjs/providers/StreamCall/index.js +1 -2
- package/dist/commonjs/providers/StreamCall/index.js.map +1 -1
- package/dist/commonjs/providers/StreamVideo.js +3 -3
- package/dist/commonjs/providers/StreamVideo.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer.js +18 -3
- package/dist/module/components/Participant/ParticipantView/VideoRenderer.js.map +1 -1
- package/dist/module/contexts/internal/ScreenshotIosContext.js +68 -0
- package/dist/module/contexts/internal/ScreenshotIosContext.js.map +1 -0
- package/dist/module/hooks/index.js +1 -0
- package/dist/module/hooks/index.js.map +1 -1
- package/dist/module/hooks/useScreenshot.js +48 -0
- package/dist/module/hooks/useScreenshot.js.map +1 -0
- package/dist/module/providers/StreamVideo.js +3 -1
- package/dist/module/providers/StreamVideo.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts +2 -2
- package/dist/typescript/components/Call/CallContent/RTCViewPipNative.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer.d.ts.map +1 -1
- package/dist/typescript/contexts/internal/ScreenshotIosContext.d.ts +11 -0
- package/dist/typescript/contexts/internal/ScreenshotIosContext.d.ts.map +1 -0
- package/dist/typescript/hooks/index.d.ts +1 -0
- package/dist/typescript/hooks/index.d.ts.map +1 -1
- package/dist/typescript/hooks/useScreenshot.d.ts +19 -0
- package/dist/typescript/hooks/useScreenshot.d.ts.map +1 -0
- package/dist/typescript/providers/StreamVideo.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/common/{addNewLinesToAppDelegate.js → addNewLinesToAppDelegateObjc.js} +3 -3
- package/expo-config-plugin/dist/common/addToSwiftBridgingHeaderFile.js +48 -0
- package/expo-config-plugin/dist/withAppDelegate.js +216 -34
- package/ios/StreamVideoReactNative.m +96 -0
- package/package.json +23 -25
- package/src/components/Participant/ParticipantView/VideoRenderer.tsx +35 -3
- package/src/contexts/internal/ScreenshotIosContext.tsx +145 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useScreenshot.ts +78 -0
- package/src/providers/StreamVideo.tsx +5 -2
- package/src/version.ts +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
3
|
import { RTCView } from '@stream-io/react-native-webrtc';
|
|
4
4
|
import { CallingState, hasScreenShare, hasVideo, VisibilityState } from '@stream-io/video-client';
|
|
5
5
|
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
6
6
|
import { ParticipantVideoFallback as DefaultParticipantVideoFallback } from './ParticipantVideoFallback';
|
|
7
7
|
import { useTheme } from '../../../contexts/ThemeContext';
|
|
8
8
|
import { useTrackDimensions } from '../../../hooks/useTrackDimensions';
|
|
9
|
+
import { useScreenshotIosContext } from '../../../contexts/internal/ScreenshotIosContext';
|
|
9
10
|
const DEFAULT_VIEWPORT_VISIBILITY_STATE = {
|
|
10
11
|
videoTrack: VisibilityState.UNKNOWN,
|
|
11
12
|
screenShareTrack: VisibilityState.UNKNOWN
|
|
@@ -43,11 +44,16 @@ export const VideoRenderer = ({
|
|
|
43
44
|
isParticipantVideoEnabled
|
|
44
45
|
} = useIncomingVideoSettings();
|
|
45
46
|
const callingState = useCallCallingState();
|
|
46
|
-
const pendingVideoLayoutRef = useRef();
|
|
47
|
-
const subscribedVideoLayoutRef = useRef();
|
|
47
|
+
const pendingVideoLayoutRef = useRef(undefined);
|
|
48
|
+
const subscribedVideoLayoutRef = useRef(undefined);
|
|
48
49
|
const {
|
|
49
50
|
direction
|
|
50
51
|
} = useCameraState();
|
|
52
|
+
const viewRef = useRef(null);
|
|
53
|
+
const {
|
|
54
|
+
register: registerIosScreenshot,
|
|
55
|
+
deregister: deregisterIosScreenshot
|
|
56
|
+
} = useScreenshotIosContext();
|
|
51
57
|
const videoDimensions = useTrackDimensions(participant, trackType);
|
|
52
58
|
const {
|
|
53
59
|
isLocalParticipant,
|
|
@@ -61,6 +67,14 @@ export const VideoRenderer = ({
|
|
|
61
67
|
const hasJoinedCall = callingState === CallingState.JOINED;
|
|
62
68
|
const videoStreamToRender = isScreenSharing ? screenShareStream : videoStream;
|
|
63
69
|
const canShowVideo = !!videoStreamToRender && isVisible && isPublishingVideoTrack && isParticipantVideoEnabled(participant.sessionId);
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
if (Platform.OS === 'ios' && registerIosScreenshot && viewRef.current && canShowVideo) {
|
|
72
|
+
registerIosScreenshot(participant, trackType, viewRef);
|
|
73
|
+
return () => {
|
|
74
|
+
deregisterIosScreenshot(participant, trackType);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}, [participant, trackType, registerIosScreenshot, canShowVideo, deregisterIosScreenshot]);
|
|
64
78
|
const mirror = isLocalParticipant && !isScreenSharing && direction === 'front';
|
|
65
79
|
|
|
66
80
|
/**
|
|
@@ -197,6 +211,7 @@ export const VideoRenderer = ({
|
|
|
197
211
|
style: [styles.videoStream, videoRenderer.videoStream],
|
|
198
212
|
streamURL: videoStreamToRender.toURL(),
|
|
199
213
|
mirror: mirror,
|
|
214
|
+
ref: viewRef,
|
|
200
215
|
objectFit: objectFit ?? (videoDimensions.width > videoDimensions.height ? 'contain' : 'cover'),
|
|
201
216
|
zOrder: videoZOrder
|
|
202
217
|
}) : ParticipantVideoFallback && /*#__PURE__*/React.createElement(ParticipantVideoFallback, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","StyleSheet","View","RTCView","CallingState","hasScreenShare","hasVideo","VisibilityState","useCall","useCallStateHooks","ParticipantVideoFallback","DefaultParticipantVideoFallback","useTheme","useTrackDimensions","DEFAULT_VIEWPORT_VISIBILITY_STATE","videoTrack","UNKNOWN","screenShareTrack","VideoRenderer","trackType","participant","isVisible","objectFit","videoZOrder","theme","videoRenderer","call","useCallCallingState","useCameraState","useIncomingVideoSettings","isParticipantVideoEnabled","callingState","pendingVideoLayoutRef","subscribedVideoLayoutRef","direction","videoDimensions","isLocalParticipant","sessionId","viewportVisibilityState","videoStream","screenShareStream","isScreenSharing","isPublishingVideoTrack","hasJoinedCall","JOINED","videoStreamToRender","canShowVideo","mirror","VISIBLE","state","updateParticipant","p","INVISIBLE","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","Platform","StyleSheet","View","RTCView","CallingState","hasScreenShare","hasVideo","VisibilityState","useCall","useCallStateHooks","ParticipantVideoFallback","DefaultParticipantVideoFallback","useTheme","useTrackDimensions","useScreenshotIosContext","DEFAULT_VIEWPORT_VISIBILITY_STATE","videoTrack","UNKNOWN","screenShareTrack","VideoRenderer","trackType","participant","isVisible","objectFit","videoZOrder","theme","videoRenderer","call","useCallCallingState","useCameraState","useIncomingVideoSettings","isParticipantVideoEnabled","callingState","pendingVideoLayoutRef","undefined","subscribedVideoLayoutRef","direction","viewRef","register","registerIosScreenshot","deregister","deregisterIosScreenshot","videoDimensions","isLocalParticipant","sessionId","viewportVisibilityState","videoStream","screenShareStream","isScreenSharing","isPublishingVideoTrack","hasJoinedCall","JOINED","videoStreamToRender","canShowVideo","OS","current","mirror","VISIBLE","state","updateParticipant","p","INVISIBLE","updateIsNeeded","dimension","updateParticipantTracks","dynascaleManager","applyTrackSubscriptions","onLayout","event","width","Math","trunc","nativeEvent","layout","height","createElement","style","styles","container","streamURL","toURL","ref","zOrder","create","absoluteFillObject"],"sourceRoot":"../../../../../src","sources":["components/Participant/ParticipantView/VideoRenderer.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,SAASC,OAAO,QAAQ,gCAAgC;AAExD,SACEC,YAAY,EACZC,c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rB,SAAS;EAC3C,CAAC;EAED,oBACErC,KAAA,CAAA8E,aAAA,CAACzE,IAAI;IACHiE,QAAQ,EAAEA,QAAS;IACnBS,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAEpD,aAAa,CAACoD,SAAS;EAAE,GAElDzB,YAAY,IAAID,mBAAmB,gBAClCvD,KAAA,CAAA8E,aAAA,CAACxE,OAAO;IACNyE,KAAK,EAAE,CAACC,MAAM,CAAC/B,WAAW,EAAEpB,aAAa,CAACoB,WAAW,CAAE;IACvDiC,SAAS,EAAE3B,mBAAmB,CAAC4B,KAAK,CAAC,CAAE;IACvCxB,MAAM,EAAEA,MAAO;IACfyB,GAAG,EAAE5C,OAAQ;IACbd,SAAS,EACPA,SAAS,KACRmB,eAAe,CAAC2B,KAAK,GAAG3B,eAAe,CAACgC,MAAM,GAC3C,SAAS,GACT,OAAO,CACZ;IACDQ,MAAM,EAAE1D;EAAY,CACrB,CAAC,GAEFd,wBAAwB,iBACtBb,KAAA,CAAA8E,aAAA,CAACjE,wBAAwB;IAACW,WAAW,EAAEA;EAAY,CAAE,CAGrD,CAAC;AAEX,CAAC;AAED,MAAMwD,MAAM,GAAG5E,UAAU,CAACkF,MAAM,CAAC;EAC/BL,SAAS,EAAE;IACT,GAAG7E,UAAU,CAACmF;EAChB,CAAC;EACDtC,WAAW,EAAE;IACX,GAAG7C,UAAU,CAACmF;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getLogger } from '@stream-io/video-client';
|
|
2
|
+
import React, { createContext, useContext, useCallback, useMemo } from 'react';
|
|
3
|
+
import { NativeModules, findNodeHandle, Platform } from 'react-native';
|
|
4
|
+
const {
|
|
5
|
+
StreamVideoReactNative
|
|
6
|
+
} = NativeModules;
|
|
7
|
+
// Create the context with a default undefined value
|
|
8
|
+
const ScreenshotIosContext = /*#__PURE__*/createContext(undefined);
|
|
9
|
+
const participantVideoViewRefMap = new Map();
|
|
10
|
+
export const ScreenshotIosContextProvider = ({
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
// Register a participant's RTCView ref
|
|
14
|
+
const register = useCallback((participant, videoTrackType, ref) => {
|
|
15
|
+
if (ref && participant.userId) {
|
|
16
|
+
participantVideoViewRefMap.set(`${participant.userId}-${videoTrackType}`, ref);
|
|
17
|
+
}
|
|
18
|
+
}, []);
|
|
19
|
+
const deregister = useCallback((participant, videoTrackType) => {
|
|
20
|
+
if (participant.userId) {
|
|
21
|
+
participantVideoViewRefMap.delete(`${participant.userId}-${videoTrackType}`);
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
// Take a snapshot of a specific participant's view
|
|
26
|
+
const take = useCallback(async (participant, videoTrackType) => {
|
|
27
|
+
try {
|
|
28
|
+
if (Platform.OS !== 'ios') {
|
|
29
|
+
throw new Error('ScreenshotIosContextProvider is only supported on iOS');
|
|
30
|
+
}
|
|
31
|
+
const ref = participantVideoViewRefMap.get(`${participant.userId}-${videoTrackType}`);
|
|
32
|
+
if (!ref || !ref.current) {
|
|
33
|
+
getLogger(['ScreenshotIosContextProvider'])('error', 'Cannot take snapshot: No registered view for this participant');
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Get the native handle for the view
|
|
38
|
+
const tag = findNodeHandle(ref.current);
|
|
39
|
+
if (!tag) {
|
|
40
|
+
getLogger(['ScreenshotIosContextProvider'])('error', 'Cannot take snapshot: Cannot get native handle for view');
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Take the snapshot using our native module
|
|
45
|
+
const base64Image = await StreamVideoReactNative.captureRef(tag, {});
|
|
46
|
+
return base64Image;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
getLogger(['ScreenshotIosContextProvider'])('error', 'Error taking participant snapshot:', error);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
52
|
+
const value = useMemo(() => ({
|
|
53
|
+
register,
|
|
54
|
+
deregister,
|
|
55
|
+
take
|
|
56
|
+
}), [register, deregister, take]);
|
|
57
|
+
return /*#__PURE__*/React.createElement(ScreenshotIosContext.Provider, {
|
|
58
|
+
value: value
|
|
59
|
+
}, children);
|
|
60
|
+
};
|
|
61
|
+
export const useScreenshotIosContext = () => {
|
|
62
|
+
const context = useContext(ScreenshotIosContext);
|
|
63
|
+
if (!context) {
|
|
64
|
+
throw new Error('useScreenshotIosContext must be used within a ScreenshotIosContextProvider');
|
|
65
|
+
}
|
|
66
|
+
return context;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=ScreenshotIosContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getLogger","React","createContext","useContext","useCallback","useMemo","NativeModules","findNodeHandle","Platform","StreamVideoReactNative","ScreenshotIosContext","undefined","participantVideoViewRefMap","Map","ScreenshotIosContextProvider","children","register","participant","videoTrackType","ref","userId","set","deregister","delete","take","OS","Error","get","current","tag","base64Image","captureRef","error","value","createElement","Provider","useScreenshotIosContext","context"],"sourceRoot":"../../../../src","sources":["contexts/internal/ScreenshotIosContext.tsx"],"mappings":"AAAA,SAGEA,SAAS,QACJ,yBAAyB;AAChC,OAAOC,KAAK,IACVC,aAAa,EACbC,UAAU,EAEVC,WAAW,EACXC,OAAO,QACF,OAAO;AACd,SAASC,aAAa,EAAEC,cAAc,EAAEC,QAAQ,QAAQ,cAAc;AAEtE,MAAM;EAAEC;AAAuB,CAAC,GAAGH,aAAa;AAkBhD;AACA,MAAMI,oBAAoB,gBAAGR,aAAa,CAExCS,SAAS,CAAC;AAEZ,MAAMC,0BAAuD,GAAG,IAAIC,GAAG,CAAC,CAAC;AAEzE,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EAC3CC;AAC2B,CAAC,KAAK;EACjC;EACA,MAAMC,QAAQ,GAAGZ,WAAW,CAC1B,CACEa,WAAmC,EACnCC,cAA8B,EAC9BC,GAAmB,K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CAAC,8BAA8B,CAAC,CAAC,CACzC,OAAO,EACP,oCAAoC,EACpCgC,KACF,CAAC;MACD,OAAO,IAAI;IACb;EACF,CAAC,EACD,EACF,CAAC;EAED,MAAMC,KAAK,GAAG5B,OAAO,CACnB,OAAO;IACLW,QAAQ;IACRM,UAAU;IACVE;EACF,CAAC,CAAC,EACF,CAACR,QAAQ,EAAEM,UAAU,EAAEE,IAAI,CAC7B,CAAC;EAED,oBACEvB,KAAA,CAAAiC,aAAA,CAACxB,oBAAoB,CAACyB,QAAQ;IAACF,KAAK,EAAEA;EAAM,GACzClB,QAC4B,CAAC;AAEpC,CAAC;AAED,OAAO,MAAMqB,uBAAuB,GAAGA,CAAA,KAAgC;EACrE,MAAMC,OAAO,GAAGlC,UAAU,CAACO,oBAAoB,CAAC;EAChD,IAAI,CAAC2B,OAAO,EAAE;IACZ,MAAM,IAAIX,KAAK,CACb,4EACF,CAAC;EACH;EACA,OAAOW,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,6BAA6B;AAC3C,cAAc,QAAQ;AACtB,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,sCAAsC;AACpD,cAAc,wBAAwB;AACtC,cAAc,sBAAsB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["hooks/index.ts"],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,6BAA6B;AAC3C,cAAc,QAAQ;AACtB,cAAc,iCAAiC;AAC/C,cAAc,uCAAuC;AACrD,cAAc,kBAAkB;AAChC,cAAc,yBAAyB;AACvC,cAAc,sCAAsC;AACpD,cAAc,wBAAwB;AACtC,cAAc,sBAAsB;AACpC,cAAc,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useScreenshotIosContext } from '../contexts/internal/ScreenshotIosContext';
|
|
3
|
+
import { NativeModules, Platform } from 'react-native';
|
|
4
|
+
import { getLogger } from '@stream-io/video-client';
|
|
5
|
+
const {
|
|
6
|
+
StreamVideoReactNative
|
|
7
|
+
} = NativeModules;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Hook that provides functionality to take screenshots of participant video streams.
|
|
11
|
+
*
|
|
12
|
+
* @returns An object containing the `takeScreenShot` function that captures a participant's video.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export function useScreenshot() {
|
|
16
|
+
const {
|
|
17
|
+
take
|
|
18
|
+
} = useScreenshotIosContext();
|
|
19
|
+
const takeScreenshot = useCallback(async (participant, videoTrackType) => {
|
|
20
|
+
if (Platform.OS === 'android') {
|
|
21
|
+
const {
|
|
22
|
+
videoStream,
|
|
23
|
+
screenShareStream
|
|
24
|
+
} = participant;
|
|
25
|
+
const videoStreamForScreenshot = videoTrackType === 'screenShareTrack' ? screenShareStream : videoStream;
|
|
26
|
+
if (videoStreamForScreenshot) {
|
|
27
|
+
try {
|
|
28
|
+
return await StreamVideoReactNative.takeScreenshot(videoStreamForScreenshot.toURL());
|
|
29
|
+
} catch (error) {
|
|
30
|
+
getLogger(['useScreenshot'])('error', 'Error taking screenshot', error);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return null;
|
|
35
|
+
} else {
|
|
36
|
+
try {
|
|
37
|
+
return await take(participant, videoTrackType);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
getLogger(['useScreenshot'])('error', 'Error taking screenshot', error);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, [take]);
|
|
44
|
+
return {
|
|
45
|
+
takeScreenshot
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=useScreenshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useScreenshotIosContext","NativeModules","Platform","getLogger","StreamVideoReactNative","useScreenshot","take","takeScreenshot","participant","videoTrackType","OS","videoStream","screenShareStream","videoStreamForScreenshot","toURL","error"],"sourceRoot":"../../../src","sources":["hooks/useScreenshot.ts"],"mappings":"AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,uBAAuB,QAAQ,2CAA2C;AACnF,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,SAEEC,SAAS,QAEJ,yBAAyB;AAEhC,MAAM;EAAEC;AAAuB,CAAC,GAAGH,aAAa;;AAEhD;AACA;AACA;AACA;AACA;;AAeA,OAAO,SAASI,aAAaA,CAAA,EAAwB;EACnD,MAAM;IAAEC;EAAK,CAAC,GAAGN,uBAAuB,CAAC,CAAC;EAC1C,MAAMO,cAAc,GAAGR,WAAW,CAChC,OACES,WAAmC,EACnCC,cAA8B,KAC3B;IACH,IAAIP,QAAQ,CAACQ,EAAE,KAAK,SAAS,EAAE;MAC7B,MAAM;QAAEC,WAAW;QAAEC;MAAkB,CAAC,GAAGJ,WAAW;MAEtD,MAAMK,wBAAwB,GAAIJ,cAAc,KAAK,kBAAkB,GACnEG,iBAAiB,GACjBD,WAAkD;MAEtD,IAAIE,wBAAwB,EAAE;QAC5B,IAAI;UACF,OAAO,MAAMT,sBAAsB,CAACG,cAAc,CAChDM,wBAAwB,CAACC,KAAK,CAAC,CACjC,CAAC;QACH,CAAC,CAAC,OAAOC,KAAK,EAAE;UACdZ,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAC1B,OAAO,EACP,yBAAyB,EACzBY,KACF,CAAC;UACD,OAAO,IAAI;QACb;MACF;MACA,OAAO,IAAI;IACb,CAAC,MAAM;MACL,IAAI;QACF,OAAO,MAAMT,IAAI,CAACE,WAAW,EAAEC,cAAc,CAAC;MAChD,CAAC,CAAC,OAAOM,KAAK,EAAE;QACdZ,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAC1B,OAAO,EACP,yBAAyB,EACzBY,KACF,CAAC;QACD,OAAO,IAAI;MACb;IACF;EACF,CAAC,EACD,CAACT,IAAI,CACP,CAAC;EAED,OAAO;IAAEC;EAAe,CAAC;AAC3B","ignoreList":[]}
|
|
@@ -5,6 +5,8 @@ import NetInfo from '@react-native-community/netinfo';
|
|
|
5
5
|
import { usePushRegisterEffect } from '../hooks';
|
|
6
6
|
import { translations } from '../translations';
|
|
7
7
|
import { StreamTheme } from '../contexts/ThemeContext';
|
|
8
|
+
import { ScreenshotIosContextProvider } from '../contexts/internal/ScreenshotIosContext';
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
*
|
|
10
12
|
* @param props
|
|
@@ -50,7 +52,7 @@ export const StreamVideo = props => {
|
|
|
50
52
|
i18nInstance: i18nInstance
|
|
51
53
|
}, /*#__PURE__*/React.createElement(StreamTheme, {
|
|
52
54
|
style: style
|
|
53
|
-
}, /*#__PURE__*/React.createElement(StreamVideoStoreProvider, null, /*#__PURE__*/React.createElement(PushRegister, null), children)));
|
|
55
|
+
}, /*#__PURE__*/React.createElement(StreamVideoStoreProvider, null, /*#__PURE__*/React.createElement(ScreenshotIosContextProvider, null, /*#__PURE__*/React.createElement(PushRegister, null), children))));
|
|
54
56
|
};
|
|
55
57
|
|
|
56
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StreamVideoProvider","React","useEffect","StreamVideoStoreProvider","NetInfo","usePushRegisterEffect","translations","StreamTheme","StreamVideo","props","client","children","translationsOverrides","i18nInstance","language","style","prevIsOnline","addEventListener","state","isConnected","isInternetReachable","isOnline","type","streamClient","updateNetworkConnectionStatus","createElement","PushRegister"],"sourceRoot":"../../../src","sources":["providers/StreamVideo.tsx"],"mappings":"AAAA,SAGEA,mBAAmB,QACd,iCAAiC;AACxC,OAAOC,KAAK,IAA4BC,SAAS,QAAQ,OAAO;AAChE,SAASC,wBAAwB,QAAQ,gCAAgC;AACzE,OAAOC,OAAO,MAAM,iCAAiC;AACrD,SAASC,qBAAqB,QAAQ,UAAU;AAChD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAA2BC,WAAW,QAAQ,0BAA0B;
|
|
1
|
+
{"version":3,"names":["StreamVideoProvider","React","useEffect","StreamVideoStoreProvider","NetInfo","usePushRegisterEffect","translations","StreamTheme","ScreenshotIosContextProvider","StreamVideo","props","client","children","translationsOverrides","i18nInstance","language","style","prevIsOnline","addEventListener","state","isConnected","isInternetReachable","isOnline","type","streamClient","updateNetworkConnectionStatus","createElement","PushRegister"],"sourceRoot":"../../../src","sources":["providers/StreamVideo.tsx"],"mappings":"AAAA,SAGEA,mBAAmB,QACd,iCAAiC;AACxC,OAAOC,KAAK,IAA4BC,SAAS,QAAQ,OAAO;AAChE,SAASC,wBAAwB,QAAQ,gCAAgC;AACzE,OAAOC,OAAO,MAAM,iCAAiC;AACrD,SAASC,qBAAqB,QAAQ,UAAU;AAChD,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAA2BC,WAAW,QAAQ,0BAA0B;AAExE,SAASC,4BAA4B,QAAQ,2CAA2C;;AAExF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GACtBC,KAKC,IACE;EACH,MAAM;IACJC,MAAM;IACNC,QAAQ;IACRC,qBAAqB,GAAGP,YAAY;IACpCQ,YAAY;IACZC,QAAQ;IACRC;EACF,CAAC,GAAGN,KAAK;;EAET;AACF;AACA;EACER,SAAS,CAAC,MAAM;IACd,IAAIe,YAAY,GAAG,IAAI;IACvB,OAAOb,OAAO,CAACc,gBAAgB,CAAEC,KAAK,IAAK;MACzC,MAAM;QAAEC,WAAW;QAAEC;MAAoB,CAAC,GAAGF,KAAK;MAClD,MAAMG,QAAQ,GAAGF,WAAW,KAAK,IAAI,IAAIC,mBAAmB,KAAK,KAAK;MACtE,IAAIC,QAAQ,KAAKL,YAAY,EAAE;QAC7B;MACF;MACAA,YAAY,GAAGK,QAAQ;MACvB,MAAMC,IAAI,GAAGD,QAAQ,GAAG,QAAQ,GAAG,SAAS;MAC5CX,MAAM,CAACa,YAAY,CAACC,6BAA6B,CAAC;QAAEF;MAAK,CAAC,CAAC;IAC7D,CAAC,CAAC;EACJ,CAAC,EAAE,CAACZ,MAAM,CAAC,CAAC;EAEZ,oBACEV,KAAA,CAAAyB,aAAA,CAAC1B,mBAAmB;IAClBW,MAAM,EAAEA,MAAO;IACfI,QAAQ,EAAEA,QAAS;IACnBF,qBAAqB,EAAEA,qBAAsB;IAC7CC,YAAY,EAAEA;EAAa,gBAE3Bb,KAAA,CAAAyB,aAAA,CAACnB,WAAW;IAACS,KAAK,EAAEA;EAAM,gBACxBf,KAAA,CAAAyB,aAAA,CAACvB,wBAAwB,qBACvBF,KAAA,CAAAyB,aAAA,CAAClB,4BAA4B,qBAC3BP,KAAA,CAAAyB,aAAA,CAACC,YAAY,MAAE,CAAC,EACff,QAC2B,CACN,CACf,CACM,CAAC;AAE1B,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMe,YAAY,GAAGA,CAAA,KAAM;EACzBtB,qBAAqB,CAAC,CAAC;EACvB,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '1.
|
|
1
|
+
export const version = '1.13.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
export declare function onNativeCallClosed(reactTag: number): void;
|
|
3
3
|
/** Wrapper for the native view
|
|
4
4
|
* meant to stay private and not exposed */
|
|
5
|
-
export declare const RTCViewPipNative: React.
|
|
5
|
+
export declare const RTCViewPipNative: React.NamedExoticComponent<{
|
|
6
6
|
streamURL?: string;
|
|
7
|
-
} & React.RefAttributes<React.Ref<any
|
|
7
|
+
} & React.RefAttributes<React.Ref<any>>>;
|
|
8
8
|
//# sourceMappingURL=RTCViewPipNative.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,QAOlD;AAED;2CAC2C;AAC3C,eAAO,MAAM,gBAAgB;gBAIX,MAAM;
|
|
1
|
+
{"version":3,"file":"RTCViewPipNative.d.ts","sourceRoot":"","sources":["../../../../../src/components/Call/CallContent/RTCViewPipNative.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAkB1B,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,QAOlD;AAED;2CAC2C;AAC3C,eAAO,MAAM,gBAAgB;gBAIX,MAAM;wCAgBvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Participant/ParticipantView/VideoRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"VideoRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Participant/ParticipantView/VideoRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAuB9D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,oBAAoB,EAClB,0BAA0B,GAC1B,WAAW,GACX,aAAa,GACb,WAAW,GACX,WAAW,GACX,aAAa,CAChB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,0FAO3B,kBAAkB,sBAmQpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StreamVideoParticipant, type VideoTrackType } from '@stream-io/video-client';
|
|
2
|
+
import React, { RefObject } from 'react';
|
|
3
|
+
type ScreenshotIosContextType = {
|
|
4
|
+
register: (participant: StreamVideoParticipant, videoTrackType: VideoTrackType, ref: RefObject<any>) => void;
|
|
5
|
+
deregister: (participant: StreamVideoParticipant, videoTrackType: VideoTrackType) => void;
|
|
6
|
+
take: (participant: StreamVideoParticipant, videoTrackType: VideoTrackType) => Promise<string | null>;
|
|
7
|
+
};
|
|
8
|
+
export declare const ScreenshotIosContextProvider: ({ children, }: React.PropsWithChildren<{}>) => React.JSX.Element;
|
|
9
|
+
export declare const useScreenshotIosContext: () => ScreenshotIosContextType;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ScreenshotIosContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenshotIosContext.d.ts","sourceRoot":"","sources":["../../../../src/contexts/internal/ScreenshotIosContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,cAAc,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,EAGZ,SAAS,EAGV,MAAM,OAAO,CAAC;AAKf,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,CACR,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,KAChB,IAAI,CAAC;IACV,UAAU,EAAE,CACV,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,cAAc,KAC3B,IAAI,CAAC;IACV,IAAI,EAAE,CACJ,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,cAAc,KAC3B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7B,CAAC;AASF,eAAO,MAAM,4BAA4B,GAAI,eAE1C,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,sBA6F7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,wBAQ1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,QAAQ,CAAC;AACvB,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StreamVideoParticipant, type VideoTrackType } from '@stream-io/video-client';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that provides functionality to take screenshots of participant video streams.
|
|
4
|
+
*
|
|
5
|
+
* @returns An object containing the `takeScreenShot` function that captures a participant's video.
|
|
6
|
+
*/
|
|
7
|
+
type UseScreenshotResult = {
|
|
8
|
+
/**
|
|
9
|
+
* Takes a screenshot of a participant's video stream.
|
|
10
|
+
*
|
|
11
|
+
* @param participant - The participant whose video stream to capture
|
|
12
|
+
* @param videoTrackType - The type of video track to capture ('videoTrack' or 'screenShareTrack')
|
|
13
|
+
* @returns A Promise that resolves to a base64-encoded png image string or null if the screenshot fails
|
|
14
|
+
*/
|
|
15
|
+
takeScreenshot: (participant: StreamVideoParticipant, videoTrackType: VideoTrackType) => Promise<string | null>;
|
|
16
|
+
};
|
|
17
|
+
export declare function useScreenshot(): UseScreenshotResult;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=useScreenshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScreenshot.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScreenshot.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,sBAAsB,EAEtB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAIjC;;;;GAIG;AACH,KAAK,mBAAmB,GAAG;IACzB;;;;;;OAMG;IACH,cAAc,EAAE,CACd,WAAW,EAAE,sBAAsB,EACnC,cAAc,EAAE,cAAc,KAC3B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7B,CAAC;AAEF,wBAAgB,aAAa,IAAI,mBAAmB,CA8CnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamVideo.d.ts","sourceRoot":"","sources":["../../../src/providers/StreamVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"StreamVideo.d.ts","sourceRoot":"","sources":["../../../src/providers/StreamVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAa,MAAM,OAAO,CAAC;AAKjE,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,iBAAiB,CACtB,gBAAgB,GACd,uBAAuB,GAAG;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;CAC5B,CACJ,sBA6CF,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.
|
|
1
|
+
export declare const version = "1.13.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default =
|
|
4
|
-
function
|
|
3
|
+
exports.default = addNewLinesToAppDelegateObjc;
|
|
4
|
+
function addNewLinesToAppDelegateObjc(content, toAdd) {
|
|
5
5
|
const lines = content.split('\n');
|
|
6
6
|
let lineIndex = lines.findIndex((line) => line.match('@end'));
|
|
7
7
|
if (lineIndex < 0) {
|
|
8
|
-
throw Error('Malformed app delegate');
|
|
8
|
+
throw Error('Malformed app delegate (objc)');
|
|
9
9
|
}
|
|
10
10
|
toAdd.unshift('');
|
|
11
11
|
lineIndex -= 1;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.addToSwiftBridgingHeaderFile = addToSwiftBridgingHeaderFile;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
function findBridgingHeaderName(dir) {
|
|
10
|
+
const files = fs_1.default.readdirSync(dir);
|
|
11
|
+
for (const file of files) {
|
|
12
|
+
const fullPath = path_1.default.join(dir, file);
|
|
13
|
+
const stat = fs_1.default.statSync(fullPath);
|
|
14
|
+
if (stat.isDirectory()) {
|
|
15
|
+
const result = findBridgingHeaderName(fullPath);
|
|
16
|
+
if (result)
|
|
17
|
+
return result; // Return if found in subdirectory
|
|
18
|
+
}
|
|
19
|
+
else if (file.endsWith('.pbxproj')) {
|
|
20
|
+
const content = fs_1.default.readFileSync(fullPath, 'utf8');
|
|
21
|
+
const match = content.match(/SWIFT_OBJC_BRIDGING_HEADER\s*=\s*(.*?);/);
|
|
22
|
+
if (match && match[1]) {
|
|
23
|
+
return match[1].trim();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null; // Not found
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Adds contents to the Swift bridging header file.
|
|
31
|
+
* @param projectRoot The root directory of the project.
|
|
32
|
+
* @param action The function to add the contents the bridging header file.
|
|
33
|
+
*/
|
|
34
|
+
async function addToSwiftBridgingHeaderFile(projectRoot, action) {
|
|
35
|
+
const bridgingHeaderFileName = findBridgingHeaderName(projectRoot);
|
|
36
|
+
if (!bridgingHeaderFileName) {
|
|
37
|
+
console.error('No bridging header found.');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const bridgingHeaderFullPath = path_1.default.resolve(projectRoot, `ios/${bridgingHeaderFileName.replace(/['"]/g, '')}`);
|
|
41
|
+
if (!fs_1.default.existsSync(bridgingHeaderFullPath)) {
|
|
42
|
+
console.error(`File not found at: ${bridgingHeaderFullPath}`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const headerFileContents = await fs_1.default.promises.readFile(bridgingHeaderFullPath, 'utf8');
|
|
46
|
+
const newHeaderFileContents = action(headerFileContents);
|
|
47
|
+
await fs_1.default.promises.writeFile(bridgingHeaderFullPath, newHeaderFileContents);
|
|
48
|
+
}
|