@movementinfra/expo-twostep-video 0.1.7 → 0.1.9
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/ExpoTwoStepVideo.types.d.ts +16 -0
- package/build/ExpoTwoStepVideo.types.d.ts.map +1 -1
- package/build/ExpoTwoStepVideo.types.js.map +1 -1
- package/build/TwoStepPlayerControllerView.d.ts +30 -0
- package/build/TwoStepPlayerControllerView.d.ts.map +1 -0
- package/build/TwoStepPlayerControllerView.js +54 -0
- package/build/TwoStepPlayerControllerView.js.map +1 -0
- package/build/VideoScrubber.d.ts +22 -0
- package/build/VideoScrubber.d.ts.map +1 -0
- package/build/VideoScrubber.js +467 -0
- package/build/VideoScrubber.js.map +1 -0
- package/build/VideoScrubber.types.d.ts +78 -0
- package/build/VideoScrubber.types.d.ts.map +1 -0
- package/build/VideoScrubber.types.js +2 -0
- package/build/VideoScrubber.types.js.map +1 -0
- package/build/hooks/useVideoScrubber.d.ts +86 -0
- package/build/hooks/useVideoScrubber.d.ts.map +1 -0
- package/build/hooks/useVideoScrubber.js +114 -0
- package/build/hooks/useVideoScrubber.js.map +1 -0
- package/build/index.d.ts +5 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -0
- package/build/index.js.map +1 -1
- package/expo-module.config.json +3 -2
- package/ios/{ExpoTwostepVideo.podspec → ExpoTwoStepVideo.podspec} +6 -1
- package/ios/{ExpoTwostepVideoModule.swift → ExpoTwoStepVideoModule.swift} +72 -8
- package/ios/{ExpoTwostepVideoView.swift → ExpoTwoStepVideoView.swift} +1 -1
- package/ios/ExpoTwostepPlayerControllerView.swift +297 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoScrubber.js","sourceRoot":"","sources":["../src/VideoScrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,WAAW,EACX,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ChC,GAAG,EAAE,CAAC;KACP;IACD,qBAAqB,EAAE;QACrB,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QACjC,MAAM,EAAE,CAAC;KACV;IACD,mBAAmB,EAAE;QACnB,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QACjC,GAAG,EAAE,CAAC;KACP;IACD,sBAAsB,EAAE;QACtB,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QAChC,MAAM,EAAE,CAAC;KACV;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;KACP;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,CAAC;QACR,YAAY,EAAE,CAAC;KAChB;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC,CAAC;QACP,IAAI,EAAE,CAAC,CAAC;QACR,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,YAAY,EAAE,CAAC;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n View,\n Image,\n StyleSheet,\n LayoutChangeEvent,\n PanResponder,\n PanResponderGestureState,\n GestureResponderEvent,\n Animated,\n} from 'react-native';\n\nimport { VideoScrubberProps, VideoScrubberRef, VideoScrubberTheme } from './VideoScrubber.types';\nimport ExpoTwoStepVideoModule from './ExpoTwoStepVideoModule';\n\nconst DEFAULT_THEME: Required<VideoScrubberTheme> = {\n handleColor: '#FFD700',\n selectedRegionColor: 'rgba(255,215,0,0.2)',\n playheadColor: '#FFFFFF',\n backgroundColor: '#1c1c1e',\n dimmedColor: 'rgba(0,0,0,0.6)',\n borderColor: '#FFD700',\n};\n\n/**\n * Video scrubber/trimmer component with thumbnail strip and draggable handles\n *\n * @example\n * ```tsx\n * <VideoScrubber\n * assetId={asset.id}\n * duration={asset.duration}\n * currentTime={currentTime}\n * startTime={trimStart}\n * endTime={trimEnd}\n * onStartTimeChange={setTrimStart}\n * onEndTimeChange={setTrimEnd}\n * onScrubbing={(time) => playerRef.current?.seek(time)}\n * />\n * ```\n */\nconst VideoScrubber = forwardRef<VideoScrubberRef, VideoScrubberProps>((props, ref) => {\n const {\n assetId,\n duration,\n currentTime,\n startTime,\n endTime,\n thumbnailCount = 10,\n thumbnailHeight = 50,\n onStartTimeChange,\n onEndTimeChange,\n onScrub,\n onScrubbing,\n onScrubEnd,\n minDuration = 0.5,\n style,\n disabled = false,\n theme: userTheme,\n showPlayhead = true,\n handleWidth = 20,\n } = props;\n\n const theme = useMemo(\n () => ({ ...DEFAULT_THEME, ...userTheme }),\n [userTheme]\n );\n\n const [thumbnails, setThumbnails] = useState<string[]>([]);\n const [containerWidth, setContainerWidth] = useState(0);\n const [isLoading, setIsLoading] = useState(true);\n const [dragging, setDragging] = useState<'start' | 'end' | 'playhead' | null>(null);\n\n // Track current values during drag - synced with props when not dragging\n const dragStartTimeRef = useRef(startTime);\n const dragEndTimeRef = useRef(endTime);\n const currentTimeRef = useRef(currentTime);\n const durationRef = useRef(duration);\n const containerWidthRef = useRef(containerWidth);\n\n // Sync refs with props when they change from outside (e.g., new video loaded)\n useEffect(() => {\n if (!dragging) {\n dragStartTimeRef.current = startTime;\n dragEndTimeRef.current = endTime;\n }\n }, [startTime, endTime, dragging]);\n\n // Keep other refs in sync\n useEffect(() => {\n currentTimeRef.current = currentTime;\n }, [currentTime]);\n\n useEffect(() => {\n durationRef.current = duration;\n }, [duration]);\n\n useEffect(() => {\n containerWidthRef.current = containerWidth;\n }, [containerWidth]);\n\n // Calculate thumbnail times\n const thumbnailTimes = useMemo(() => {\n if (duration <= 0) return [];\n const count = Math.min(thumbnailCount, Math.max(1, Math.ceil(duration)));\n const interval = duration / count;\n return Array.from({ length: count }, (_, i) => i * interval + interval / 2);\n }, [duration, thumbnailCount]);\n\n // Load thumbnails\n useEffect(() => {\n if (!assetId || thumbnailTimes.length === 0 || duration <= 0) {\n setThumbnails([]);\n setIsLoading(false);\n return;\n }\n\n let cancelled = false;\n setIsLoading(true);\n\n ExpoTwoStepVideoModule.generateThumbnails(\n assetId,\n thumbnailTimes,\n { width: thumbnailHeight * 1.5, height: thumbnailHeight }\n )\n .then((thumbs: string[]) => {\n if (!cancelled) {\n setThumbnails(thumbs);\n setIsLoading(false);\n }\n })\n .catch((err: Error) => {\n if (!cancelled) {\n console.error('Failed to generate thumbnails:', err);\n setIsLoading(false);\n }\n });\n\n return () => {\n cancelled = true;\n };\n }, [assetId, thumbnailTimes, thumbnailHeight, duration]);\n\n // Convert time to position and vice versa\n const timeToPosition = useCallback(\n (time: number) => {\n if (duration <= 0 || containerWidth <= 0) return 0;\n return (time / duration) * containerWidth;\n },\n [duration, containerWidth]\n );\n\n // Calculate positions\n const startPosition = timeToPosition(startTime);\n const endPosition = timeToPosition(endTime);\n const playheadPosition = timeToPosition(currentTime);\n\n // Handle layout change\n const handleLayout = useCallback((e: LayoutChangeEvent) => {\n setContainerWidth(e.nativeEvent.layout.width);\n }, []);\n\n // Store callbacks in refs to avoid recreating PanResponder on every render\n const onStartTimeChangeRef = useRef(onStartTimeChange);\n const onEndTimeChangeRef = useRef(onEndTimeChange);\n const onScrubRef = useRef(onScrub);\n const onScrubbingRef = useRef(onScrubbing);\n const onScrubEndRef = useRef(onScrubEnd);\n\n\n useEffect(() => {\n onStartTimeChangeRef.current = onStartTimeChange;\n onEndTimeChangeRef.current = onEndTimeChange;\n onScrubRef.current = onScrub;\n onScrubbingRef.current = onScrubbing;\n onScrubEndRef.current = onScrubEnd;\n }, [onStartTimeChange, onEndTimeChange, onScrub, onScrubbing, onScrubEnd]);\n\n // Create pan responders for handles and playhead\n // Using refs to avoid stale closures - PanResponder is only created once per type\n const createPanResponder = useCallback(\n (type: 'start' | 'end' | 'playhead') => {\n let initialTime = 0;\n\n return PanResponder.create({\n onStartShouldSetPanResponder: () => !disabled,\n onMoveShouldSetPanResponder: (_, gestureState) => {\n // Claim the gesture if there's any horizontal movement\n // This prevents ScrollView from capturing horizontal drags\n return !disabled && Math.abs(gestureState.dx) > 2;\n },\n // Capture phase handlers - these fire before parent views\n onStartShouldSetPanResponderCapture: () => false, // Don't capture on start, let it bubble\n onMoveShouldSetPanResponderCapture: (_, gestureState) => {\n // Only capture if horizontal movement is dominant\n return !disabled && Math.abs(gestureState.dx) > 5 && Math.abs(gestureState.dx) > Math.abs(gestureState.dy);\n },\n onPanResponderGrant: () => {\n // Read current values from refs at the moment the gesture starts\n if (type === 'start') {\n initialTime = dragStartTimeRef.current;\n } else if (type === 'end') {\n initialTime = dragEndTimeRef.current;\n } else {\n initialTime = currentTimeRef.current;\n }\n setDragging(type);\n },\n onPanResponderMove: (_e: GestureResponderEvent, gestureState: PanResponderGestureState) => {\n const width = containerWidthRef.current;\n const dur = durationRef.current;\n if (width <= 0 || dur <= 0) return;\n\n const deltaX = gestureState.dx;\n const deltaTime = (deltaX / width) * dur;\n let newTime = initialTime + deltaTime;\n\n if (type === 'start') {\n // Constrain start handle\n newTime = Math.max(0, Math.min(newTime, dragEndTimeRef.current - minDuration));\n dragStartTimeRef.current = newTime;\n onStartTimeChangeRef.current?.(newTime);\n onScrubbingRef.current?.(newTime);\n } else if (type === 'end') {\n // Constrain end handle\n newTime = Math.max(dragStartTimeRef.current + minDuration, Math.min(newTime, dur));\n dragEndTimeRef.current = newTime;\n onEndTimeChangeRef.current?.(newTime);\n onScrubbingRef.current?.(newTime);\n } else {\n // Playhead - constrain to selection\n newTime = Math.max(dragStartTimeRef.current, Math.min(newTime, dragEndTimeRef.current));\n onScrubRef.current?.(newTime);\n onScrubbingRef.current?.(newTime);\n }\n },\n onPanResponderRelease: (_e: GestureResponderEvent, gestureState: PanResponderGestureState) => {\n setDragging(null);\n if (type === 'start') {\n onScrubEndRef.current?.(dragStartTimeRef.current);\n } else if (type === 'end') {\n onScrubEndRef.current?.(dragEndTimeRef.current);\n } else {\n const width = containerWidthRef.current;\n const dur = durationRef.current;\n if (width > 0 && dur > 0) {\n const deltaTime = (gestureState.dx / width) * dur;\n const newTime = Math.max(\n dragStartTimeRef.current,\n Math.min(initialTime + deltaTime, dragEndTimeRef.current)\n );\n onScrubEndRef.current?.(newTime);\n }\n }\n },\n onPanResponderTerminate: () => {\n setDragging(null);\n },\n });\n },\n [disabled, minDuration] // Only recreate if disabled or minDuration changes\n );\n\n const startPanResponder = useMemo(\n () => createPanResponder('start'),\n [createPanResponder]\n );\n const endPanResponder = useMemo(\n () => createPanResponder('end'),\n [createPanResponder]\n );\n const playheadPanResponder = useMemo(\n () => createPanResponder('playhead'),\n [createPanResponder]\n );\n\n // Tap to seek\n const handleTap = useCallback(\n (e: GestureResponderEvent) => {\n if (disabled) return;\n const { locationX } = e.nativeEvent;\n const width = containerWidthRef.current;\n const dur = durationRef.current;\n if (width <= 0 || dur <= 0) return;\n\n const time = Math.max(0, Math.min(dur, (locationX / width) * dur));\n // Only seek within selection\n const clampedTime = Math.max(dragStartTimeRef.current, Math.min(time, dragEndTimeRef.current));\n onScrubRef.current?.(clampedTime);\n },\n [disabled]\n );\n\n // Expose ref methods\n useImperativeHandle(ref, () => ({\n regenerateThumbnails: async () => {\n if (!assetId || thumbnailTimes.length === 0) return;\n setIsLoading(true);\n try {\n const thumbs = await ExpoTwoStepVideoModule.generateThumbnails(\n assetId,\n thumbnailTimes,\n { width: thumbnailHeight * 1.5, height: thumbnailHeight }\n );\n setThumbnails(thumbs);\n } catch (err) {\n console.error('Failed to regenerate thumbnails:', err);\n } finally {\n setIsLoading(false);\n }\n },\n setPlayheadPosition: (time: number) => {\n onScrub?.(Math.max(startTime, Math.min(time, endTime)));\n },\n getSelection: () => ({ startTime, endTime }),\n }));\n\n const thumbnailWidth = containerWidth > 0 && thumbnails.length > 0\n ? containerWidth / thumbnails.length\n : 0;\n\n return (\n <View\n style={[\n styles.container,\n { backgroundColor: theme.backgroundColor },\n style,\n ]}\n onLayout={handleLayout}\n >\n {/* Thumbnail Strip */}\n <View style={[styles.thumbnailStrip, { height: thumbnailHeight }]}>\n {thumbnails.map((thumb, index) => (\n <Image\n key={index}\n source={{ uri: `data:image/png;base64,${thumb}` }}\n style={[\n styles.thumbnail,\n {\n width: thumbnailWidth,\n height: thumbnailHeight,\n },\n ]}\n resizeMode=\"cover\"\n />\n ))}\n {isLoading && thumbnails.length === 0 && (\n <View style={[styles.loadingPlaceholder, { height: thumbnailHeight }]} />\n )}\n </View>\n\n {/* Dimmed region - left */}\n <View\n style={[\n styles.dimmedRegion,\n {\n left: 0,\n width: startPosition,\n height: thumbnailHeight,\n backgroundColor: theme.dimmedColor,\n },\n ]}\n pointerEvents=\"none\"\n />\n\n {/* Dimmed region - right */}\n <View\n style={[\n styles.dimmedRegion,\n {\n left: endPosition,\n right: 0,\n height: thumbnailHeight,\n backgroundColor: theme.dimmedColor,\n },\n ]}\n pointerEvents=\"none\"\n />\n\n {/* Selection frame - top and bottom borders */}\n <View\n style={[\n styles.selectionBorder,\n styles.selectionBorderTop,\n {\n left: startPosition + handleWidth,\n width: Math.max(0, endPosition - startPosition - handleWidth * 2),\n backgroundColor: theme.borderColor,\n },\n ]}\n pointerEvents=\"none\"\n />\n <View\n style={[\n styles.selectionBorder,\n styles.selectionBorderBottom,\n {\n left: startPosition + handleWidth,\n width: Math.max(0, endPosition - startPosition - handleWidth * 2),\n top: thumbnailHeight - 2,\n backgroundColor: theme.borderColor,\n },\n ]}\n pointerEvents=\"none\"\n />\n\n {/* Start Handle */}\n <Animated.View\n style={[\n styles.handle,\n styles.startHandle,\n {\n left: startPosition,\n width: handleWidth,\n height: thumbnailHeight,\n backgroundColor: theme.handleColor,\n opacity: dragging === 'start' ? 0.8 : 1,\n },\n ]}\n hitSlop={{ top: 15, bottom: 15, left: 15, right: 10 }}\n {...startPanResponder.panHandlers}\n >\n <View style={styles.handleChevron}>\n <View style={[styles.chevronLine, styles.chevronLineTopLeft]} />\n <View style={[styles.chevronLine, styles.chevronLineBottomLeft]} />\n </View>\n </Animated.View>\n\n {/* End Handle */}\n <Animated.View\n style={[\n styles.handle,\n styles.endHandle,\n {\n left: endPosition - handleWidth,\n width: handleWidth,\n height: thumbnailHeight,\n backgroundColor: theme.handleColor,\n opacity: dragging === 'end' ? 0.8 : 1,\n },\n ]}\n hitSlop={{ top: 15, bottom: 15, left: 10, right: 15 }}\n {...endPanResponder.panHandlers}\n >\n <View style={styles.handleChevron}>\n <View style={[styles.chevronLine, styles.chevronLineTopRight]} />\n <View style={[styles.chevronLine, styles.chevronLineBottomRight]} />\n </View>\n </Animated.View>\n\n {/* Tap area for seeking */}\n <View\n style={[\n styles.tapArea,\n {\n left: startPosition + handleWidth,\n width: Math.max(0, endPosition - startPosition - handleWidth * 2),\n height: thumbnailHeight,\n },\n ]}\n onTouchEnd={handleTap}\n />\n\n {/* Playhead */}\n {showPlayhead && playheadPosition >= startPosition && playheadPosition <= endPosition && (\n <Animated.View\n style={[\n styles.playhead,\n {\n left: playheadPosition - 1,\n height: thumbnailHeight + 8,\n top: -4,\n backgroundColor: theme.playheadColor,\n opacity: dragging === 'playhead' ? 0.8 : 1,\n },\n ]}\n {...playheadPanResponder.panHandlers}\n >\n <View style={[styles.playheadKnob, { backgroundColor: theme.playheadColor }]} />\n </Animated.View>\n )}\n </View>\n );\n});\n\nVideoScrubber.displayName = 'VideoScrubber';\n\nconst styles = StyleSheet.create({\n container: {\n width: '100%',\n borderRadius: 8,\n overflow: 'hidden',\n position: 'relative',\n },\n thumbnailStrip: {\n flexDirection: 'row',\n width: '100%',\n },\n thumbnail: {\n backgroundColor: '#2c2c2e',\n },\n loadingPlaceholder: {\n flex: 1,\n backgroundColor: '#2c2c2e',\n },\n dimmedRegion: {\n position: 'absolute',\n top: 0,\n },\n selectionBorder: {\n position: 'absolute',\n height: 2,\n },\n selectionBorderTop: {\n top: 0,\n },\n selectionBorderBottom: {\n bottom: 0,\n },\n handle: {\n position: 'absolute',\n top: 0,\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: 4,\n },\n startHandle: {\n borderTopLeftRadius: 6,\n borderBottomLeftRadius: 6,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n endHandle: {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderTopRightRadius: 6,\n borderBottomRightRadius: 6,\n },\n handleChevron: {\n width: 8,\n height: 16,\n justifyContent: 'center',\n alignItems: 'center',\n },\n chevronLine: {\n width: 2,\n height: 8,\n backgroundColor: '#000',\n borderRadius: 1,\n position: 'absolute',\n },\n chevronLineTopLeft: {\n transform: [{ rotate: '20deg' }],\n top: 0,\n },\n chevronLineBottomLeft: {\n transform: [{ rotate: '-20deg' }],\n bottom: 0,\n },\n chevronLineTopRight: {\n transform: [{ rotate: '-20deg' }],\n top: 0,\n },\n chevronLineBottomRight: {\n transform: [{ rotate: '20deg' }],\n bottom: 0,\n },\n tapArea: {\n position: 'absolute',\n top: 0,\n },\n playhead: {\n position: 'absolute',\n width: 2,\n borderRadius: 1,\n },\n playheadKnob: {\n position: 'absolute',\n top: -4,\n left: -4,\n width: 10,\n height: 10,\n borderRadius: 5,\n },\n});\n\nexport default VideoScrubber;\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* Theme options for the video scrubber component
|
|
4
|
+
*/
|
|
5
|
+
export interface VideoScrubberTheme {
|
|
6
|
+
/** Color of the drag handles (default: '#FFD700' - gold like iOS) */
|
|
7
|
+
handleColor?: string;
|
|
8
|
+
/** Color of the selected region overlay (default: 'rgba(255,215,0,0.3)') */
|
|
9
|
+
selectedRegionColor?: string;
|
|
10
|
+
/** Color of the playhead indicator (default: '#FFFFFF') */
|
|
11
|
+
playheadColor?: string;
|
|
12
|
+
/** Background color of the thumbnail strip (default: '#1c1c1e') */
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
/** Color of the dimmed regions outside selection (default: 'rgba(0,0,0,0.5)') */
|
|
15
|
+
dimmedColor?: string;
|
|
16
|
+
/** Border color of the selection frame (default: '#FFD700') */
|
|
17
|
+
borderColor?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Props for the VideoScrubber component
|
|
21
|
+
*
|
|
22
|
+
* A video scrubber/trimmer component that displays a thumbnail strip with
|
|
23
|
+
* adjustable start/end handles and a playhead indicator. Can be used for
|
|
24
|
+
* trimming videos, selecting loop ranges, or any time range selection.
|
|
25
|
+
*/
|
|
26
|
+
export interface VideoScrubberProps {
|
|
27
|
+
/** Asset ID for thumbnail generation (from loadAsset) */
|
|
28
|
+
assetId: string;
|
|
29
|
+
/** Total duration of the video in seconds */
|
|
30
|
+
duration: number;
|
|
31
|
+
/** Current playback position in seconds (for playhead) */
|
|
32
|
+
currentTime: number;
|
|
33
|
+
/** Currently selected start time in seconds */
|
|
34
|
+
startTime: number;
|
|
35
|
+
/** Currently selected end time in seconds */
|
|
36
|
+
endTime: number;
|
|
37
|
+
/** Number of thumbnails to display (default: 10) */
|
|
38
|
+
thumbnailCount?: number;
|
|
39
|
+
/** Height of the thumbnail strip in pixels (default: 50) */
|
|
40
|
+
thumbnailHeight?: number;
|
|
41
|
+
/** Called when start time handle changes */
|
|
42
|
+
onStartTimeChange?: (time: number) => void;
|
|
43
|
+
/** Called when end time handle changes */
|
|
44
|
+
onEndTimeChange?: (time: number) => void;
|
|
45
|
+
/** Called when user taps or drags the playhead to a new position */
|
|
46
|
+
onScrub?: (time: number) => void;
|
|
47
|
+
/** Called continuously during active dragging (for live preview) */
|
|
48
|
+
onScrubbing?: (time: number) => void;
|
|
49
|
+
/** Called when user finishes dragging */
|
|
50
|
+
onScrubEnd?: (time: number) => void;
|
|
51
|
+
/** Minimum duration between start and end in seconds (default: 0.5) */
|
|
52
|
+
minDuration?: number;
|
|
53
|
+
/** View style for the container */
|
|
54
|
+
style?: StyleProp<ViewStyle>;
|
|
55
|
+
/** Whether the scrubber is disabled */
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
/** Color theme options */
|
|
58
|
+
theme?: VideoScrubberTheme;
|
|
59
|
+
/** Whether to show the playhead indicator (default: true) */
|
|
60
|
+
showPlayhead?: boolean;
|
|
61
|
+
/** Handle width in pixels (default: 20) */
|
|
62
|
+
handleWidth?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Ref handle for VideoScrubber component
|
|
66
|
+
*/
|
|
67
|
+
export interface VideoScrubberRef {
|
|
68
|
+
/** Force regenerate thumbnails (e.g., after asset changes) */
|
|
69
|
+
regenerateThumbnails: () => Promise<void>;
|
|
70
|
+
/** Programmatically set playhead position */
|
|
71
|
+
setPlayheadPosition: (time: number) => void;
|
|
72
|
+
/** Get the current selection range */
|
|
73
|
+
getSelection: () => {
|
|
74
|
+
startTime: number;
|
|
75
|
+
endTime: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=VideoScrubber.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoScrubber.types.d.ts","sourceRoot":"","sources":["../src/VideoScrubber.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2DAA2D;IAC3D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;G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E1C,6CAA6C;IAC7C,mBAAmB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C,sCAAsC;IACtC,YAAY,EAAE,MAAM;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoScrubber.types.js","sourceRoot":"","sources":["../src/VideoScrubber.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\n\n/**\n * Theme options for the video scrubber component\n */\nexport interface VideoScrubberTheme {\n /** Color of the drag handles (default: '#FFD700' - gold like iOS) */\n handleColor?: string;\n /** Color of the selected region overlay (default: 'rgba(255,215,0,0.3)') */\n selectedRegionColor?: string;\n /** Color of the playhead indicator (default: '#FFFFFF') */\n playheadColor?: string;\n /** Background color of the thumbnail strip (default: '#1c1c1e') */\n backgroundColor?: string;\n /** Color of the dimmed regions outside selection (default: 'rgba(0,0,0,0.5)') */\n dimmedColor?: string;\n /** Border color of the selection frame (default: '#FFD700') */\n borderColor?: string;\n}\n\n/**\n * Props for the VideoScrubber component\n *\n * A video scrubber/trimmer component that displays a thumbnail strip with\n * adjustable start/end handles and a playhead indicator. Can be used for\n * trimming videos, selecting loop ranges, or any time range selection.\n */\nexport interface VideoScrubberProps {\n /** Asset ID for thumbnail generation (from loadAsset) */\n assetId: string;\n\n /** Total duration of the video in seconds */\n duration: number;\n\n /** Current playback position in seconds (for playhead) */\n currentTime: number;\n\n /** Currently selected start time in seconds */\n startTime: number;\n\n /** Currently selected end time in seconds */\n endTime: number;\n\n /** Number of thumbnails to display (default: 10) */\n thumbnailCount?: number;\n\n /** Height of the thumbnail strip in pixels (default: 50) */\n thumbnailHeight?: number;\n\n /** Called when start time handle changes */\n onStartTimeChange?: (time: number) => void;\n\n /** Called when end time handle changes */\n onEndTimeChange?: (time: number) => void;\n\n /** Called when user taps or drags the playhead to a new position */\n onScrub?: (time: number) => void;\n\n /** Called continuously during active dragging (for live preview) */\n onScrubbing?: (time: number) => void;\n\n /** Called when user finishes dragging */\n onScrubEnd?: (time: number) => void;\n\n /** Minimum duration between start and end in seconds (default: 0.5) */\n minDuration?: number;\n\n /** View style for the container */\n style?: StyleProp<ViewStyle>;\n\n /** Whether the scrubber is disabled */\n disabled?: boolean;\n\n /** Color theme options */\n theme?: VideoScrubberTheme;\n\n /** Whether to show the playhead indicator (default: true) */\n showPlayhead?: boolean;\n\n /** Handle width in pixels (default: 20) */\n handleWidth?: number;\n}\n\n/**\n * Ref handle for VideoScrubber component\n */\nexport interface VideoScrubberRef {\n /** Force regenerate thumbnails (e.g., after asset changes) */\n regenerateThumbnails: () => Promise<void>;\n\n /** Programmatically set playhead position */\n setPlayheadPosition: (time: number) => void;\n\n /** Get the current selection range */\n getSelection: () => { startTime: number; endTime: number };\n}\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { TwoStepVideoViewRef } from '../ExpoTwoStepVideo.types';
|
|
3
|
+
export interface UseVideoScrubberOptions {
|
|
4
|
+
/** Initial start time (default: 0) */
|
|
5
|
+
initialStartTime?: number;
|
|
6
|
+
/** Initial end time (default: duration) */
|
|
7
|
+
initialEndTime?: number;
|
|
8
|
+
/** Video duration in seconds */
|
|
9
|
+
duration: number;
|
|
10
|
+
/** Whether to pause video when scrubbing (default: true) */
|
|
11
|
+
pauseOnScrub?: boolean;
|
|
12
|
+
/** Whether to seek to selection start after changing selection (default: false) */
|
|
13
|
+
seekToSelectionOnChange?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface UseVideoScrubberReturn {
|
|
16
|
+
/** Current playback time */
|
|
17
|
+
currentTime: number;
|
|
18
|
+
/** Selected start time */
|
|
19
|
+
startTime: number;
|
|
20
|
+
/** Selected end time */
|
|
21
|
+
endTime: number;
|
|
22
|
+
/** Whether user is currently scrubbing */
|
|
23
|
+
isScrubbing: boolean;
|
|
24
|
+
/** Set the start time */
|
|
25
|
+
setStartTime: (time: number) => void;
|
|
26
|
+
/** Set the end time */
|
|
27
|
+
setEndTime: (time: number) => void;
|
|
28
|
+
/** Handler for video progress events */
|
|
29
|
+
handleProgress: (event: {
|
|
30
|
+
nativeEvent: {
|
|
31
|
+
currentTime: number;
|
|
32
|
+
duration: number;
|
|
33
|
+
};
|
|
34
|
+
}) => void;
|
|
35
|
+
/** Handler for when user starts/continues scrubbing */
|
|
36
|
+
handleScrubbing: (time: number) => Promise<void>;
|
|
37
|
+
/** Handler for when user finishes scrubbing */
|
|
38
|
+
handleScrubEnd: (time: number) => void;
|
|
39
|
+
/** Handler for scrub/seek events */
|
|
40
|
+
handleScrub: (time: number) => Promise<void>;
|
|
41
|
+
/** Reset selection to full duration */
|
|
42
|
+
resetSelection: () => void;
|
|
43
|
+
/** Get the selection duration */
|
|
44
|
+
selectionDuration: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Hook for managing video scrubber state and player synchronization
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* const playerRef = useRef<TwoStepVideoViewRef>(null);
|
|
52
|
+
* const {
|
|
53
|
+
* currentTime,
|
|
54
|
+
* startTime,
|
|
55
|
+
* endTime,
|
|
56
|
+
* handleProgress,
|
|
57
|
+
* handleScrubbing,
|
|
58
|
+
* handleScrubEnd,
|
|
59
|
+
* setStartTime,
|
|
60
|
+
* setEndTime,
|
|
61
|
+
* } = useVideoScrubber(playerRef, { duration: asset.duration });
|
|
62
|
+
*
|
|
63
|
+
* return (
|
|
64
|
+
* <>
|
|
65
|
+
* <TwoStepVideoView
|
|
66
|
+
* ref={playerRef}
|
|
67
|
+
* assetId={asset.id}
|
|
68
|
+
* onProgress={handleProgress}
|
|
69
|
+
* />
|
|
70
|
+
* <VideoScrubber
|
|
71
|
+
* assetId={asset.id}
|
|
72
|
+
* duration={asset.duration}
|
|
73
|
+
* currentTime={currentTime}
|
|
74
|
+
* startTime={startTime}
|
|
75
|
+
* endTime={endTime}
|
|
76
|
+
* onStartTimeChange={setStartTime}
|
|
77
|
+
* onEndTimeChange={setEndTime}
|
|
78
|
+
* onScrubbing={handleScrubbing}
|
|
79
|
+
* onScrubEnd={handleScrubEnd}
|
|
80
|
+
* />
|
|
81
|
+
* </>
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare function useVideoScrubber(playerRef: RefObject<TwoStepVideoViewRef | null>, options: UseVideoScrubberOptions): UseVideoScrubberReturn;
|
|
86
|
+
//# sourceMappingURL=useVideoScrubber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVideoScrubber.d.ts","sourceRoot":"","sources":["../../src/hooks/useVideoScrubber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mFAAmF;IACnF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,WAAW,EAAE,OAAO,CAAC;IACrB,yBAAyB;IACzB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,uBAAuB;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,wCAAwC;IACxC,cAAc,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE;YAAE,WAAW,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5F,uDAAuD;IACvD,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,+CAA+C;IAC/C,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,oCAAoC;IACpC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,uCAAuC;IACvC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,CAAC,mBAAmB,GAAG,IAAI,CAAC,EAChD,OAAO,EAAE,uBAAuB,GAC/B,sBAAsB,CAuGxB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { useCallback, useState, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing video scrubber state and player synchronization
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const playerRef = useRef<TwoStepVideoViewRef>(null);
|
|
8
|
+
* const {
|
|
9
|
+
* currentTime,
|
|
10
|
+
* startTime,
|
|
11
|
+
* endTime,
|
|
12
|
+
* handleProgress,
|
|
13
|
+
* handleScrubbing,
|
|
14
|
+
* handleScrubEnd,
|
|
15
|
+
* setStartTime,
|
|
16
|
+
* setEndTime,
|
|
17
|
+
* } = useVideoScrubber(playerRef, { duration: asset.duration });
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <>
|
|
21
|
+
* <TwoStepVideoView
|
|
22
|
+
* ref={playerRef}
|
|
23
|
+
* assetId={asset.id}
|
|
24
|
+
* onProgress={handleProgress}
|
|
25
|
+
* />
|
|
26
|
+
* <VideoScrubber
|
|
27
|
+
* assetId={asset.id}
|
|
28
|
+
* duration={asset.duration}
|
|
29
|
+
* currentTime={currentTime}
|
|
30
|
+
* startTime={startTime}
|
|
31
|
+
* endTime={endTime}
|
|
32
|
+
* onStartTimeChange={setStartTime}
|
|
33
|
+
* onEndTimeChange={setEndTime}
|
|
34
|
+
* onScrubbing={handleScrubbing}
|
|
35
|
+
* onScrubEnd={handleScrubEnd}
|
|
36
|
+
* />
|
|
37
|
+
* </>
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function useVideoScrubber(playerRef, options) {
|
|
42
|
+
const { initialStartTime = 0, initialEndTime, duration, pauseOnScrub = true, seekToSelectionOnChange = false, } = options;
|
|
43
|
+
const [currentTime, setCurrentTime] = useState(0);
|
|
44
|
+
const [startTime, setStartTimeState] = useState(initialStartTime);
|
|
45
|
+
const [endTime, setEndTimeState] = useState(initialEndTime ?? duration);
|
|
46
|
+
const [isScrubbing, setIsScrubbing] = useState(false);
|
|
47
|
+
// Track if we were playing before scrubbing
|
|
48
|
+
const wasPlayingRef = useRef(false);
|
|
49
|
+
// Handle progress events from player
|
|
50
|
+
const handleProgress = useCallback((event) => {
|
|
51
|
+
if (!isScrubbing) {
|
|
52
|
+
setCurrentTime(event.nativeEvent.currentTime);
|
|
53
|
+
}
|
|
54
|
+
}, [isScrubbing]);
|
|
55
|
+
// Handle scrubbing (during drag)
|
|
56
|
+
const handleScrubbing = useCallback(async (time) => {
|
|
57
|
+
if (!isScrubbing) {
|
|
58
|
+
setIsScrubbing(true);
|
|
59
|
+
// Remember if player was playing
|
|
60
|
+
wasPlayingRef.current = true; // Assume playing, adjust as needed
|
|
61
|
+
if (pauseOnScrub) {
|
|
62
|
+
await playerRef.current?.pause();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Seek to the scrub position for live preview
|
|
66
|
+
await playerRef.current?.seek(time);
|
|
67
|
+
setCurrentTime(time);
|
|
68
|
+
}, [isScrubbing, pauseOnScrub, playerRef]);
|
|
69
|
+
// Handle scrub end
|
|
70
|
+
const handleScrubEnd = useCallback((time) => {
|
|
71
|
+
setIsScrubbing(false);
|
|
72
|
+
setCurrentTime(time);
|
|
73
|
+
// Optionally resume playback here if wasPlayingRef.current
|
|
74
|
+
}, []);
|
|
75
|
+
// Handle single scrub/tap to seek
|
|
76
|
+
const handleScrub = useCallback(async (time) => {
|
|
77
|
+
await playerRef.current?.seek(time);
|
|
78
|
+
setCurrentTime(time);
|
|
79
|
+
}, [playerRef]);
|
|
80
|
+
// Set start time with optional seek
|
|
81
|
+
const setStartTime = useCallback((time) => {
|
|
82
|
+
setStartTimeState(time);
|
|
83
|
+
if (seekToSelectionOnChange) {
|
|
84
|
+
playerRef.current?.seek(time);
|
|
85
|
+
setCurrentTime(time);
|
|
86
|
+
}
|
|
87
|
+
}, [seekToSelectionOnChange, playerRef]);
|
|
88
|
+
// Set end time
|
|
89
|
+
const setEndTime = useCallback((time) => {
|
|
90
|
+
setEndTimeState(time);
|
|
91
|
+
}, []);
|
|
92
|
+
// Reset selection to full duration
|
|
93
|
+
const resetSelection = useCallback(() => {
|
|
94
|
+
setStartTimeState(0);
|
|
95
|
+
setEndTimeState(duration);
|
|
96
|
+
}, [duration]);
|
|
97
|
+
// Calculate selection duration
|
|
98
|
+
const selectionDuration = endTime - startTime;
|
|
99
|
+
return {
|
|
100
|
+
currentTime,
|
|
101
|
+
startTime,
|
|
102
|
+
endTime,
|
|
103
|
+
isScrubbing,
|
|
104
|
+
setStartTime,
|
|
105
|
+
setEndTime,
|
|
106
|
+
handleProgress,
|
|
107
|
+
handleScrubbing,
|
|
108
|
+
handleScrubEnd,
|
|
109
|
+
handleScrub,
|
|
110
|
+
resetSelection,
|
|
111
|
+
selectionDuration,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=useVideoScrubber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVideoScrubber.js","sourceRoot":"","sources":["../../src/hooks/useVideoScrubber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAa,MAAM,OAAO,CAAC;AA2CjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAgD,EAChD,OAAgC;IAEhC,MAAM,EACJ,gBAAgB,GAAG,CAAC,EACpB,cAAc,EACd,QAAQ,EACR,YAAY,GAAG,IAAI,EACnB,uBAAuB,GAAG,KAAK,GAChC,GAAG,OAAO,CAAC;IAEZ,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,SAAS,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAClE,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,cAAc,IAAI,QAAQ,CAAC,CAAC;IACxE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,4CAA4C;IAC5C,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEpC,qCAAqC;IACrC,MAAM,cAAc,GAAG,WAAW,CAChC,CAAC,KAAiE,EAAE,EAAE;QACpE,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAChD,CAAC;IACH,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,iCAAiC;IACjC,MAAM,eAAe,GAAG,WAAW,CACj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ACf,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,IAAY,EAAE,EAAE;QAC9C,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,mCAAmC;IACnC,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACrB,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,+BAA+B;IAC/B,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,CAAC;IAE9C,OAAO;QACL,WAAW;QACX,SAAS;QACT,OAAO;QACP,WAAW;QACX,YAAY;QACZ,UAAU;QACV,cAAc;QACd,eAAe;QACf,cAAc;QACd,WAAW;QACX,cAAc;QACd,iBAAiB;KAClB,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback, useState, useRef, RefObject } from 'react';\nimport { TwoStepVideoViewRef } from '../ExpoTwoStepVideo.types';\n\nexport interface UseVideoScrubberOptions {\n /** Initial start time (default: 0) */\n initialStartTime?: number;\n /** Initial end time (default: duration) */\n initialEndTime?: number;\n /** Video duration in seconds */\n duration: number;\n /** Whether to pause video when scrubbing (default: true) */\n pauseOnScrub?: boolean;\n /** Whether to seek to selection start after changing selection (default: false) */\n seekToSelectionOnChange?: boolean;\n}\n\nexport interface UseVideoScrubberReturn {\n /** Current playback time */\n currentTime: number;\n /** Selected start time */\n startTime: number;\n /** Selected end time */\n endTime: number;\n /** Whether user is currently scrubbing */\n isScrubbing: boolean;\n /** Set the start time */\n setStartTime: (time: number) => void;\n /** Set the end time */\n setEndTime: (time: number) => void;\n /** Handler for video progress events */\n handleProgress: (event: { nativeEvent: { currentTime: number; duration: number } }) => void;\n /** Handler for when user starts/continues scrubbing */\n handleScrubbing: (time: number) => Promise<void>;\n /** Handler for when user finishes scrubbing */\n handleScrubEnd: (time: number) => void;\n /** Handler for scrub/seek events */\n handleScrub: (time: number) => Promise<void>;\n /** Reset selection to full duration */\n resetSelection: () => void;\n /** Get the selection duration */\n selectionDuration: number;\n}\n\n/**\n * Hook for managing video scrubber state and player synchronization\n *\n * @example\n * ```tsx\n * const playerRef = useRef<TwoStepVideoViewRef>(null);\n * const {\n * currentTime,\n * startTime,\n * endTime,\n * handleProgress,\n * handleScrubbing,\n * handleScrubEnd,\n * setStartTime,\n * setEndTime,\n * } = useVideoScrubber(playerRef, { duration: asset.duration });\n *\n * return (\n * <>\n * <TwoStepVideoView\n * ref={playerRef}\n * assetId={asset.id}\n * onProgress={handleProgress}\n * />\n * <VideoScrubber\n * assetId={asset.id}\n * duration={asset.duration}\n * currentTime={currentTime}\n * startTime={startTime}\n * endTime={endTime}\n * onStartTimeChange={setStartTime}\n * onEndTimeChange={setEndTime}\n * onScrubbing={handleScrubbing}\n * onScrubEnd={handleScrubEnd}\n * />\n * </>\n * );\n * ```\n */\nexport function useVideoScrubber(\n playerRef: RefObject<TwoStepVideoViewRef | null>,\n options: UseVideoScrubberOptions\n): UseVideoScrubberReturn {\n const {\n initialStartTime = 0,\n initialEndTime,\n duration,\n pauseOnScrub = true,\n seekToSelectionOnChange = false,\n } = options;\n\n const [currentTime, setCurrentTime] = useState(0);\n const [startTime, setStartTimeState] = useState(initialStartTime);\n const [endTime, setEndTimeState] = useState(initialEndTime ?? duration);\n const [isScrubbing, setIsScrubbing] = useState(false);\n\n // Track if we were playing before scrubbing\n const wasPlayingRef = useRef(false);\n\n // Handle progress events from player\n const handleProgress = useCallback(\n (event: { nativeEvent: { currentTime: number; duration: number } }) => {\n if (!isScrubbing) {\n setCurrentTime(event.nativeEvent.currentTime);\n }\n },\n [isScrubbing]\n );\n\n // Handle scrubbing (during drag)\n const handleScrubbing = useCallback(\n async (time: number) => {\n if (!isScrubbing) {\n setIsScrubbing(true);\n // Remember if player was playing\n wasPlayingRef.current = true; // Assume playing, adjust as needed\n\n if (pauseOnScrub) {\n await playerRef.current?.pause();\n }\n }\n\n // Seek to the scrub position for live preview\n await playerRef.current?.seek(time);\n setCurrentTime(time);\n },\n [isScrubbing, pauseOnScrub, playerRef]\n );\n\n // Handle scrub end\n const handleScrubEnd = useCallback((time: number) => {\n setIsScrubbing(false);\n setCurrentTime(time);\n // Optionally resume playback here if wasPlayingRef.current\n }, []);\n\n // Handle single scrub/tap to seek\n const handleScrub = useCallback(\n async (time: number) => {\n await playerRef.current?.seek(time);\n setCurrentTime(time);\n },\n [playerRef]\n );\n\n // Set start time with optional seek\n const setStartTime = useCallback(\n (time: number) => {\n setStartTimeState(time);\n if (seekToSelectionOnChange) {\n playerRef.current?.seek(time);\n setCurrentTime(time);\n }\n },\n [seekToSelectionOnChange, playerRef]\n );\n\n // Set end time\n const setEndTime = useCallback((time: number) => {\n setEndTimeState(time);\n }, []);\n\n // Reset selection to full duration\n const resetSelection = useCallback(() => {\n setStartTimeState(0);\n setEndTimeState(duration);\n }, [duration]);\n\n // Calculate selection duration\n const selectionDuration = endTime - startTime;\n\n return {\n currentTime,\n startTime,\n endTime,\n isScrubbing,\n setStartTime,\n setEndTime,\n handleProgress,\n handleScrubbing,\n handleScrubEnd,\n handleScrub,\n resetSelection,\n selectionDuration,\n };\n}\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -565,5 +565,9 @@ declare const _default: {
|
|
|
565
565
|
};
|
|
566
566
|
export default _default;
|
|
567
567
|
export { default as TwoStepVideoView } from './ExpoTwoStepVideoView';
|
|
568
|
-
export
|
|
568
|
+
export { default as TwoStepPlayerControllerView } from './TwoStepPlayerControllerView';
|
|
569
|
+
export { default as VideoScrubber } from './VideoScrubber';
|
|
570
|
+
export { useVideoScrubber } from './hooks/useVideoScrubber';
|
|
571
|
+
export type { TwoStepVideoViewProps, TwoStepVideoViewRef, TwoStepPlayerControllerViewProps, TwoStepPlayerControllerViewRef, PlaybackStatusEvent, ProgressEvent, ErrorEvent, } from './ExpoTwoStepVideo.types';
|
|
572
|
+
export type { VideoScrubberProps, VideoScrubberRef, VideoScrubberTheme, } from './VideoScrubber.types';
|
|
569
573
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK3D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA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AID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAC7C,iBAAiB,CAEnB;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAY1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcD,wBAgCE;AAIF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EACV,qBAAqB,EACrB,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,mBAAmB,EACnB,aAAa,EACb,UAAU,GACX,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -427,4 +427,7 @@ export default {
|
|
|
427
427
|
};
|
|
428
428
|
// MARK: - View Component Export
|
|
429
429
|
export { default as TwoStepVideoView } from './ExpoTwoStepVideoView';
|
|
430
|
+
export { default as TwoStepPlayerControllerView } from './TwoStepPlayerControllerView';
|
|
431
|
+
export { default as VideoScrubber } from './VideoScrubber';
|
|
432
|
+
export { useVideoScrubber } from './hooks/useVideoScrubber';
|
|
430
433
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAuN9D,oBAAoB;AAEpB;;GAEG;AACH,MA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C,CAAC,CAAC;IAElD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,YAAY,GAAG,yBAAyB,CAAC,CAAC,KAAK,EAAE,EAAE;YACvD,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,yCAAyC;AACzC,0DAA0D;AAC1D,wCAAwC;AACxC,IAAI,KAAU,CAAC;AACf,IAAI,CAAC;IACH,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAAC,MAAM,CAAC;IACP,uCAAuC;AACzC,CAAC;AAED,kBAAkB;AAElB,eAAe;IACb,YAAY;IACZ,OAAO;IACP,MAAM;IAEN,iBAAiB;IACjB,SAAS;IACT,mBAAmB;IACnB,gBAAgB;IAChB,SAAS;IACT,iBAAiB;IACjB,kBAAkB;IAClB,WAAW;IACX,WAAW;IAEX,2BAA2B;IAC3B,WAAW;IACX,WAAW;IACX,cAAc;IACd,WAAW;IAEX,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,UAAU;IAEV,SAAS;IACT,yBAAyB;IAEzB,aAAa;IACb,iBAAiB;CAClB,CAAC;AAEF,gCAAgC;AAEhC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/**\n * TwoStepVideo - Professional video editing for React Native\n * Built on native AVFoundation with Expo Modules\n */\n\nimport { type EventSubscription } from 'expo-modules-core';\nimport ExpoTwoStepVideoModule from './ExpoTwoStepVideoModule';\n\n// MARK: - Types\n\n/**\n * Quality presets for video export\n */\nexport type VideoQuality = 'low' | 'medium' | 'high' | 'highest';\n\n/**\n * Mirror axis options for video mirroring\n */\nexport type MirrorAxis = 'horizontal' | 'vertical' | 'both';\n\n/**\n * Video asset metadata returned after loading\n */\nexport interface VideoAsset {\n /** Unique identifier for this asset */\n id: string;\n /** Duration in seconds */\n duration: number;\n /** Video width in pixels */\n width: number;\n /** Video height in pixels */\n height: number;\n /** Frame rate (fps) */\n frameRate: number;\n /** Whether the video has audio */\n hasAudio: boolean;\n}\n\n/**\n * Video composition metadata\n */\nexport interface VideoComposition {\n /** Unique identifier for this composition */\n id: string;\n /** Total duration in seconds */\n duration: number;\n}\n\n/**\n * Time segment for multi-segment trimming\n */\nexport interface TimeSegment {\n /** Start time in seconds */\n start: number;\n /** End time in seconds */\n end: number;\n}\n\n/**\n * Export result containing output file information\n */\nexport interface ExportResult {\n /** File URI (e.g., \"file:///path/to/video.mp4\") */\n uri: string;\n /** Absolute file path */\n path: string;\n}\n\n/**\n * Export progress event\n */\nexport interface ExportProgressEvent {\n /** Progress from 0.0 to 1.0 */\n progress: number;\n /** Asset ID if exporting asset directly */\n assetId?: string;\n /** Composition ID if exporting composition */\n compositionId?: string;\n}\n\n/**\n * Options for loading a video asset\n */\nexport interface LoadAssetOptions {\n /** File URI (e.g., \"file:///path/to/video.mp4\") */\n uri: string;\n}\n\n/**\n * Options for trimming a video\n */\nexport interface TrimVideoOptions {\n /** Asset ID to trim */\n assetId: string;\n /** Start time in seconds */\n startTime: number;\n /** End time in seconds */\n endTime: number;\n}\n\n/**\n * Options for multi-segment trimming\n */\nexport interface TrimMultipleOptions {\n /** Asset ID to trim */\n assetId: string;\n /** Array of time segments to extract and concatenate */\n segments: TimeSegment[];\n}\n\n/**\n * Options for generating thumbnails\n */\nexport interface GenerateThumbnailsOptions {\n /** Asset ID to generate thumbnails from */\n assetId: string;\n /** Array of times (in seconds) to extract thumbnails */\n times: number[];\n /** Optional size for thumbnails */\n size?: {\n width: number;\n height: number;\n };\n}\n\n/**\n * Options for exporting a composition\n */\nexport interface ExportCompositionOptions {\n /** Composition ID to export */\n compositionId: string;\n /** Optional output URI (uses temp directory if not provided) */\n outputUri?: string;\n /** Quality preset (default: 'high') */\n quality?: VideoQuality;\n}\n\n/**\n * Options for exporting an asset directly\n */\nexport interface ExportAssetOptions {\n /** Asset ID to export */\n assetId: string;\n /** Optional output URI (uses temp directory if not provided) */\n outputUri?: string;\n /** Quality preset (default: 'high') */\n quality?: VideoQuality;\n}\n\n/**\n * Options for mirroring a video\n */\nexport interface MirrorVideoOptions {\n /** Asset ID to mirror */\n assetId: string;\n /** Axis to mirror on: 'horizontal', 'vertical', or 'both' */\n axis: MirrorAxis;\n /** Optional start time in seconds (for segment mirroring) */\n startTime?: number;\n /** Optional end time in seconds (for segment mirroring) */\n endTime?: number;\n}\n\n/**\n * Options for adjusting video speed\n */\nexport interface AdjustSpeedOptions {\n /** Asset ID to adjust */\n assetId: string;\n /** Speed multiplier (0.25 = 4x slower, 2.0 = 2x faster) */\n speed: number;\n /** Optional start time in seconds */\n startTime?: number;\n /** Optional end time in seconds */\n endTime?: number;\n}\n\n/**\n * Options for combined video transformation\n */\nexport interface TransformVideoOptions {\n /** Asset ID to transform */\n assetId: string;\n /** Speed multiplier (default: 1.0) */\n speed?: number;\n /** Optional mirror axis */\n mirrorAxis?: MirrorAxis;\n /** Optional start time in seconds (for trimming) */\n startTime?: number;\n /** Optional end time in seconds (for trimming) */\n endTime?: number;\n}\n\n/**\n * Options for looping a video segment\n */\nexport interface LoopSegmentOptions {\n /** Asset ID to loop */\n assetId: string;\n /** Start time of the segment to loop (in seconds) */\n startTime: number;\n /** End time of the segment to loop (in seconds) */\n endTime: number;\n /** Number of times to repeat (total plays = loopCount + 1) */\n loopCount: number;\n}\n\n/**\n * Result from looping a video segment\n */\nexport interface LoopResult {\n /** Unique identifier for this composition */\n id: string;\n /** Total duration in seconds */\n duration: number;\n /** Number of times the segment repeats */\n loopCount: number;\n /** Total number of times the segment plays */\n totalPlays: number;\n}\n\n// MARK: - Constants\n\n/**\n * Quality constants\n */\nexport const Quality = {\n LOW: ExpoTwoStepVideoModule.QUALITY_LOW,\n MEDIUM: ExpoTwoStepVideoModule.QUALITY_MEDIUM,\n HIGH: ExpoTwoStepVideoModule.QUALITY_HIGH,\n HIGHEST: ExpoTwoStepVideoModule.QUALITY_HIGHEST,\n} as const;\n\n/**\n * Mirror axis constants\n */\nexport const Mirror = {\n HORIZONTAL: ExpoTwoStepVideoModule.MIRROR_HORIZONTAL,\n VERTICAL: ExpoTwoStepVideoModule.MIRROR_VERTICAL,\n BOTH: ExpoTwoStepVideoModule.MIRROR_BOTH,\n} as const;\n\n// MARK: - API Functions\n\n/**\n * Load a video asset from a file URI\n *\n * @param options - Load options containing the file URI\n * @returns Promise resolving to video asset metadata\n *\n * @example\n * ```typescript\n * const asset = await TwoStepVideo.loadAsset({\n * uri: 'file:///path/to/video.mp4'\n * });\n * console.log(`Duration: ${asset.duration}s, Size: ${asset.width}x${asset.height}`);\n * ```\n */\nexport async function loadAsset(options: LoadAssetOptions): Promise<VideoAsset> {\n return await ExpoTwoStepVideoModule.loadAsset(options.uri);\n}\n\n/**\n * Load a video asset from the Photos library\n *\n * @param localIdentifier - PHAsset local identifier from the Photos library\n * @returns Promise resolving to video asset metadata\n *\n * @example\n * ```typescript\n * // After using expo-media-library to get a photo asset\n * const asset = await TwoStepVideo.loadAssetFromPhotos(photoAsset.id);\n * ```\n */\nexport async function loadAssetFromPhotos(localIdentifier: string): Promise<VideoAsset> {\n return await ExpoTwoStepVideoModule.loadAssetFromPhotos(localIdentifier);\n}\n\n/**\n * Validate a video file URI without loading the full asset\n * Useful for quick validation before processing\n *\n * @param uri - File URI to validate\n * @returns Promise resolving to true if valid video file\n *\n * @example\n * ```typescript\n * const isValid = await TwoStepVideo.validateVideoUri('file:///path/to/video.mp4');\n * if (isValid) {\n * const asset = await TwoStepVideo.loadAsset({ uri });\n * }\n * ```\n */\nexport async function validateVideoUri(uri: string): Promise<boolean> {\n return await ExpoTwoStepVideoModule.validateVideoUri(uri);\n}\n\n/**\n * Trim a video to a single time range\n *\n * @param options - Trim options including asset ID and time range\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * const asset = await TwoStepVideo.loadAsset({ uri });\n * const composition = await TwoStepVideo.trimVideo({\n * assetId: asset.id,\n * startTime: 5.0,\n * endTime: 15.0\n * });\n * console.log(`Trimmed to ${composition.duration}s`);\n * ```\n */\nexport async function trimVideo(options: TrimVideoOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.trimVideo(\n options.assetId,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Trim a video to multiple segments and concatenate them\n *\n * @param options - Trim options including asset ID and segments\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * const composition = await TwoStepVideo.trimVideoMultiple({\n * assetId: asset.id,\n * segments: [\n * { start: 0, end: 3 }, // First 3 seconds\n * { start: 10, end: 13 }, // 3 seconds from middle\n * { start: 20, end: 23 } // 3 seconds from end\n * ]\n * });\n * ```\n */\nexport async function trimVideoMultiple(options: TrimMultipleOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.trimVideoMultiple(options.assetId, options.segments);\n}\n\n/**\n * Mirror a video horizontally, vertically, or both\n *\n * @param options - Mirror options including asset ID and axis\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * // Mirror horizontally (flip left-right, common for selfie videos)\n * const composition = await TwoStepVideo.mirrorVideo({\n * assetId: asset.id,\n * axis: 'horizontal'\n * });\n *\n * // Mirror a specific segment\n * const composition = await TwoStepVideo.mirrorVideo({\n * assetId: asset.id,\n * axis: 'vertical',\n * startTime: 5,\n * endTime: 10\n * });\n * ```\n */\nexport async function mirrorVideo(options: MirrorVideoOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.mirrorVideo(\n options.assetId,\n options.axis,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Adjust the playback speed of a video\n *\n * @param options - Speed options including asset ID and speed multiplier\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * // Slow motion (0.5x speed = 2x slower)\n * const slowMo = await TwoStepVideo.adjustSpeed({\n * assetId: asset.id,\n * speed: 0.5\n * });\n *\n * // Fast forward (2x speed)\n * const fastForward = await TwoStepVideo.adjustSpeed({\n * assetId: asset.id,\n * speed: 2.0\n * });\n *\n * // Speed up a specific segment\n * const timelapse = await TwoStepVideo.adjustSpeed({\n * assetId: asset.id,\n * speed: 4.0,\n * startTime: 10,\n * endTime: 30\n * });\n * ```\n */\nexport async function adjustSpeed(options: AdjustSpeedOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.adjustSpeed(\n options.assetId,\n options.speed,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Transform a video with combined trimming, mirroring, and speed adjustment\n * Use the player's `loop` prop for continuous playback looping\n *\n * @param options - Transform options including asset ID, speed, and mirror axis\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * // Mirror and slow down\n * const transformed = await TwoStepVideo.transformVideo({\n * assetId: asset.id,\n * speed: 0.5,\n * mirrorAxis: 'horizontal'\n * });\n *\n * // Just mirror (speed defaults to 1.0)\n * const mirrored = await TwoStepVideo.transformVideo({\n * assetId: asset.id,\n * mirrorAxis: 'both'\n * });\n *\n * // Transform a specific segment (trim + mirror + speed)\n * const segment = await TwoStepVideo.transformVideo({\n * assetId: asset.id,\n * speed: 2.0,\n * mirrorAxis: 'horizontal',\n * startTime: 0,\n * endTime: 5\n * });\n *\n * // Play in loop mode\n * <TwoStepVideoView compositionId={segment.id} loop />\n * ```\n */\nexport async function transformVideo(options: TransformVideoOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.transformVideo(\n options.assetId,\n options.speed,\n options.mirrorAxis,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Loop a segment of a video multiple times\n *\n * @param options - Loop options including segment time range and repeat count\n * @returns Promise resolving to loop result with duration info\n *\n * @example\n * ```typescript\n * // Loop a 2-second segment 3 times (plays 4 times total)\n * const looped = await TwoStepVideo.loopSegment({\n * assetId: asset.id,\n * startTime: 5,\n * endTime: 7,\n * loopCount: 3\n * });\n * console.log(`Duration: ${looped.duration}s (plays ${looped.totalPlays} times)`);\n *\n * // Create a perfect loop for social media\n * const perfectLoop = await TwoStepVideo.loopSegment({\n * assetId: asset.id,\n * startTime: 0,\n * endTime: 3,\n * loopCount: 4 // 15 seconds total (3s * 5 plays)\n * });\n * ```\n */\nexport async function loopSegment(options: LoopSegmentOptions): Promise<LoopResult> {\n return await ExpoTwoStepVideoModule.loopSegment(\n options.assetId,\n options.startTime,\n options.endTime,\n options.loopCount\n );\n}\n\n/**\n * Generate thumbnail images from a video at specific times\n *\n * @param options - Thumbnail generation options\n * @returns Promise resolving to array of base64 encoded PNG images\n *\n * @example\n * ```typescript\n * const thumbnails = await TwoStepVideo.generateThumbnails({\n * assetId: asset.id,\n * times: [1, 5, 10, 15],\n * size: { width: 300, height: 300 }\n * });\n *\n * // Use in Image component\n * <Image source={{ uri: `data:image/png;base64,${thumbnails[0]}` }} />\n * ```\n */\nexport async function generateThumbnails(\n options: GenerateThumbnailsOptions\n): Promise<string[]> {\n return await ExpoTwoStepVideoModule.generateThumbnails(\n options.assetId,\n options.times,\n options.size\n );\n}\n\n/**\n * Export a composition to a video file\n *\n * @param options - Export options including composition ID and quality\n * @returns Promise resolving to export result with file URI\n *\n * @example\n * ```typescript\n * const result = await TwoStepVideo.exportVideo({\n * compositionId: composition.id,\n * quality: 'high'\n * });\n * console.log(`Exported to: ${result.uri}`);\n * ```\n */\nexport async function exportVideo(options: ExportCompositionOptions): Promise<ExportResult> {\n return await ExpoTwoStepVideoModule.exportVideo(\n options.compositionId,\n options.outputUri,\n options.quality\n );\n}\n\n/**\n * Export an asset directly without creating a composition\n * Useful for re-encoding or changing quality without trimming\n *\n * @param options - Export options including asset ID and quality\n * @returns Promise resolving to export result with file URI\n *\n * @example\n * ```typescript\n * const result = await TwoStepVideo.exportAsset({\n * assetId: asset.id,\n * quality: 'medium'\n * });\n * ```\n */\nexport async function exportAsset(options: ExportAssetOptions): Promise<ExportResult> {\n return await ExpoTwoStepVideoModule.exportAsset(\n options.assetId,\n options.outputUri,\n options.quality\n );\n}\n\n/**\n * Clean up a temporary file\n * Call this after you're done with exported files in the temp directory\n *\n * @param uri - File URI to clean up\n *\n * @example\n * ```typescript\n * const result = await TwoStepVideo.exportVideo({ ... });\n * // ... do something with result.uri\n * TwoStepVideo.cleanupFile(result.uri);\n * ```\n */\nexport function cleanupFile(uri: string): void {\n ExpoTwoStepVideoModule.cleanupFile(uri);\n}\n\n/**\n * Release an asset from memory\n * Call this when you're done with an asset to free up memory\n *\n * @param assetId - ID of the asset to release\n */\nexport function releaseAsset(assetId: string): void {\n ExpoTwoStepVideoModule.releaseAsset(assetId);\n}\n\n/**\n * Release a composition from memory\n *\n * @param compositionId - ID of the composition to release\n */\nexport function releaseComposition(compositionId: string): void {\n ExpoTwoStepVideoModule.releaseComposition(compositionId);\n}\n\n/**\n * Release all cached assets and compositions\n * Useful for cleanup when unmounting screens\n */\nexport function releaseAll(): void {\n ExpoTwoStepVideoModule.releaseAll();\n}\n\n// MARK: - Event Listeners\n\n/**\n * Add a listener for export progress events\n *\n * @param listener - Callback function receiving progress events\n * @returns Subscription object with remove() method\n *\n * @example\n * ```typescript\n * const subscription = TwoStepVideo.addExportProgressListener((event) => {\n * console.log(`Export progress: ${Math.round(event.progress * 100)}%`);\n * setProgress(event.progress);\n * });\n *\n * // Later, remove the listener\n * subscription.remove();\n * ```\n */\nexport function addExportProgressListener(\n listener: (event: ExportProgressEvent) => void\n): EventSubscription {\n return ExpoTwoStepVideoModule.addListener('onExportProgress', listener);\n}\n\n// MARK: - Helper Hook (for React)\n\n/**\n * React hook for managing export progress\n * Only works in React components\n *\n * @returns Current export progress (0.0 to 1.0)\n *\n * @example\n * ```typescript\n * function VideoEditor() {\n * const progress = useExportProgress();\n *\n * return (\n * <View>\n * <Text>Export Progress: {Math.round(progress * 100)}%</Text>\n * </View>\n * );\n * }\n * ```\n */\nexport function useExportProgress(): number {\n const [progress, setProgress] = React.useState(0);\n\n React.useEffect(() => {\n const subscription = addExportProgressListener((event) => {\n setProgress(event.progress);\n });\n\n return () => subscription.remove();\n }, []);\n\n return progress;\n}\n\n// Note: React import needed for the hook\n// If React is not available, the hook won't be usable but\n// the rest of the module will work fine\nlet React: any;\ntry {\n React = require('react');\n} catch {\n // React not available, hook won't work\n}\n\n// MARK: - Exports\n\nexport default {\n // Constants\n Quality,\n Mirror,\n\n // Core functions\n loadAsset,\n loadAssetFromPhotos,\n validateVideoUri,\n trimVideo,\n trimVideoMultiple,\n generateThumbnails,\n exportVideo,\n exportAsset,\n\n // Transformation functions\n mirrorVideo,\n adjustSpeed,\n transformVideo,\n loopSegment,\n\n // Memory management\n cleanupFile,\n releaseAsset,\n releaseComposition,\n releaseAll,\n\n // Events\n addExportProgressListener,\n\n // React hook\n useExportProgress,\n};\n\n// MARK: - View Component Export\n\nexport { default as TwoStepVideoView } from './ExpoTwoStepVideoView';\nexport type {\n TwoStepVideoViewProps,\n TwoStepVideoViewRef,\n PlaybackStatusEvent,\n ProgressEvent,\n ErrorEvent,\n} from './ExpoTwoStepVideo.types';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAuN9D,oBAAoB;AAEpB;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,GAAG,EAAE,sBAAsB,CAAC,WAAW;IACvC,MAAM,EAAE,sBAAsB,CAAC,cAAc;IAC7C,IAAI,EAAE,sBAAsB,CAAC,YAAY;IACzC,OAAO,EAAE,sBAAsB,CAAC,eAAe;CACvC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,UAAU,EAAE,sBAAsB,CAAC,iBAAiB;IACpD,QAAQ,EAAE,sBAAsB,CAAC,eAAe;IAChD,IAAI,EAAE,sBAAsB,CAAC,WAAW;CAChC,CAAC;AAEX,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I,KAAU,CAAC;AACf,IAAI,CAAC;IACH,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAAC,MAAM,CAAC;IACP,uCAAuC;AACzC,CAAC;AAED,kBAAkB;AAElB,eAAe;IACb,YAAY;IACZ,OAAO;IACP,MAAM;IAEN,iBAAiB;IACjB,SAAS;IACT,mBAAmB;IACnB,gBAAgB;IAChB,SAAS;IACT,iBAAiB;IACjB,kBAAkB;IAClB,WAAW;IACX,WAAW;IAEX,2BAA2B;IAC3B,WAAW;IACX,WAAW;IACX,cAAc;IACd,WAAW;IAEX,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,UAAU;IAEV,SAAS;IACT,yBAAyB;IAEzB,aAAa;IACb,iBAAiB;CAClB,CAAC;AAEF,gCAAgC;AAEhC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["/**\n * TwoStepVideo - Professional video editing for React Native\n * Built on native AVFoundation with Expo Modules\n */\n\nimport { type EventSubscription } from 'expo-modules-core';\nimport ExpoTwoStepVideoModule from './ExpoTwoStepVideoModule';\n\n// MARK: - Types\n\n/**\n * Quality presets for video export\n */\nexport type VideoQuality = 'low' | 'medium' | 'high' | 'highest';\n\n/**\n * Mirror axis options for video mirroring\n */\nexport type MirrorAxis = 'horizontal' | 'vertical' | 'both';\n\n/**\n * Video asset metadata returned after loading\n */\nexport interface VideoAsset {\n /** Unique identifier for this asset */\n id: string;\n /** Duration in seconds */\n duration: number;\n /** Video width in pixels */\n width: number;\n /** Video height in pixels */\n height: number;\n /** Frame rate (fps) */\n frameRate: number;\n /** Whether the video has audio */\n hasAudio: boolean;\n}\n\n/**\n * Video composition metadata\n */\nexport interface VideoComposition {\n /** Unique identifier for this composition */\n id: string;\n /** Total duration in seconds */\n duration: number;\n}\n\n/**\n * Time segment for multi-segment trimming\n */\nexport interface TimeSegment {\n /** Start time in seconds */\n start: number;\n /** End time in seconds */\n end: number;\n}\n\n/**\n * Export result containing output file information\n */\nexport interface ExportResult {\n /** File URI (e.g., \"file:///path/to/video.mp4\") */\n uri: string;\n /** Absolute file path */\n path: string;\n}\n\n/**\n * Export progress event\n */\nexport interface ExportProgressEvent {\n /** Progress from 0.0 to 1.0 */\n progress: number;\n /** Asset ID if exporting asset directly */\n assetId?: string;\n /** Composition ID if exporting composition */\n compositionId?: string;\n}\n\n/**\n * Options for loading a video asset\n */\nexport interface LoadAssetOptions {\n /** File URI (e.g., \"file:///path/to/video.mp4\") */\n uri: string;\n}\n\n/**\n * Options for trimming a video\n */\nexport interface TrimVideoOptions {\n /** Asset ID to trim */\n assetId: string;\n /** Start time in seconds */\n startTime: number;\n /** End time in seconds */\n endTime: number;\n}\n\n/**\n * Options for multi-segment trimming\n */\nexport interface TrimMultipleOptions {\n /** Asset ID to trim */\n assetId: string;\n /** Array of time segments to extract and concatenate */\n segments: TimeSegment[];\n}\n\n/**\n * Options for generating thumbnails\n */\nexport interface GenerateThumbnailsOptions {\n /** Asset ID to generate thumbnails from */\n assetId: string;\n /** Array of times (in seconds) to extract thumbnails */\n times: number[];\n /** Optional size for thumbnails */\n size?: {\n width: number;\n height: number;\n };\n}\n\n/**\n * Options for exporting a composition\n */\nexport interface ExportCompositionOptions {\n /** Composition ID to export */\n compositionId: string;\n /** Optional output URI (uses temp directory if not provided) */\n outputUri?: string;\n /** Quality preset (default: 'high') */\n quality?: VideoQuality;\n}\n\n/**\n * Options for exporting an asset directly\n */\nexport interface ExportAssetOptions {\n /** Asset ID to export */\n assetId: string;\n /** Optional output URI (uses temp directory if not provided) */\n outputUri?: string;\n /** Quality preset (default: 'high') */\n quality?: VideoQuality;\n}\n\n/**\n * Options for mirroring a video\n */\nexport interface MirrorVideoOptions {\n /** Asset ID to mirror */\n assetId: string;\n /** Axis to mirror on: 'horizontal', 'vertical', or 'both' */\n axis: MirrorAxis;\n /** Optional start time in seconds (for segment mirroring) */\n startTime?: number;\n /** Optional end time in seconds (for segment mirroring) */\n endTime?: number;\n}\n\n/**\n * Options for adjusting video speed\n */\nexport interface AdjustSpeedOptions {\n /** Asset ID to adjust */\n assetId: string;\n /** Speed multiplier (0.25 = 4x slower, 2.0 = 2x faster) */\n speed: number;\n /** Optional start time in seconds */\n startTime?: number;\n /** Optional end time in seconds */\n endTime?: number;\n}\n\n/**\n * Options for combined video transformation\n */\nexport interface TransformVideoOptions {\n /** Asset ID to transform */\n assetId: string;\n /** Speed multiplier (default: 1.0) */\n speed?: number;\n /** Optional mirror axis */\n mirrorAxis?: MirrorAxis;\n /** Optional start time in seconds (for trimming) */\n startTime?: number;\n /** Optional end time in seconds (for trimming) */\n endTime?: number;\n}\n\n/**\n * Options for looping a video segment\n */\nexport interface LoopSegmentOptions {\n /** Asset ID to loop */\n assetId: string;\n /** Start time of the segment to loop (in seconds) */\n startTime: number;\n /** End time of the segment to loop (in seconds) */\n endTime: number;\n /** Number of times to repeat (total plays = loopCount + 1) */\n loopCount: number;\n}\n\n/**\n * Result from looping a video segment\n */\nexport interface LoopResult {\n /** Unique identifier for this composition */\n id: string;\n /** Total duration in seconds */\n duration: number;\n /** Number of times the segment repeats */\n loopCount: number;\n /** Total number of times the segment plays */\n totalPlays: number;\n}\n\n// MARK: - Constants\n\n/**\n * Quality constants\n */\nexport const Quality = {\n LOW: ExpoTwoStepVideoModule.QUALITY_LOW,\n MEDIUM: ExpoTwoStepVideoModule.QUALITY_MEDIUM,\n HIGH: ExpoTwoStepVideoModule.QUALITY_HIGH,\n HIGHEST: ExpoTwoStepVideoModule.QUALITY_HIGHEST,\n} as const;\n\n/**\n * Mirror axis constants\n */\nexport const Mirror = {\n HORIZONTAL: ExpoTwoStepVideoModule.MIRROR_HORIZONTAL,\n VERTICAL: ExpoTwoStepVideoModule.MIRROR_VERTICAL,\n BOTH: ExpoTwoStepVideoModule.MIRROR_BOTH,\n} as const;\n\n// MARK: - API Functions\n\n/**\n * Load a video asset from a file URI\n *\n * @param options - Load options containing the file URI\n * @returns Promise resolving to video asset metadata\n *\n * @example\n * ```typescript\n * const asset = await TwoStepVideo.loadAsset({\n * uri: 'file:///path/to/video.mp4'\n * });\n * console.log(`Duration: ${asset.duration}s, Size: ${asset.width}x${asset.height}`);\n * ```\n */\nexport async function loadAsset(options: LoadAssetOptions): Promise<VideoAsset> {\n return await ExpoTwoStepVideoModule.loadAsset(options.uri);\n}\n\n/**\n * Load a video asset from the Photos library\n *\n * @param localIdentifier - PHAsset local identifier from the Photos library\n * @returns Promise resolving to video asset metadata\n *\n * @example\n * ```typescript\n * // After using expo-media-library to get a photo asset\n * const asset = await TwoStepVideo.loadAssetFromPhotos(photoAsset.id);\n * ```\n */\nexport async function loadAssetFromPhotos(localIdentifier: string): Promise<VideoAsset> {\n return await ExpoTwoStepVideoModule.loadAssetFromPhotos(localIdentifier);\n}\n\n/**\n * Validate a video file URI without loading the full asset\n * Useful for quick validation before processing\n *\n * @param uri - File URI to validate\n * @returns Promise resolving to true if valid video file\n *\n * @example\n * ```typescript\n * const isValid = await TwoStepVideo.validateVideoUri('file:///path/to/video.mp4');\n * if (isValid) {\n * const asset = await TwoStepVideo.loadAsset({ uri });\n * }\n * ```\n */\nexport async function validateVideoUri(uri: string): Promise<boolean> {\n return await ExpoTwoStepVideoModule.validateVideoUri(uri);\n}\n\n/**\n * Trim a video to a single time range\n *\n * @param options - Trim options including asset ID and time range\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * const asset = await TwoStepVideo.loadAsset({ uri });\n * const composition = await TwoStepVideo.trimVideo({\n * assetId: asset.id,\n * startTime: 5.0,\n * endTime: 15.0\n * });\n * console.log(`Trimmed to ${composition.duration}s`);\n * ```\n */\nexport async function trimVideo(options: TrimVideoOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.trimVideo(\n options.assetId,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Trim a video to multiple segments and concatenate them\n *\n * @param options - Trim options including asset ID and segments\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * const composition = await TwoStepVideo.trimVideoMultiple({\n * assetId: asset.id,\n * segments: [\n * { start: 0, end: 3 }, // First 3 seconds\n * { start: 10, end: 13 }, // 3 seconds from middle\n * { start: 20, end: 23 } // 3 seconds from end\n * ]\n * });\n * ```\n */\nexport async function trimVideoMultiple(options: TrimMultipleOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.trimVideoMultiple(options.assetId, options.segments);\n}\n\n/**\n * Mirror a video horizontally, vertically, or both\n *\n * @param options - Mirror options including asset ID and axis\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * // Mirror horizontally (flip left-right, common for selfie videos)\n * const composition = await TwoStepVideo.mirrorVideo({\n * assetId: asset.id,\n * axis: 'horizontal'\n * });\n *\n * // Mirror a specific segment\n * const composition = await TwoStepVideo.mirrorVideo({\n * assetId: asset.id,\n * axis: 'vertical',\n * startTime: 5,\n * endTime: 10\n * });\n * ```\n */\nexport async function mirrorVideo(options: MirrorVideoOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.mirrorVideo(\n options.assetId,\n options.axis,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Adjust the playback speed of a video\n *\n * @param options - Speed options including asset ID and speed multiplier\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * // Slow motion (0.5x speed = 2x slower)\n * const slowMo = await TwoStepVideo.adjustSpeed({\n * assetId: asset.id,\n * speed: 0.5\n * });\n *\n * // Fast forward (2x speed)\n * const fastForward = await TwoStepVideo.adjustSpeed({\n * assetId: asset.id,\n * speed: 2.0\n * });\n *\n * // Speed up a specific segment\n * const timelapse = await TwoStepVideo.adjustSpeed({\n * assetId: asset.id,\n * speed: 4.0,\n * startTime: 10,\n * endTime: 30\n * });\n * ```\n */\nexport async function adjustSpeed(options: AdjustSpeedOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.adjustSpeed(\n options.assetId,\n options.speed,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Transform a video with combined trimming, mirroring, and speed adjustment\n * Use the player's `loop` prop for continuous playback looping\n *\n * @param options - Transform options including asset ID, speed, and mirror axis\n * @returns Promise resolving to composition metadata\n *\n * @example\n * ```typescript\n * // Mirror and slow down\n * const transformed = await TwoStepVideo.transformVideo({\n * assetId: asset.id,\n * speed: 0.5,\n * mirrorAxis: 'horizontal'\n * });\n *\n * // Just mirror (speed defaults to 1.0)\n * const mirrored = await TwoStepVideo.transformVideo({\n * assetId: asset.id,\n * mirrorAxis: 'both'\n * });\n *\n * // Transform a specific segment (trim + mirror + speed)\n * const segment = await TwoStepVideo.transformVideo({\n * assetId: asset.id,\n * speed: 2.0,\n * mirrorAxis: 'horizontal',\n * startTime: 0,\n * endTime: 5\n * });\n *\n * // Play in loop mode\n * <TwoStepVideoView compositionId={segment.id} loop />\n * ```\n */\nexport async function transformVideo(options: TransformVideoOptions): Promise<VideoComposition> {\n return await ExpoTwoStepVideoModule.transformVideo(\n options.assetId,\n options.speed,\n options.mirrorAxis,\n options.startTime,\n options.endTime\n );\n}\n\n/**\n * Loop a segment of a video multiple times\n *\n * @param options - Loop options including segment time range and repeat count\n * @returns Promise resolving to loop result with duration info\n *\n * @example\n * ```typescript\n * // Loop a 2-second segment 3 times (plays 4 times total)\n * const looped = await TwoStepVideo.loopSegment({\n * assetId: asset.id,\n * startTime: 5,\n * endTime: 7,\n * loopCount: 3\n * });\n * console.log(`Duration: ${looped.duration}s (plays ${looped.totalPlays} times)`);\n *\n * // Create a perfect loop for social media\n * const perfectLoop = await TwoStepVideo.loopSegment({\n * assetId: asset.id,\n * startTime: 0,\n * endTime: 3,\n * loopCount: 4 // 15 seconds total (3s * 5 plays)\n * });\n * ```\n */\nexport async function loopSegment(options: LoopSegmentOptions): Promise<LoopResult> {\n return await ExpoTwoStepVideoModule.loopSegment(\n options.assetId,\n options.startTime,\n options.endTime,\n options.loopCount\n );\n}\n\n/**\n * Generate thumbnail images from a video at specific times\n *\n * @param options - Thumbnail generation options\n * @returns Promise resolving to array of base64 encoded PNG images\n *\n * @example\n * ```typescript\n * const thumbnails = await TwoStepVideo.generateThumbnails({\n * assetId: asset.id,\n * times: [1, 5, 10, 15],\n * size: { width: 300, height: 300 }\n * });\n *\n * // Use in Image component\n * <Image source={{ uri: `data:image/png;base64,${thumbnails[0]}` }} />\n * ```\n */\nexport async function generateThumbnails(\n options: GenerateThumbnailsOptions\n): Promise<string[]> {\n return await ExpoTwoStepVideoModule.generateThumbnails(\n options.assetId,\n options.times,\n options.size\n );\n}\n\n/**\n * Export a composition to a video file\n *\n * @param options - Export options including composition ID and quality\n * @returns Promise resolving to export result with file URI\n *\n * @example\n * ```typescript\n * const result = await TwoStepVideo.exportVideo({\n * compositionId: composition.id,\n * quality: 'high'\n * });\n * console.log(`Exported to: ${result.uri}`);\n * ```\n */\nexport async function exportVideo(options: ExportCompositionOptions): Promise<ExportResult> {\n return await ExpoTwoStepVideoModule.exportVideo(\n options.compositionId,\n options.outputUri,\n options.quality\n );\n}\n\n/**\n * Export an asset directly without creating a composition\n * Useful for re-encoding or changing quality without trimming\n *\n * @param options - Export options including asset ID and quality\n * @returns Promise resolving to export result with file URI\n *\n * @example\n * ```typescript\n * const result = await TwoStepVideo.exportAsset({\n * assetId: asset.id,\n * quality: 'medium'\n * });\n * ```\n */\nexport async function exportAsset(options: ExportAssetOptions): Promise<ExportResult> {\n return await ExpoTwoStepVideoModule.exportAsset(\n options.assetId,\n options.outputUri,\n options.quality\n );\n}\n\n/**\n * Clean up a temporary file\n * Call this after you're done with exported files in the temp directory\n *\n * @param uri - File URI to clean up\n *\n * @example\n * ```typescript\n * const result = await TwoStepVideo.exportVideo({ ... });\n * // ... do something with result.uri\n * TwoStepVideo.cleanupFile(result.uri);\n * ```\n */\nexport function cleanupFile(uri: string): void {\n ExpoTwoStepVideoModule.cleanupFile(uri);\n}\n\n/**\n * Release an asset from memory\n * Call this when you're done with an asset to free up memory\n *\n * @param assetId - ID of the asset to release\n */\nexport function releaseAsset(assetId: string): void {\n ExpoTwoStepVideoModule.releaseAsset(assetId);\n}\n\n/**\n * Release a composition from memory\n *\n * @param compositionId - ID of the composition to release\n */\nexport function releaseComposition(compositionId: string): void {\n ExpoTwoStepVideoModule.releaseComposition(compositionId);\n}\n\n/**\n * Release all cached assets and compositions\n * Useful for cleanup when unmounting screens\n */\nexport function releaseAll(): void {\n ExpoTwoStepVideoModule.releaseAll();\n}\n\n// MARK: - Event Listeners\n\n/**\n * Add a listener for export progress events\n *\n * @param listener - Callback function receiving progress events\n * @returns Subscription object with remove() method\n *\n * @example\n * ```typescript\n * const subscription = TwoStepVideo.addExportProgressListener((event) => {\n * console.log(`Export progress: ${Math.round(event.progress * 100)}%`);\n * setProgress(event.progress);\n * });\n *\n * // Later, remove the listener\n * subscription.remove();\n * ```\n */\nexport function addExportProgressListener(\n listener: (event: ExportProgressEvent) => void\n): EventSubscription {\n return ExpoTwoStepVideoModule.addListener('onExportProgress', listener);\n}\n\n// MARK: - Helper Hook (for React)\n\n/**\n * React hook for managing export progress\n * Only works in React components\n *\n * @returns Current export progress (0.0 to 1.0)\n *\n * @example\n * ```typescript\n * function VideoEditor() {\n * const progress = useExportProgress();\n *\n * return (\n * <View>\n * <Text>Export Progress: {Math.round(progress * 100)}%</Text>\n * </View>\n * );\n * }\n * ```\n */\nexport function useExportProgress(): number {\n const [progress, setProgress] = React.useState(0);\n\n React.useEffect(() => {\n const subscription = addExportProgressListener((event) => {\n setProgress(event.progress);\n });\n\n return () => subscription.remove();\n }, []);\n\n return progress;\n}\n\n// Note: React import needed for the hook\n// If React is not available, the hook won't be usable but\n// the rest of the module will work fine\nlet React: any;\ntry {\n React = require('react');\n} catch {\n // React not available, hook won't work\n}\n\n// MARK: - Exports\n\nexport default {\n // Constants\n Quality,\n Mirror,\n\n // Core functions\n loadAsset,\n loadAssetFromPhotos,\n validateVideoUri,\n trimVideo,\n trimVideoMultiple,\n generateThumbnails,\n exportVideo,\n exportAsset,\n\n // Transformation functions\n mirrorVideo,\n adjustSpeed,\n transformVideo,\n loopSegment,\n\n // Memory management\n cleanupFile,\n releaseAsset,\n releaseComposition,\n releaseAll,\n\n // Events\n addExportProgressListener,\n\n // React hook\n useExportProgress,\n};\n\n// MARK: - View Component Export\n\nexport { default as TwoStepVideoView } from './ExpoTwoStepVideoView';\nexport { default as TwoStepPlayerControllerView } from './TwoStepPlayerControllerView';\nexport { default as VideoScrubber } from './VideoScrubber';\nexport { useVideoScrubber } from './hooks/useVideoScrubber';\nexport type {\n TwoStepVideoViewProps,\n TwoStepVideoViewRef,\n TwoStepPlayerControllerViewProps,\n TwoStepPlayerControllerViewRef,\n PlaybackStatusEvent,\n ProgressEvent,\n ErrorEvent,\n} from './ExpoTwoStepVideo.types';\nexport type {\n VideoScrubberProps,\n VideoScrubberRef,\n VideoScrubberTheme,\n} from './VideoScrubber.types';\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -3,7 +3,7 @@ require 'json'
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
4
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
|
-
s.name = '
|
|
6
|
+
s.name = 'ExpoTwoStepVideo'
|
|
7
7
|
s.version = package['version']
|
|
8
8
|
s.summary = package['description']
|
|
9
9
|
s.description = package['description']
|
|
@@ -20,10 +20,15 @@ Pod::Spec.new do |s|
|
|
|
20
20
|
# Swift/Objective-C compatibility
|
|
21
21
|
s.pod_target_xcconfig = {
|
|
22
22
|
'DEFINES_MODULE' => 'YES',
|
|
23
|
+
'PRODUCT_MODULE_NAME' => 'ExpoTwoStepVideo',
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
s.source_files = [
|
|
26
27
|
"*.swift",
|
|
27
28
|
"TwoStepVideo/**/*.swift"
|
|
28
29
|
]
|
|
30
|
+
|
|
31
|
+
s.exclude_files = [
|
|
32
|
+
"Package.swift"
|
|
33
|
+
]
|
|
29
34
|
end
|