offset audio after playback and add songs
This commit is contained in:
@@ -24,6 +24,7 @@ import CreateLyricsHeader from '../Writing/components/CreateLyricsHeader'
|
||||
import { Image as ExpoImage } from 'expo-image'
|
||||
import SubscriptionConfirmModal from '../../components/SubscriptionConfirmModal'
|
||||
import { isWeb } from '../../hooks/useLayoutType'
|
||||
import { clampSyncOffsetMs, toSyncOffsetSeconds } from '../../utils/playbackSync'
|
||||
|
||||
const triggerDownload = async (url, title) => {
|
||||
if (!url) return
|
||||
@@ -144,13 +145,15 @@ const PlaybackDownload = ({ route }) => {
|
||||
const { currentUID, selectedProject } = useUserData()
|
||||
const { hasActiveSubscription, hasPurchased, videos } = useUser() || {}
|
||||
const { createPlaybackDownloadCheckout } = useStripe()
|
||||
const { action: routeAction, uri, project: routeProject } = route.params || {}
|
||||
const { action: routeAction, uri, project: routeProject, syncOffsetMs: routeSyncOffsetMs = 0 } = route.params || {}
|
||||
const action = routeAction || 'playback'
|
||||
const syncOffsetMs = clampSyncOffsetMs(routeSyncOffsetMs)
|
||||
console.log('[PlaybackDownload] route params', {
|
||||
action,
|
||||
projectId: routeProject?.id,
|
||||
hasUri: Boolean(uri),
|
||||
currentUID,
|
||||
syncOffsetMs,
|
||||
})
|
||||
const { setIsLoading, setTooltip } = useMinuit()
|
||||
const [isAfterPlaybackVideoVisible, setIsAfterPlaybackVideoVisible] = useState(false)
|
||||
@@ -259,6 +262,7 @@ const PlaybackDownload = ({ route }) => {
|
||||
videoUrl,
|
||||
audioUrl,
|
||||
storagePath: `users/${currentUID}/projects/${projectForDownload.id}/playback.mp4`,
|
||||
syncOffset: toSyncOffsetSeconds(syncOffsetMs),
|
||||
}
|
||||
|
||||
console.log('[PlaybackDownload] calling upload-mergeVideoAndAudio', payload)
|
||||
@@ -297,7 +301,7 @@ const PlaybackDownload = ({ route }) => {
|
||||
releaseBlobUrl(uri || null)
|
||||
setIsLoading(false)
|
||||
}
|
||||
}, [action, currentUID, pendingPlaybackUrl, projectForDownload, resolveAudioUrl, setIsLoading, uri])
|
||||
}, [action, currentUID, pendingPlaybackUrl, projectForDownload, resolveAudioUrl, setIsLoading, syncOffsetMs, uri])
|
||||
|
||||
const handleDownloadUri = useCallback(async () => {
|
||||
if (isPublishing || isDownloading) return
|
||||
|
||||
Reference in New Issue
Block a user