@hortemo/expo-photos 10.0.0 → 12.0.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/build/ExpoPhotos.types.d.ts +7 -0
- package/build/ExpoPhotos.types.d.ts.map +1 -1
- package/build/ExpoPhotos.types.js.map +1 -1
- package/build/PHImage.d.ts +2 -2
- package/build/PHImage.d.ts.map +1 -1
- package/build/PHImage.js.map +1 -1
- package/build/PHVideo.d.ts +2 -2
- package/build/PHVideo.d.ts.map +1 -1
- package/build/PHVideo.js.map +1 -1
- package/ios/ExpoPhotosModule.swift +25 -29
- package/ios/PHVideoView.swift +1 -2
- package/package.json +2 -5
- package/src/ExpoPhotos.types.ts +7 -0
- package/src/PHImage.tsx +1 -1
- package/src/PHVideo.tsx +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface PHAsset {
|
|
2
2
|
localIdentifier: string;
|
|
3
|
+
/** Milliseconds since 1970. */
|
|
3
4
|
creationDate: number;
|
|
4
5
|
mediaType: PHAssetMediaType;
|
|
5
6
|
mediaSubtypes: PHAssetMediaSubtype;
|
|
7
|
+
/** Milliseconds. */
|
|
6
8
|
duration: number;
|
|
7
9
|
pixelWidth: number;
|
|
8
10
|
pixelHeight: number;
|
|
@@ -101,7 +103,9 @@ export interface PHVideoRequestOptions {
|
|
|
101
103
|
deliveryMode?: PHVideoRequestOptionsDeliveryMode;
|
|
102
104
|
}
|
|
103
105
|
export interface CMTimeRange {
|
|
106
|
+
/** Milliseconds. */
|
|
104
107
|
start: number;
|
|
108
|
+
/** Milliseconds. */
|
|
105
109
|
duration: number;
|
|
106
110
|
}
|
|
107
111
|
export declare enum AVFileType {
|
|
@@ -171,6 +175,7 @@ export interface RequestImageOptions extends PHImageRequestOptions, SDImageCoder
|
|
|
171
175
|
targetSize: RequestImageTargetSize;
|
|
172
176
|
contentMode: PHImageContentMode;
|
|
173
177
|
outputURL?: string;
|
|
178
|
+
/** Milliseconds until the request is cancelled. */
|
|
174
179
|
timeout?: number;
|
|
175
180
|
}
|
|
176
181
|
export interface RequestImageResult {
|
|
@@ -181,6 +186,7 @@ export interface RequestImageResult {
|
|
|
181
186
|
export interface RequestVideoOptions extends PHVideoRequestOptions, AVAssetExportSessionOptions {
|
|
182
187
|
localIdentifier: string;
|
|
183
188
|
exportPreset: AVAssetExportPreset;
|
|
189
|
+
/** Milliseconds until the request is cancelled. */
|
|
184
190
|
timeout?: number;
|
|
185
191
|
}
|
|
186
192
|
export declare enum PHPickerFilter {
|
|
@@ -193,6 +199,7 @@ export interface PickAssetsOptions {
|
|
|
193
199
|
selectionLimit?: number;
|
|
194
200
|
}
|
|
195
201
|
export interface PHVideoLoadEvent {
|
|
202
|
+
/** Milliseconds. */
|
|
196
203
|
duration: number;
|
|
197
204
|
naturalSize: {
|
|
198
205
|
width: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoPhotos.types.d.ts","sourceRoot":"","sources":["../src/ExpoPhotos.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,aAAa,EAAE,mBAAmB,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,oBAAY,qBAAqB;IAC/B,aAAa,IAAI;IACjB,UAAU,IAAI;IACd,MAAM,IAAI;IACV,UAAU,IAAI;IACd,OAAO,IAAI;CACZ;AAED,oBAAY,aAAa;IACvB,OAAO,IAAI;IACX,SAAS,IAAI;CACd;AAED,oBAAY,gBAAgB;IAC1B,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;IACT,KAAK,IAAI;CACV;AAED,oBAAY,mBAAmB;IAC7B,IAAI,IAAI;IACR,aAAa,IAAS;IACtB,QAAQ,I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ourceRoot":"","sources":["../src/ExpoPhotos.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpoPhotos.types.js","sourceRoot":"","sources":["../src/ExpoPhotos.types.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC/B,mFAAiB,CAAA;IACjB,6EAAc,CAAA;IACd,qEAAU,CAAA;IACV,6EAAc,CAAA;IACd,uEAAW,CAAA;AACb,CAAC,EANW,qBAAqB,KAArB,qBAAqB,QAMhC;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,uDAAW,CAAA;IACX,2DAAa,CAAA;AACf,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,6DAAW,CAAA;IACX,yDAAS,CAAA;IACT,yDAAS,CAAA;IACT,yDAAS,CAAA;AACX,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B;AAED,MAAM,CAAN,IAAY,mBAWX;AAXD,WAAY,mBAAmB;IAC7B,6DAAQ,CAAA;IACR,+EAAsB,CAAA;IACtB,qEAAiB,CAAA;IACjB,mFAAwB,CAAA;IACxB,uEAAkB,CAAA;IAClB,sFAAyB,CAAA;IACzB,mFAAuB,CAAA;IACvB,8FAA4B,CAAA;IAC5B,sFAAwB,CAAA;IACxB,sFAAwB,CAAA;AAC1B,CAAC,EAXW,mBAAmB,KAAnB,mBAAmB,QAW9B;AAwBD,MAAM,CAAN,IAAY,+BAIX;AAJD,WAAY,+BAA+B;IACzC,qFAAQ,CAAA;IACR,qFAAQ,CAAA;IACR,uFAAS,CAAA;AACX,CAAC,EAJW,+BAA+B,KAA/B,+BAA+B,QAI1C;AAED,MAAM,CAAN,IAAY,iCAIX;AAJD,WAAY,iCAAiC;IAC3C,2GAAiB,CAAA;IACjB,mHAAqB,CAAA;IACrB,qGAAc,CAAA;AAChB,CAAC,EAJW,iCAAiC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CAAA;AACtC,CAAC,EAzBW,UAAU,KAAV,UAAU,QAyBrB;AAED,MAAM,CAAN,IAAY,mBA6BX;AA7BD,WAAY,mBAAmB;IAC7B,mEAA4C,CAAA;IAC5C,yEAAkD,CAAA;IAClD,2EAAoD,CAAA;IACpD,mFAA4D,CAAA;IAC5D,qGAA8E,CAAA;IAC9E,gEAAyC,CAAA;IACzC,gEAAyC,CAAA;IACzC,kEAA2C,CAAA;IAC3C,oEAA6C,CAAA;IAC7C,oEAA6C,CAAA;IAC7C,yEAAkD,CAAA;IAClD,yEAAkD,CAAA;IAClD,2FAAoE,CAAA;IACpE,2FAAoE,CAAA;IACpE,yEAAkD,CAAA;IAClD,yEAAkD,CAAA;IAClD,6EAAsD,CAAA;IACtD,2EAAoD,CAAA;IACpD,2EAAoD,CAAA;IACpD,6EAAsD,CAAA;IACtD,uEAAgD,CAAA;IAChD,6EAAsD,CAAA;IACtD,+EAAwD,CAAA;IACxD,uEAAgD,CAAA;IAChD,mFAA4D,CAAA;IAC5D,qFAA8D,CAAA;IAC9D,qEAA8C,CAAA;IAC9C,+DAAwC,CAAA;AAC1C,CAAC,EA7BW,mBAAmB,KAAnB,mBAAmB,QA6B9B;AAiCD,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,6BAAW,CAAA;AACb,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB","sourcesContent":["export interface PHAsset {\n localIdentifier: string;\n /** Milliseconds since 1970. */\n creationDate: number;\n mediaType: PHAssetMediaType;\n mediaSubtypes: PHAssetMediaSubtype;\n /** Milliseconds. */\n duration: number;\n pixelWidth: number;\n pixelHeight: number;\n}\n\nexport enum PHAuthorizationStatus {\n notDetermined = 0,\n restricted = 1,\n denied = 2,\n authorized = 3,\n limited = 4,\n}\n\nexport enum PHAccessLevel {\n addOnly = 1,\n readWrite = 2,\n}\n\nexport enum PHAssetMediaType {\n unknown = 0,\n image = 1,\n video = 2,\n audio = 3,\n}\n\nexport enum PHAssetMediaSubtype {\n none = 0,\n photoPanorama = 1 << 0,\n photoHDR = 1 << 1,\n photoScreenshot = 1 << 2,\n photoLive = 1 << 3,\n photoDepthEffect = 1 << 4,\n videoStreamed = 1 << 16,\n videoHighFrameRate = 1 << 17,\n videoTimelapse = 1 << 18,\n videoCinematic = 1 << 19,\n}\n\nexport interface NSSortDescriptor {\n key: string;\n ascending: boolean;\n}\n\nexport interface PHFetchOptions {\n predicate?: string;\n fetchLimit?: number;\n sortDescriptors?: NSSortDescriptor[];\n}\n\nexport type FetchAssetsOptions = PHFetchOptions;\n\nexport interface CGSize {\n width: number;\n height: number;\n}\n\nexport type PHImageManagerMaximumSize = \"PHImageManagerMaximumSize\";\n\nexport type RequestImageTargetSize = CGSize | PHImageManagerMaximumSize;\n\nexport enum PHImageRequestOptionsResizeMode {\n none = 0,\n fast = 1,\n exact = 2,\n}\n\nexport enum PHImageRequestOptionsDeliveryMode {\n opportunistic = 0,\n highQualityFormat = 1,\n fastFormat = 2,\n}\n\nexport enum PHImageContentMode {\n aspectFit = 0,\n aspectFill = 1,\n}\n\nexport enum UIViewContentMode {\n scaleToFill = 0,\n scaleAspectFit = 1,\n scaleAspectFill = 2,\n redraw = 3,\n center = 4,\n top = 5,\n bottom = 6,\n left = 7,\n right = 8,\n topLeft = 9,\n topRight = 10,\n bottomLeft = 11,\n bottomRight = 12,\n}\nexport interface PHImageRequestOptions {\n isNetworkAccessAllowed?: boolean;\n resizeMode?: PHImageRequestOptionsResizeMode;\n deliveryMode?: PHImageRequestOptionsDeliveryMode;\n}\n\nexport interface SDImageCoderOptions {\n encodeCompressionQuality?: number;\n encodeMaxFileSize?: number;\n}\n\nexport enum PHVideoRequestOptionsDeliveryMode {\n automatic = 0,\n highQualityFormat = 1,\n mediumQualityFormat = 2,\n fastFormat = 3,\n}\n\nexport interface PHVideoRequestOptions {\n isNetworkAccessAllowed?: boolean;\n deliveryMode?: PHVideoRequestOptionsDeliveryMode;\n}\n\nexport interface CMTimeRange {\n /** Milliseconds. */\n start: number;\n /** Milliseconds. */\n duration: number;\n}\n\nexport enum AVFileType {\n ac3 = \"public.ac3-audio\",\n aifc = \"public.aifc-audio\",\n aiff = \"public.aiff-audio\",\n AHAP = \"com.apple.itt\",\n amr = \"org.3gpp.adaptive-multi-rate-audio\",\n appleiTT = \"com.apple.itt\",\n au = \"public.au-audio\",\n avci = \"public.avci\",\n caf = \"com.apple.coreaudio-format\",\n dng = \"com.adobe.raw-image\",\n eac3 = \"public.eac3-audio\",\n heic = \"public.heic\",\n heif = \"public.heif\",\n jpg = \"public.jpeg\",\n m4a = \"com.apple.m4a-audio\",\n m4v = \"com.apple.m4v-video\",\n mobile3GPP = \"public.3gpp\",\n mobile3GPP2 = \"public.3gpp2\",\n mov = \"com.apple.quicktime-movie\",\n mp3 = \"public.mp3\",\n mp4 = \"public.mpeg-4\",\n SCC = \"com.scenarist.cc\",\n tif = \"public.tiff\",\n wav = \"com.microsoft.waveform-audio\",\n}\n\nexport enum AVAssetExportPreset {\n LowQuality = \"AVAssetExportPresetLowQuality\",\n MediumQuality = \"AVAssetExportPresetMediumQuality\",\n HighestQuality = \"AVAssetExportPresetHighestQuality\",\n HEVCHighestQuality = \"AVAssetExportPresetHEVCHighestQuality\",\n HEVCHighestQualityWithAlpha = \"AVAssetExportPresetHEVCHighestQualityWithAlpha\",\n AVC640x480 = \"AVAssetExportPreset640x480\",\n AVC960x540 = \"AVAssetExportPreset960x540\",\n AVC1280x720 = \"AVAssetExportPreset1280x720\",\n AVC1920x1080 = \"AVAssetExportPreset1920x1080\",\n AVC3840x2160 = \"AVAssetExportPreset3840x2160\",\n HEVC1920x1080 = \"AVAssetExportPresetHEVC1920x1080\",\n HEVC3840x2160 = \"AVAssetExportPresetHEVC3840x2160\",\n HEVC1920x1080WithAlpha = \"AVAssetExportPresetHEVC1920x1080WithAlpha\",\n HEVC3840x2160WithAlpha = \"AVAssetExportPresetHEVC3840x2160WithAlpha\",\n HEVC7680x4320 = \"AVAssetExportPresetHEVC7680x4320\",\n MVHEVC960x960 = \"AVAssetExportPresetMVHEVC960x960\",\n MVHEVC1440x1440 = \"AVAssetExportPresetMVHEVC1440x1440\",\n AppleM4V480pSD = \"AVAssetExportPresetAppleM4V480pSD\",\n AppleM4V720pHD = \"AVAssetExportPresetAppleM4V720pHD\",\n AppleM4V1080pHD = \"AVAssetExportPresetAppleM4V1080pHD\",\n AppleM4ViPod = \"AVAssetExportPresetAppleM4ViPod\",\n AppleM4VAppleTV = \"AVAssetExportPresetAppleM4VAppleTV\",\n AppleM4VCellular = \"AVAssetExportPresetAppleM4VCellular\",\n AppleM4VWiFi = \"AVAssetExportPresetAppleM4VWiFi\",\n AppleProRes422LPCM = \"AVAssetExportPresetAppleProRes422LPCM\",\n AppleProRes4444LPCM = \"AVAssetExportPresetAppleProRes4444LPCM\",\n Passthrough = \"AVAssetExportPresetPassthrough\",\n AppleM4A = \"AVAssetExportPresetAppleM4A\",\n}\n\nexport interface AVAssetExportSessionOptions {\n outputURL: string;\n outputFileType?: AVFileType;\n fileLengthLimit?: number;\n timeRange?: CMTimeRange;\n}\n\nexport interface RequestImageOptions\n extends PHImageRequestOptions, SDImageCoderOptions {\n localIdentifier: string;\n targetSize: RequestImageTargetSize;\n contentMode: PHImageContentMode;\n outputURL?: string;\n /** Milliseconds until the request is cancelled. */\n timeout?: number;\n}\n\nexport interface RequestImageResult {\n size: CGSize;\n scale: number;\n imageOrientation: number;\n}\n\nexport interface RequestVideoOptions\n extends PHVideoRequestOptions, AVAssetExportSessionOptions {\n localIdentifier: string;\n exportPreset: AVAssetExportPreset;\n /** Milliseconds until the request is cancelled. */\n timeout?: number;\n}\n\nexport enum PHPickerFilter {\n images = \"images\",\n videos = \"videos\",\n any = \"any\",\n}\n\nexport interface PickAssetsOptions {\n filter?: PHPickerFilter;\n selectionLimit?: number;\n}\n\nexport interface PHVideoLoadEvent {\n /** Milliseconds. */\n duration: number;\n naturalSize: { width: number; height: number };\n}\n\nexport interface PHVideoErrorEvent {\n message: string;\n}\n"]}
|
package/build/PHImage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViewProps } from "react-native";
|
|
1
|
+
import type { ViewProps } from "react-native";
|
|
2
2
|
import { PHImageContentMode, PHImageRequestOptions, RequestImageTargetSize, UIViewContentMode } from "./ExpoPhotos.types";
|
|
3
3
|
export interface PHImageLoadEvent {
|
|
4
4
|
size: {
|
|
@@ -25,5 +25,5 @@ export interface PHImageViewProps extends ViewProps {
|
|
|
25
25
|
nativeEvent: PHImageErrorEvent;
|
|
26
26
|
}) => void;
|
|
27
27
|
}
|
|
28
|
-
export declare function PHImageView({ requestOptions, contentMode, ...rest }: PHImageViewProps):
|
|
28
|
+
export declare function PHImageView({ requestOptions, contentMode, ...rest }: PHImageViewProps): any;
|
|
29
29
|
//# sourceMappingURL=PHImage.d.ts.map
|
package/build/PHImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PHImage.d.ts","sourceRoot":"","sources":["../src/PHImage.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"PHImage.d.ts","sourceRoot":"","sources":["../src/PHImage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;I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":["import { requireNativeViewManager } from \"expo-modules-core\";\nimport { ViewProps } from \"react-native\";\nimport {\n PHImageContentMode,\n PHImageRequestOptions,\n RequestImageTargetSize,\n UIViewContentMode,\n} from \"./ExpoPhotos.types\";\n\nexport interface PHImageLoadEvent {\n size: { width: number; height: number };\n scale: number;\n}\n\nexport interface PHImageErrorEvent {\n message: string;\n}\n\nexport interface PHImageViewRequestOptions extends PHImageRequestOptions {\n contentMode?: PHImageContentMode;\n targetSize?: RequestImageTargetSize;\n}\n\nexport interface PHImageViewProps extends ViewProps {\n localIdentifier: string;\n contentMode?: UIViewContentMode;\n requestOptions?: PHImageViewRequestOptions;\n onLoad?: (event: { nativeEvent: PHImageLoadEvent }) => void;\n onError?: (event: { nativeEvent: PHImageErrorEvent }) => void;\n}\n\nconst NativePHImageView = requireNativeViewManager(\"ExpoPhotos\", \"PHImageView\");\n\nexport function PHImageView({\n requestOptions,\n contentMode,\n ...rest\n}: PHImageViewProps) {\n return (\n <NativePHImageView\n viewContentMode={contentMode}\n requestContentMode={requestOptions?.contentMode}\n isNetworkAccessAllowed={requestOptions?.isNetworkAccessAllowed}\n deliveryMode={requestOptions?.deliveryMode}\n resizeMode={requestOptions?.resizeMode}\n targetSize={requestOptions?.targetSize}\n {...rest}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PHImage.js","sourceRoot":"","sources":["../src/PHImage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AA+B7D,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AAEhF,MAAM,UAAU,WAAW,CAAC,EAC1B,cAAc,EACd,WAAW,EACX,GAAG,IAAI,EACU;IACjB,OAAO,CACL,CAAC,iBAAiB,CAChB,eAAe,CAAC,CAAC,WAAW,CAAC,CAC7B,kBAAkB,CAAC,CAAC,cAAc,EAAE,WAAW,CAAC,CAChD,sBAAsB,CAAC,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAC/D,YAAY,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAC3C,UAAU,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CACvC,UAAU,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CACvC,IAAI,IAAI,CAAC,EACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeViewManager } from \"expo-modules-core\";\nimport type { ViewProps } from \"react-native\";\nimport {\n PHImageContentMode,\n PHImageRequestOptions,\n RequestImageTargetSize,\n UIViewContentMode,\n} from \"./ExpoPhotos.types\";\n\nexport interface PHImageLoadEvent {\n size: { width: number; height: number };\n scale: number;\n}\n\nexport interface PHImageErrorEvent {\n message: string;\n}\n\nexport interface PHImageViewRequestOptions extends PHImageRequestOptions {\n contentMode?: PHImageContentMode;\n targetSize?: RequestImageTargetSize;\n}\n\nexport interface PHImageViewProps extends ViewProps {\n localIdentifier: string;\n contentMode?: UIViewContentMode;\n requestOptions?: PHImageViewRequestOptions;\n onLoad?: (event: { nativeEvent: PHImageLoadEvent }) => void;\n onError?: (event: { nativeEvent: PHImageErrorEvent }) => void;\n}\n\nconst NativePHImageView = requireNativeViewManager(\"ExpoPhotos\", \"PHImageView\");\n\nexport function PHImageView({\n requestOptions,\n contentMode,\n ...rest\n}: PHImageViewProps) {\n return (\n <NativePHImageView\n viewContentMode={contentMode}\n requestContentMode={requestOptions?.contentMode}\n isNetworkAccessAllowed={requestOptions?.isNetworkAccessAllowed}\n deliveryMode={requestOptions?.deliveryMode}\n resizeMode={requestOptions?.resizeMode}\n targetSize={requestOptions?.targetSize}\n {...rest}\n />\n );\n}\n"]}
|
package/build/PHVideo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ViewProps } from "react-native";
|
|
1
|
+
import type { ViewProps } from "react-native";
|
|
2
2
|
import { PHVideoLoadEvent, PHVideoErrorEvent, PHVideoRequestOptions } from "./ExpoPhotos.types";
|
|
3
3
|
export interface PHVideoViewRequestOptions extends PHVideoRequestOptions {
|
|
4
4
|
}
|
|
@@ -12,5 +12,5 @@ export interface PHVideoViewProps extends ViewProps {
|
|
|
12
12
|
nativeEvent: PHVideoErrorEvent;
|
|
13
13
|
}) => void;
|
|
14
14
|
}
|
|
15
|
-
export declare function PHVideoView({ requestOptions, ...rest }: PHVideoViewProps):
|
|
15
|
+
export declare function PHVideoView({ requestOptions, ...rest }: PHVideoViewProps): any;
|
|
16
16
|
//# sourceMappingURL=PHVideo.d.ts.map
|
package/build/PHVideo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PHVideo.d.ts","sourceRoot":"","sources":["../src/PHVideo.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"PHVideo.d.ts","sourceRoot":"","sources":["../src/PHVideo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;CAAG;AAE3E,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,yBAAyB,CAAC;IAC3C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,gBAAgB,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,iBAAiB,CAAA;KAAE,KAAK,IAAI,CAAC;CAC/D;AAID,wBAAgB,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB,OAQxE"}
|
package/build/PHVideo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PHVideo.js","sourceRoot":"","sources":["../src/PHVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAiB7D,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AAEhF,MAAM,UAAU,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,EAAoB;IACvE,OAAO,CACL,CAAC,iBAAiB,CAChB,sBAAsB,CAAC,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAC/D,YAAY,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAC3C,IAAI,IAAI,CAAC,EACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeViewManager } from \"expo-modules-core\";\nimport { ViewProps } from \"react-native\";\nimport {\n PHVideoLoadEvent,\n PHVideoErrorEvent,\n PHVideoRequestOptions,\n} from \"./ExpoPhotos.types\";\n\nexport interface PHVideoViewRequestOptions extends PHVideoRequestOptions {}\n\nexport interface PHVideoViewProps extends ViewProps {\n localIdentifier: string;\n requestOptions?: PHVideoViewRequestOptions;\n onLoad?: (event: { nativeEvent: PHVideoLoadEvent }) => void;\n onError?: (event: { nativeEvent: PHVideoErrorEvent }) => void;\n}\n\nconst NativePHVideoView = requireNativeViewManager(\"ExpoPhotos\", \"PHVideoView\");\n\nexport function PHVideoView({ requestOptions, ...rest }: PHVideoViewProps) {\n return (\n <NativePHVideoView\n isNetworkAccessAllowed={requestOptions?.isNetworkAccessAllowed}\n deliveryMode={requestOptions?.deliveryMode}\n {...rest}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PHVideo.js","sourceRoot":"","sources":["../src/PHVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAiB7D,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;AAEhF,MAAM,UAAU,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,EAAoB;IACvE,OAAO,CACL,CAAC,iBAAiB,CAChB,sBAAsB,CAAC,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAC/D,YAAY,CAAC,CAAC,cAAc,EAAE,YAAY,CAAC,CAC3C,IAAI,IAAI,CAAC,EACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { requireNativeViewManager } from \"expo-modules-core\";\nimport type { ViewProps } from \"react-native\";\nimport {\n PHVideoLoadEvent,\n PHVideoErrorEvent,\n PHVideoRequestOptions,\n} from \"./ExpoPhotos.types\";\n\nexport interface PHVideoViewRequestOptions extends PHVideoRequestOptions {}\n\nexport interface PHVideoViewProps extends ViewProps {\n localIdentifier: string;\n requestOptions?: PHVideoViewRequestOptions;\n onLoad?: (event: { nativeEvent: PHVideoLoadEvent }) => void;\n onError?: (event: { nativeEvent: PHVideoErrorEvent }) => void;\n}\n\nconst NativePHVideoView = requireNativeViewManager(\"ExpoPhotos\", \"PHVideoView\");\n\nexport function PHVideoView({ requestOptions, ...rest }: PHVideoViewProps) {\n return (\n <NativePHVideoView\n isNetworkAccessAllowed={requestOptions?.isNetworkAccessAllowed}\n deliveryMode={requestOptions?.deliveryMode}\n {...rest}\n />\n );\n}\n"]}
|
|
@@ -21,7 +21,7 @@ struct RequestImageOptions: Record {
|
|
|
21
21
|
@Field var outputURL: URL?
|
|
22
22
|
@Field var encodeCompressionQuality: Double?
|
|
23
23
|
@Field var encodeMaxFileSize: Int?
|
|
24
|
-
@Field var timeout:
|
|
24
|
+
@Field var timeout: Milliseconds?
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
protocol AVAssetExportSessionOptions {
|
|
@@ -40,7 +40,7 @@ struct RequestVideoOptions: Record, AVAssetExportSessionOptions {
|
|
|
40
40
|
@Field var outputFileType: AVFileType?
|
|
41
41
|
@Field var fileLengthLimit: Int64?
|
|
42
42
|
@Field var timeRange: CMTimeRange?
|
|
43
|
-
@Field var timeout:
|
|
43
|
+
@Field var timeout: Milliseconds?
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
struct PickAssetsOptions: Record {
|
|
@@ -123,7 +123,7 @@ public final class ExpoPhotos: Module {
|
|
|
123
123
|
imageRequestOptions.resizeMode = resizeMode
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
let deadline = options.timeout.map { DispatchTime.now() + $0 }
|
|
126
|
+
let deadline = options.timeout.map { DispatchTime.now() + $0.seconds }
|
|
127
127
|
|
|
128
128
|
let image = try await withCheckedThrowingContinuation {
|
|
129
129
|
(continuation: CheckedContinuation<UIImage, Error>) in
|
|
@@ -202,7 +202,7 @@ public final class ExpoPhotos: Module {
|
|
|
202
202
|
videoRequestOptions.deliveryMode = deliveryMode
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
let deadline = options.timeout.map { DispatchTime.now() + $0 }
|
|
205
|
+
let deadline = options.timeout.map { DispatchTime.now() + $0.seconds }
|
|
206
206
|
|
|
207
207
|
let exportSession = try await withCheckedThrowingContinuation {
|
|
208
208
|
(continuation: CheckedContinuation<AVAssetExportSession, Error>) in
|
|
@@ -293,6 +293,9 @@ public final class ExpoPhotos: Module {
|
|
|
293
293
|
let picker = PHPickerViewController(configuration: config)
|
|
294
294
|
picker.delegate = self
|
|
295
295
|
|
|
296
|
+
// Disable swipe to dismiss, which does not trigger delegate
|
|
297
|
+
picker.isModalInPresentation = true
|
|
298
|
+
|
|
296
299
|
self.pickAssetsContinuations[picker.id] = continuation
|
|
297
300
|
viewController.present(picker, animated: true)
|
|
298
301
|
}
|
|
@@ -353,12 +356,10 @@ extension ExpoPhotos: PHPickerViewControllerDelegate {
|
|
|
353
356
|
public func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
|
|
354
357
|
picker.dismiss(animated: true, completion: nil)
|
|
355
358
|
|
|
356
|
-
guard let continuation = self.pickAssetsContinuations
|
|
359
|
+
guard let continuation = self.pickAssetsContinuations.removeValue(forKey: picker.id) else {
|
|
357
360
|
return
|
|
358
361
|
}
|
|
359
362
|
|
|
360
|
-
self.pickAssetsContinuations.removeValue(forKey: picker.id)
|
|
361
|
-
|
|
362
363
|
let assetIdentifiers = results.compactMap { $0.assetIdentifier }
|
|
363
364
|
var assets: [[String: Any]] = []
|
|
364
365
|
PHAsset.fetchAssets(withLocalIdentifiers: assetIdentifiers, options: nil).enumerateObjects {
|
|
@@ -376,22 +377,19 @@ extension PHPickerViewController {
|
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
379
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
/// A duration or timestamp that JS represents in milliseconds.
|
|
381
|
+
struct Milliseconds: Convertible {
|
|
382
|
+
let seconds: TimeInterval
|
|
383
|
+
|
|
384
|
+
static func convert(from value: Any?, appContext: AppContext) throws -> Self {
|
|
385
|
+
guard let milliseconds = value as? Double, milliseconds.isFinite else {
|
|
382
386
|
throw Conversions.ConvertingException<Self>(value)
|
|
383
387
|
}
|
|
384
|
-
return
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
func toJS() -> Int {
|
|
388
|
-
return Int(self * 1000)
|
|
388
|
+
return Self(seconds: milliseconds / 1000)
|
|
389
389
|
}
|
|
390
|
-
}
|
|
391
390
|
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
return Int(self.seconds * 1000)
|
|
391
|
+
static func toJS(_ seconds: TimeInterval) -> Int {
|
|
392
|
+
seconds.isFinite ? Int((seconds * 1000).rounded()) : 0
|
|
395
393
|
}
|
|
396
394
|
}
|
|
397
395
|
|
|
@@ -403,10 +401,10 @@ extension PHAsset {
|
|
|
403
401
|
func toJS() -> [String: Any] {
|
|
404
402
|
return [
|
|
405
403
|
"localIdentifier": localIdentifier,
|
|
406
|
-
"creationDate": creationDate
|
|
404
|
+
"creationDate": creationDate.map { Milliseconds.toJS($0.timeIntervalSince1970) } ?? NSNull(),
|
|
407
405
|
"mediaType": mediaType.rawValue,
|
|
408
406
|
"mediaSubtypes": mediaSubtypes.rawValue,
|
|
409
|
-
"duration":
|
|
407
|
+
"duration": Milliseconds.toJS(duration),
|
|
410
408
|
"pixelWidth": pixelWidth,
|
|
411
409
|
"pixelHeight": pixelHeight,
|
|
412
410
|
]
|
|
@@ -440,16 +438,14 @@ extension NSPredicate: @retroactive Convertible {
|
|
|
440
438
|
|
|
441
439
|
extension CMTimeRange: @retroactive Convertible {
|
|
442
440
|
public static func convert(from value: Any?, appContext: AppContext) throws -> Self {
|
|
443
|
-
guard let dict = value as? [String: Any]
|
|
444
|
-
|
|
445
|
-
let durationMs = dict["duration"] as? Int
|
|
446
|
-
else {
|
|
447
|
-
throw Conversions.ConvertingException<CMTimeRange>(value)
|
|
441
|
+
guard let dict = value as? [String: Any] else {
|
|
442
|
+
throw Conversions.ConvertingException<Self>(value)
|
|
448
443
|
}
|
|
449
|
-
|
|
444
|
+
let start = try Milliseconds.convert(from: dict["start"], appContext: appContext)
|
|
445
|
+
let duration = try Milliseconds.convert(from: dict["duration"], appContext: appContext)
|
|
450
446
|
return Self(
|
|
451
|
-
start:
|
|
452
|
-
duration:
|
|
447
|
+
start: CMTime(seconds: start.seconds, preferredTimescale: 600),
|
|
448
|
+
duration: CMTime(seconds: duration.seconds, preferredTimescale: 600)
|
|
453
449
|
)
|
|
454
450
|
}
|
|
455
451
|
}
|
package/ios/PHVideoView.swift
CHANGED
|
@@ -122,11 +122,10 @@ public final class PHVideoView: ExpoView {
|
|
|
122
122
|
case .readyToPlay:
|
|
123
123
|
if !self.didSendLoadEvent {
|
|
124
124
|
self.didSendLoadEvent = true
|
|
125
|
-
let duration = playerItem.asset.duration.seconds.isFinite ? playerItem.asset.duration.seconds * 1000 : 0
|
|
126
125
|
let tracks = playerItem.asset.tracks(withMediaType: .video)
|
|
127
126
|
let size = tracks.first?.naturalSize ?? .zero
|
|
128
127
|
self.onLoad([
|
|
129
|
-
"duration": duration,
|
|
128
|
+
"duration": Milliseconds.toJS(playerItem.asset.duration.seconds),
|
|
130
129
|
"naturalSize": [
|
|
131
130
|
"width": size.width,
|
|
132
131
|
"height": size.height
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hortemo/expo-photos",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Expo module exposing advanced iOS Photos APIs.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -29,11 +29,8 @@
|
|
|
29
29
|
"homepage": "https://github.com/hortemo/expo-photos#readme",
|
|
30
30
|
"dependencies": {},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/react": "~19.1.0",
|
|
33
32
|
"eslint": "^9.24.0",
|
|
34
|
-
"expo": "^
|
|
35
|
-
"expo-module-scripts": "^5.0.7",
|
|
36
|
-
"react-native": "0.81.4"
|
|
33
|
+
"expo-module-scripts": "^5.0.7"
|
|
37
34
|
},
|
|
38
35
|
"peerDependencies": {
|
|
39
36
|
"expo": "*",
|
package/src/ExpoPhotos.types.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface PHAsset {
|
|
2
2
|
localIdentifier: string;
|
|
3
|
+
/** Milliseconds since 1970. */
|
|
3
4
|
creationDate: number;
|
|
4
5
|
mediaType: PHAssetMediaType;
|
|
5
6
|
mediaSubtypes: PHAssetMediaSubtype;
|
|
7
|
+
/** Milliseconds. */
|
|
6
8
|
duration: number;
|
|
7
9
|
pixelWidth: number;
|
|
8
10
|
pixelHeight: number;
|
|
@@ -119,7 +121,9 @@ export interface PHVideoRequestOptions {
|
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
export interface CMTimeRange {
|
|
124
|
+
/** Milliseconds. */
|
|
122
125
|
start: number;
|
|
126
|
+
/** Milliseconds. */
|
|
123
127
|
duration: number;
|
|
124
128
|
}
|
|
125
129
|
|
|
@@ -194,6 +198,7 @@ export interface RequestImageOptions
|
|
|
194
198
|
targetSize: RequestImageTargetSize;
|
|
195
199
|
contentMode: PHImageContentMode;
|
|
196
200
|
outputURL?: string;
|
|
201
|
+
/** Milliseconds until the request is cancelled. */
|
|
197
202
|
timeout?: number;
|
|
198
203
|
}
|
|
199
204
|
|
|
@@ -207,6 +212,7 @@ export interface RequestVideoOptions
|
|
|
207
212
|
extends PHVideoRequestOptions, AVAssetExportSessionOptions {
|
|
208
213
|
localIdentifier: string;
|
|
209
214
|
exportPreset: AVAssetExportPreset;
|
|
215
|
+
/** Milliseconds until the request is cancelled. */
|
|
210
216
|
timeout?: number;
|
|
211
217
|
}
|
|
212
218
|
|
|
@@ -222,6 +228,7 @@ export interface PickAssetsOptions {
|
|
|
222
228
|
}
|
|
223
229
|
|
|
224
230
|
export interface PHVideoLoadEvent {
|
|
231
|
+
/** Milliseconds. */
|
|
225
232
|
duration: number;
|
|
226
233
|
naturalSize: { width: number; height: number };
|
|
227
234
|
}
|
package/src/PHImage.tsx
CHANGED
package/src/PHVideo.tsx
CHANGED