@remotion/promo-pages 4.0.431 → 4.0.433
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/dist/Homepage.js +4671 -2145
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +4671 -2145
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +1154 -907
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts.js +1084 -838
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +1147 -900
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsGallery.js +1152 -905
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.js +1231 -984
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.js +1237 -990
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +1151 -904
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +1141 -894
- package/dist/design.js +1154 -907
- package/dist/experts.js +1084 -838
- package/dist/homepage/Pricing.js +1147 -900
- package/dist/prompts/PromptsGallery.js +1152 -905
- package/dist/prompts/PromptsShow.js +1231 -984
- package/dist/prompts/PromptsSubmit.js +1237 -990
- package/dist/template-modal-content.js +1151 -904
- package/dist/templates.js +1141 -894
- package/package.json +18 -14
- package/dist/cn.d.ts +0 -2
- package/dist/cn.js +0 -5
- package/dist/components/3DEngine/ButtonDemo.d.ts +0 -2
- package/dist/components/3DEngine/ButtonDemo.js +0 -43
- package/dist/components/3DEngine/Faces.d.ts +0 -5
- package/dist/components/3DEngine/Faces.js +0 -7
- package/dist/components/3DEngine/Outer.d.ts +0 -8
- package/dist/components/3DEngine/Outer.js +0 -56
- package/dist/components/3DEngine/Switch.d.ts +0 -4
- package/dist/components/3DEngine/Switch.js +0 -4
- package/dist/components/3DEngine/get-child-node-from.d.ts +0 -1
- package/dist/components/3DEngine/get-child-node-from.js +0 -14
- package/dist/components/3DEngine/hover-transforms.d.ts +0 -9
- package/dist/components/3DEngine/hover-transforms.js +0 -177
- package/dist/components/BackButton.d.ts +0 -6
- package/dist/components/BackButton.js +0 -9
- package/dist/components/CommandCopyButton.d.ts +0 -5
- package/dist/components/CommandCopyButton.js +0 -4
- package/dist/components/Homepage.d.ts +0 -6
- package/dist/components/Homepage.js +0 -20
- package/dist/components/ManageTeamMembers.d.ts +0 -2
- package/dist/components/ManageTeamMembers.js +0 -42
- package/dist/components/Spinner.d.ts +0 -3
- package/dist/components/Spinner.js +0 -4
- package/dist/components/TeamPicture.d.ts +0 -1
- package/dist/components/TeamPicture.js +0 -4
- package/dist/components/design.d.ts +0 -1
- package/dist/components/design.js +0 -33
- package/dist/components/experts/ExpertsPage.d.ts +0 -11
- package/dist/components/experts/ExpertsPage.js +0 -50
- package/dist/components/experts/experts-data.d.ts +0 -15
- package/dist/components/experts/experts-data.js +0 -263
- package/dist/components/experts/experts-icons.d.ts +0 -7
- package/dist/components/experts/experts-icons.js +0 -36
- package/dist/components/experts.d.ts +0 -3
- package/dist/components/experts.js +0 -2
- package/dist/components/homepage/BackgroundAnimation.d.ts +0 -2
- package/dist/components/homepage/BackgroundAnimation.js +0 -66
- package/dist/components/homepage/ChooseTemplate.d.ts +0 -2
- package/dist/components/homepage/ChooseTemplate.js +0 -25
- package/dist/components/homepage/CommunityStats.d.ts +0 -3
- package/dist/components/homepage/CommunityStats.js +0 -6
- package/dist/components/homepage/CommunityStatsItems.d.ts +0 -7
- package/dist/components/homepage/CommunityStatsItems.js +0 -58
- package/dist/components/homepage/Demo/Card.d.ts +0 -15
- package/dist/components/homepage/Demo/Card.js +0 -174
- package/dist/components/homepage/Demo/Cards.d.ts +0 -15
- package/dist/components/homepage/Demo/Cards.js +0 -57
- package/dist/components/homepage/Demo/Comp.d.ts +0 -38
- package/dist/components/homepage/Demo/Comp.js +0 -72
- package/dist/components/homepage/Demo/CurrentCountry.d.ts +0 -9
- package/dist/components/homepage/Demo/CurrentCountry.js +0 -48
- package/dist/components/homepage/Demo/DemoError.d.ts +0 -2
- package/dist/components/homepage/Demo/DemoError.js +0 -10
- package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +0 -2
- package/dist/components/homepage/Demo/DemoErrorIcon.js +0 -16
- package/dist/components/homepage/Demo/DemoRender.d.ts +0 -33
- package/dist/components/homepage/Demo/DemoRender.js +0 -107
- package/dist/components/homepage/Demo/DigitWheel.d.ts +0 -9
- package/dist/components/homepage/Demo/DigitWheel.js +0 -94
- package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +0 -5
- package/dist/components/homepage/Demo/DisplayedEmoji.js +0 -59
- package/dist/components/homepage/Demo/DoneCheckmark.d.ts +0 -2
- package/dist/components/homepage/Demo/DoneCheckmark.js +0 -20
- package/dist/components/homepage/Demo/DownloadNudge.d.ts +0 -2
- package/dist/components/homepage/Demo/DownloadNudge.js +0 -27
- package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +0 -3
- package/dist/components/homepage/Demo/DragAndDropNudge.js +0 -26
- package/dist/components/homepage/Demo/EmojiCard.d.ts +0 -10
- package/dist/components/homepage/Demo/EmojiCard.js +0 -120
- package/dist/components/homepage/Demo/Minus.d.ts +0 -5
- package/dist/components/homepage/Demo/Minus.js +0 -11
- package/dist/components/homepage/Demo/PlayPauseButton.d.ts +0 -5
- package/dist/components/homepage/Demo/PlayPauseButton.js +0 -47
- package/dist/components/homepage/Demo/PlayerControls.d.ts +0 -8
- package/dist/components/homepage/Demo/PlayerControls.js +0 -15
- package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +0 -11
- package/dist/components/homepage/Demo/PlayerSeekBar.js +0 -216
- package/dist/components/homepage/Demo/PlayerVolume.d.ts +0 -5
- package/dist/components/homepage/Demo/PlayerVolume.js +0 -53
- package/dist/components/homepage/Demo/Progress.d.ts +0 -4
- package/dist/components/homepage/Demo/Progress.js +0 -14
- package/dist/components/homepage/Demo/Spinner.d.ts +0 -5
- package/dist/components/homepage/Demo/Spinner.js +0 -37
- package/dist/components/homepage/Demo/Switcher.d.ts +0 -6
- package/dist/components/homepage/Demo/Switcher.js +0 -25
- package/dist/components/homepage/Demo/Temperature.d.ts +0 -6
- package/dist/components/homepage/Demo/Temperature.js +0 -21
- package/dist/components/homepage/Demo/TemperatureNumber.d.ts +0 -5
- package/dist/components/homepage/Demo/TemperatureNumber.js +0 -36
- package/dist/components/homepage/Demo/ThemeNudge.d.ts +0 -3
- package/dist/components/homepage/Demo/ThemeNudge.js +0 -35
- package/dist/components/homepage/Demo/TimeDisplay.d.ts +0 -6
- package/dist/components/homepage/Demo/TimeDisplay.js +0 -27
- package/dist/components/homepage/Demo/TrendingRepos.d.ts +0 -6
- package/dist/components/homepage/Demo/TrendingRepos.js +0 -65
- package/dist/components/homepage/Demo/icons.d.ts +0 -10
- package/dist/components/homepage/Demo/icons.js +0 -22
- package/dist/components/homepage/Demo/index.d.ts +0 -2
- package/dist/components/homepage/Demo/index.js +0 -95
- package/dist/components/homepage/Demo/math.d.ts +0 -10
- package/dist/components/homepage/Demo/math.js +0 -29
- package/dist/components/homepage/Demo/types.d.ts +0 -6
- package/dist/components/homepage/Demo/types.js +0 -0
- package/dist/components/homepage/EditorStarterSection.d.ts +0 -3
- package/dist/components/homepage/EditorStarterSection.js +0 -8
- package/dist/components/homepage/EvaluateRemotion.d.ts +0 -3
- package/dist/components/homepage/EvaluateRemotion.js +0 -21
- package/dist/components/homepage/FreePricing.d.ts +0 -4
- package/dist/components/homepage/FreePricing.js +0 -134
- package/dist/components/homepage/GetStartedStrip.d.ts +0 -2
- package/dist/components/homepage/GetStartedStrip.js +0 -14
- package/dist/components/homepage/GitHubButton.d.ts +0 -2
- package/dist/components/homepage/GitHubButton.js +0 -7
- package/dist/components/homepage/IconForTemplate.d.ts +0 -6
- package/dist/components/homepage/IconForTemplate.js +0 -112
- package/dist/components/homepage/IfYouKnowReact.d.ts +0 -3
- package/dist/components/homepage/IfYouKnowReact.js +0 -23
- package/dist/components/homepage/InfoTooltip.d.ts +0 -6
- package/dist/components/homepage/InfoTooltip.js +0 -6
- package/dist/components/homepage/MoreTemplatesButton.d.ts +0 -2
- package/dist/components/homepage/MoreTemplatesButton.js +0 -11
- package/dist/components/homepage/MuxVideo.d.ts +0 -7
- package/dist/components/homepage/MuxVideo.js +0 -45
- package/dist/components/homepage/NewsletterButton.d.ts +0 -2
- package/dist/components/homepage/NewsletterButton.js +0 -38
- package/dist/components/homepage/ParameterizeAndEdit.d.ts +0 -2
- package/dist/components/homepage/ParameterizeAndEdit.js +0 -22
- package/dist/components/homepage/Pricing.d.ts +0 -2
- package/dist/components/homepage/Pricing.js +0 -15
- package/dist/components/homepage/PricingBulletPoint.d.ts +0 -6
- package/dist/components/homepage/PricingBulletPoint.js +0 -19
- package/dist/components/homepage/RealMp4Videos.d.ts +0 -2
- package/dist/components/homepage/RealMp4Videos.js +0 -41
- package/dist/components/homepage/Spacer.d.ts +0 -2
- package/dist/components/homepage/Spacer.js +0 -4
- package/dist/components/homepage/TemplateIcon.d.ts +0 -5
- package/dist/components/homepage/TemplateIcon.js +0 -24
- package/dist/components/homepage/TextInput.d.ts +0 -7
- package/dist/components/homepage/TextInput.js +0 -34
- package/dist/components/homepage/TrustedByBanner.d.ts +0 -2
- package/dist/components/homepage/TrustedByBanner.js +0 -27
- package/dist/components/homepage/VideoApps.d.ts +0 -4
- package/dist/components/homepage/VideoApps.js +0 -72
- package/dist/components/homepage/VideoAppsShowcase.d.ts +0 -3
- package/dist/components/homepage/VideoAppsShowcase.js +0 -139
- package/dist/components/homepage/VideoAppsTitle.d.ts +0 -4
- package/dist/components/homepage/VideoAppsTitle.js +0 -4
- package/dist/components/homepage/VideoPlayerWithControls.d.ts +0 -20
- package/dist/components/homepage/VideoPlayerWithControls.js +0 -105
- package/dist/components/homepage/WriteInReact.d.ts +0 -2
- package/dist/components/homepage/WriteInReact.js +0 -10
- package/dist/components/homepage/YouAreHere.d.ts +0 -2
- package/dist/components/homepage/YouAreHere.js +0 -23
- package/dist/components/homepage/layout/Button.d.ts +0 -22
- package/dist/components/homepage/layout/Button.js +0 -30
- package/dist/components/homepage/layout/colors.d.ts +0 -13
- package/dist/components/homepage/layout/colors.js +0 -14
- package/dist/components/homepage/layout/use-color-mode.d.ts +0 -21
- package/dist/components/homepage/layout/use-color-mode.js +0 -22
- package/dist/components/homepage/layout/use-el-size.d.ts +0 -5
- package/dist/components/homepage/layout/use-el-size.js +0 -40
- package/dist/components/homepage/layout/use-mobile-layout.d.ts +0 -1
- package/dist/components/homepage/layout/use-mobile-layout.js +0 -6
- package/dist/components/icons/blank.d.ts +0 -3
- package/dist/components/icons/blank.js +0 -4
- package/dist/components/icons/brain.d.ts +0 -2
- package/dist/components/icons/brain.js +0 -4
- package/dist/components/icons/clone.d.ts +0 -2
- package/dist/components/icons/clone.js +0 -2
- package/dist/components/icons/code-hike.d.ts +0 -3
- package/dist/components/icons/code-hike.js +0 -4
- package/dist/components/icons/cubes.d.ts +0 -3
- package/dist/components/icons/cubes.js +0 -4
- package/dist/components/icons/editor.d.ts +0 -3
- package/dist/components/icons/editor.js +0 -4
- package/dist/components/icons/js.d.ts +0 -3
- package/dist/components/icons/js.js +0 -4
- package/dist/components/icons/music.d.ts +0 -2
- package/dist/components/icons/music.js +0 -4
- package/dist/components/icons/next.d.ts +0 -4
- package/dist/components/icons/next.js +0 -4
- package/dist/components/icons/overlay.d.ts +0 -3
- package/dist/components/icons/overlay.js +0 -4
- package/dist/components/icons/prompt-to-video.d.ts +0 -2
- package/dist/components/icons/prompt-to-video.js +0 -4
- package/dist/components/icons/recorder.d.ts +0 -3
- package/dist/components/icons/recorder.js +0 -4
- package/dist/components/icons/remix.d.ts +0 -3
- package/dist/components/icons/remix.js +0 -4
- package/dist/components/icons/render-server.d.ts +0 -3
- package/dist/components/icons/render-server.js +0 -4
- package/dist/components/icons/skia.d.ts +0 -3
- package/dist/components/icons/skia.js +0 -4
- package/dist/components/icons/stargazer.d.ts +0 -3
- package/dist/components/icons/stargazer.js +0 -4
- package/dist/components/icons/still.d.ts +0 -3
- package/dist/components/icons/still.js +0 -4
- package/dist/components/icons/tailwind.d.ts +0 -3
- package/dist/components/icons/tailwind.js +0 -4
- package/dist/components/icons/tiktok.d.ts +0 -3
- package/dist/components/icons/tiktok.js +0 -4
- package/dist/components/icons/timeline.d.ts +0 -3
- package/dist/components/icons/timeline.js +0 -4
- package/dist/components/icons/ts.d.ts +0 -3
- package/dist/components/icons/ts.js +0 -4
- package/dist/components/icons/tts.d.ts +0 -3
- package/dist/components/icons/tts.js +0 -4
- package/dist/components/icons/undo.d.ts +0 -3
- package/dist/components/icons/undo.js +0 -2
- package/dist/components/icons/vercel.d.ts +0 -4
- package/dist/components/icons/vercel.js +0 -4
- package/dist/components/icons/waveform.d.ts +0 -3
- package/dist/components/icons/waveform.js +0 -4
- package/dist/components/prompts/CardLikeButton.d.ts +0 -5
- package/dist/components/prompts/CardLikeButton.js +0 -49
- package/dist/components/prompts/ClipboardIcon.d.ts +0 -5
- package/dist/components/prompts/ClipboardIcon.js +0 -4
- package/dist/components/prompts/CopyPromptButton.d.ts +0 -4
- package/dist/components/prompts/CopyPromptButton.js +0 -13
- package/dist/components/prompts/LikeButton.d.ts +0 -5
- package/dist/components/prompts/LikeButton.js +0 -49
- package/dist/components/prompts/MuxPlayer.d.ts +0 -8
- package/dist/components/prompts/MuxPlayer.js +0 -21
- package/dist/components/prompts/NewBackButton.d.ts +0 -5
- package/dist/components/prompts/NewBackButton.js +0 -8
- package/dist/components/prompts/Page.d.ts +0 -8
- package/dist/components/prompts/Page.js +0 -7
- package/dist/components/prompts/PromptsGallery.d.ts +0 -7
- package/dist/components/prompts/PromptsGallery.js +0 -60
- package/dist/components/prompts/PromptsShow.d.ts +0 -5
- package/dist/components/prompts/PromptsShow.js +0 -17
- package/dist/components/prompts/PromptsSubmit.d.ts +0 -2
- package/dist/components/prompts/PromptsSubmit.js +0 -173
- package/dist/components/prompts/config.d.ts +0 -1
- package/dist/components/prompts/config.js +0 -1
- package/dist/components/prompts/prompt-helpers.d.ts +0 -8
- package/dist/components/prompts/prompt-helpers.js +0 -76
- package/dist/components/prompts/prompt-types.d.ts +0 -14
- package/dist/components/prompts/prompt-types.js +0 -0
- package/dist/components/prompts/use-heart-animation.d.ts +0 -5
- package/dist/components/prompts/use-heart-animation.js +0 -29
- package/dist/components/team/TeamCards.d.ts +0 -6
- package/dist/components/team/TeamCards.js +0 -19
- package/dist/components/team/TitleTeamCards.d.ts +0 -2
- package/dist/components/team/TitleTeamCards.js +0 -6
- package/dist/components/team.d.ts +0 -3
- package/dist/components/team.js +0 -14
- package/dist/components/template-modal-content.d.ts +0 -5
- package/dist/components/template-modal-content.js +0 -73
- package/dist/components/templates.d.ts +0 -2
- package/dist/components/templates.js +0 -27
- package/dist/helpers/mobile-layout.d.ts +0 -1
- package/dist/helpers/mobile-layout.js +0 -6
- package/dist/helpers/use-el-size.d.ts +0 -5
- package/dist/helpers/use-el-size.js +0 -40
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -6
- package/dist/prompts-show.d.ts +0 -1
- package/dist/prompts-show.js +0 -20
- package/dist/prompts-submit.d.ts +0 -1
- package/dist/prompts-submit.js +0 -6
- package/dist/prompts.d.ts +0 -1
- package/dist/prompts.js +0 -6
- package/dist/team.d.ts +0 -1
|
@@ -685,7 +685,7 @@ var experts = [
|
|
|
685
685
|
}
|
|
686
686
|
];
|
|
687
687
|
// src/components/experts/ExpertsPage.tsx
|
|
688
|
-
import { useMemo as
|
|
688
|
+
import { useMemo as useMemo36 } from "react";
|
|
689
689
|
|
|
690
690
|
// ../core/dist/esm/index.mjs
|
|
691
691
|
import { createContext } from "react";
|
|
@@ -694,37 +694,37 @@ import { jsx as jsx2 } from "react/jsx-runtime";
|
|
|
694
694
|
import {
|
|
695
695
|
forwardRef as forwardRef2,
|
|
696
696
|
useContext as useContext13,
|
|
697
|
-
useEffect
|
|
698
|
-
useMemo as
|
|
699
|
-
useState as
|
|
697
|
+
useEffect,
|
|
698
|
+
useMemo as useMemo11,
|
|
699
|
+
useState as useState4
|
|
700
700
|
} from "react";
|
|
701
701
|
import { forwardRef, useMemo } from "react";
|
|
702
702
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
703
703
|
import { useContext as useContext11, useMemo as useMemo8 } from "react";
|
|
704
704
|
import { createContext as createContext3 } from "react";
|
|
705
|
+
import { useContext as useContext7, useMemo as useMemo6 } from "react";
|
|
705
706
|
import {
|
|
706
|
-
createContext as
|
|
707
|
+
createContext as createContext6,
|
|
707
708
|
useLayoutEffect,
|
|
708
|
-
useMemo as
|
|
709
|
+
useMemo as useMemo2,
|
|
709
710
|
useRef,
|
|
710
711
|
useState as useState2
|
|
711
712
|
} from "react";
|
|
712
|
-
import {
|
|
713
|
-
import { useContext as useContext2, useState } from "react";
|
|
714
|
-
import React2 from "react";
|
|
715
|
-
import { useContext as useContext4, useMemo as useMemo4 } from "react";
|
|
713
|
+
import { createContext as createContext5, useCallback, useContext as useContext4 } from "react";
|
|
716
714
|
import { createContext as createContext4 } from "react";
|
|
717
|
-
import
|
|
718
|
-
import
|
|
719
|
-
|
|
720
|
-
useCallback,
|
|
721
|
-
useImperativeHandle,
|
|
722
|
-
useMemo as useMemo2
|
|
723
|
-
} from "react";
|
|
715
|
+
import * as React2 from "react";
|
|
716
|
+
import { useContext as useContext3, useState } from "react";
|
|
717
|
+
import React3 from "react";
|
|
724
718
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
725
|
-
import {
|
|
719
|
+
import { useContext as useContext6, useMemo as useMemo5 } from "react";
|
|
726
720
|
import { createContext as createContext7 } from "react";
|
|
727
|
-
import
|
|
721
|
+
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo4 } from "react";
|
|
722
|
+
import React5, {
|
|
723
|
+
createContext as createContext8,
|
|
724
|
+
useCallback as useCallback2,
|
|
725
|
+
useImperativeHandle,
|
|
726
|
+
useMemo as useMemo3
|
|
727
|
+
} from "react";
|
|
728
728
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
729
729
|
import { useContext as useContext8 } from "react";
|
|
730
730
|
import { createContext as createContext10 } from "react";
|
|
@@ -732,114 +732,114 @@ import { jsx as jsx5 } from "react/jsx-runtime";
|
|
|
732
732
|
import { useContext as useContext10 } from "react";
|
|
733
733
|
import { useContext as useContext9, useMemo as useMemo7 } from "react";
|
|
734
734
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
735
|
-
import { createContext as createContext11, useContext as useContext12,
|
|
735
|
+
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext12, useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
736
736
|
import { createContext as createContext12 } from "react";
|
|
737
|
-
import React8, { useCallback as
|
|
737
|
+
import React8, { useCallback as useCallback4, useMemo as useMemo10, useRef as useRef3, useState as useState3 } from "react";
|
|
738
738
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
739
739
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
740
740
|
import {
|
|
741
741
|
forwardRef as forwardRef3,
|
|
742
|
-
useEffect as
|
|
742
|
+
useEffect as useEffect2,
|
|
743
743
|
useImperativeHandle as useImperativeHandle3,
|
|
744
744
|
useLayoutEffect as useLayoutEffect2,
|
|
745
745
|
useRef as useRef5,
|
|
746
|
-
useState as
|
|
746
|
+
useState as useState5
|
|
747
747
|
} from "react";
|
|
748
|
-
import React10, { useCallback as
|
|
748
|
+
import React10, { useCallback as useCallback5, useImperativeHandle as useImperativeHandle2, useRef as useRef4 } from "react";
|
|
749
749
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
750
750
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
751
|
-
import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as
|
|
751
|
+
import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState7 } from "react";
|
|
752
752
|
import {
|
|
753
753
|
createContext as createContext13,
|
|
754
|
-
useCallback as
|
|
754
|
+
useCallback as useCallback6,
|
|
755
755
|
useImperativeHandle as useImperativeHandle4,
|
|
756
756
|
useLayoutEffect as useLayoutEffect3,
|
|
757
|
-
useMemo as
|
|
757
|
+
useMemo as useMemo12,
|
|
758
758
|
useRef as useRef6,
|
|
759
|
-
useState as
|
|
759
|
+
useState as useState6
|
|
760
760
|
} from "react";
|
|
761
761
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
762
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
763
|
-
import React11, { createContext as createContext14, useMemo as
|
|
762
|
+
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
|
|
763
|
+
import React11, { createContext as createContext14, useMemo as useMemo13 } from "react";
|
|
764
764
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
765
765
|
import { useContext as useContext15 } from "react";
|
|
766
|
-
import { createContext as createContext15, useEffect as
|
|
766
|
+
import { createContext as createContext15, useEffect as useEffect3, useState as useState8 } from "react";
|
|
767
767
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
768
|
-
import { createContext as createContext16, useMemo as
|
|
768
|
+
import { createContext as createContext16, useMemo as useMemo14, useReducer } from "react";
|
|
769
769
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
770
770
|
import React17, {
|
|
771
771
|
forwardRef as forwardRef4,
|
|
772
|
-
useContext as
|
|
773
|
-
useEffect as
|
|
772
|
+
useContext as useContext24,
|
|
773
|
+
useEffect as useEffect10,
|
|
774
774
|
useImperativeHandle as useImperativeHandle5,
|
|
775
|
-
useMemo as
|
|
775
|
+
useMemo as useMemo22,
|
|
776
776
|
useRef as useRef14,
|
|
777
|
-
useState as
|
|
777
|
+
useState as useState13
|
|
778
778
|
} from "react";
|
|
779
779
|
import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef9 } from "react";
|
|
780
780
|
import React14, {
|
|
781
781
|
createContext as createContext17,
|
|
782
782
|
createRef as createRef2,
|
|
783
|
-
useCallback as
|
|
783
|
+
useCallback as useCallback7,
|
|
784
784
|
useContext as useContext16,
|
|
785
|
-
useMemo as
|
|
785
|
+
useMemo as useMemo16,
|
|
786
786
|
useRef as useRef7,
|
|
787
|
-
useState as
|
|
787
|
+
useState as useState9
|
|
788
788
|
} from "react";
|
|
789
|
-
import { useMemo as
|
|
789
|
+
import { useMemo as useMemo15 } from "react";
|
|
790
790
|
import { jsx as jsx15, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
791
791
|
import { useRef as useRef8 } from "react";
|
|
792
|
-
import { useContext as useContext19, useEffect as
|
|
792
|
+
import { useContext as useContext19, useEffect as useEffect4, useMemo as useMemo17, useState as useState10 } from "react";
|
|
793
793
|
import { useContext as useContext18 } from "react";
|
|
794
794
|
import {
|
|
795
|
-
useCallback as
|
|
795
|
+
useCallback as useCallback10,
|
|
796
796
|
useContext as useContext22,
|
|
797
|
-
useEffect as
|
|
797
|
+
useEffect as useEffect8,
|
|
798
798
|
useLayoutEffect as useLayoutEffect7,
|
|
799
799
|
useRef as useRef13
|
|
800
800
|
} from "react";
|
|
801
|
-
import { useCallback as
|
|
802
|
-
import { useContext as useContext21, useMemo as
|
|
801
|
+
import { useCallback as useCallback9, useMemo as useMemo20, useRef as useRef11 } from "react";
|
|
802
|
+
import { useContext as useContext21, useMemo as useMemo19 } from "react";
|
|
803
803
|
import React15, {
|
|
804
|
-
useCallback as
|
|
804
|
+
useCallback as useCallback8,
|
|
805
805
|
useContext as useContext20,
|
|
806
|
-
useEffect as
|
|
806
|
+
useEffect as useEffect5,
|
|
807
807
|
useLayoutEffect as useLayoutEffect6,
|
|
808
|
-
useMemo as
|
|
808
|
+
useMemo as useMemo18,
|
|
809
809
|
useRef as useRef10,
|
|
810
|
-
useState as
|
|
810
|
+
useState as useState11
|
|
811
811
|
} from "react";
|
|
812
812
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
813
813
|
import React16 from "react";
|
|
814
|
-
import { useEffect as
|
|
815
|
-
import { useEffect as
|
|
816
|
-
import {
|
|
817
|
-
import { createContext as createContext18, useContext as
|
|
814
|
+
import { useEffect as useEffect6, useState as useState12 } from "react";
|
|
815
|
+
import { useEffect as useEffect7, useRef as useRef12 } from "react";
|
|
816
|
+
import { useEffect as useEffect9 } from "react";
|
|
817
|
+
import { createContext as createContext18, useContext as useContext23, useMemo as useMemo21 } from "react";
|
|
818
818
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
819
819
|
import {
|
|
820
820
|
forwardRef as forwardRef5,
|
|
821
|
-
useContext as
|
|
822
|
-
useEffect as
|
|
821
|
+
useContext as useContext25,
|
|
822
|
+
useEffect as useEffect11,
|
|
823
823
|
useImperativeHandle as useImperativeHandle6,
|
|
824
824
|
useLayoutEffect as useLayoutEffect8,
|
|
825
|
-
useMemo as
|
|
825
|
+
useMemo as useMemo23,
|
|
826
826
|
useRef as useRef15
|
|
827
827
|
} from "react";
|
|
828
828
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
829
829
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
830
|
-
import { Suspense, useContext as
|
|
830
|
+
import { Suspense, useContext as useContext28, useEffect as useEffect13 } from "react";
|
|
831
831
|
import { createPortal } from "react-dom";
|
|
832
|
-
import { createContext as createContext19, useContext as
|
|
832
|
+
import { createContext as createContext19, useContext as useContext27, useEffect as useEffect12, useMemo as useMemo24 } from "react";
|
|
833
833
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
834
834
|
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
835
|
-
import React20, { useMemo as
|
|
835
|
+
import React20, { useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
836
836
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
837
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
837
|
+
import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState14 } from "react";
|
|
838
838
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
839
839
|
import {
|
|
840
840
|
forwardRef as forwardRef8,
|
|
841
|
-
useCallback as
|
|
842
|
-
useContext as
|
|
841
|
+
useCallback as useCallback13,
|
|
842
|
+
useContext as useContext29,
|
|
843
843
|
useImperativeHandle as useImperativeHandle7,
|
|
844
844
|
useLayoutEffect as useLayoutEffect9,
|
|
845
845
|
useRef as useRef17
|
|
@@ -848,59 +848,61 @@ import { jsx as jsx24 } from "react/jsx-runtime";
|
|
|
848
848
|
import { createRef as createRef3 } from "react";
|
|
849
849
|
import React24 from "react";
|
|
850
850
|
import {
|
|
851
|
-
useCallback as
|
|
851
|
+
useCallback as useCallback14,
|
|
852
852
|
useImperativeHandle as useImperativeHandle8,
|
|
853
|
-
useMemo as
|
|
853
|
+
useMemo as useMemo26,
|
|
854
854
|
useRef as useRef18,
|
|
855
|
-
useState as
|
|
855
|
+
useState as useState15
|
|
856
856
|
} from "react";
|
|
857
857
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
858
858
|
import React25 from "react";
|
|
859
|
-
import { useMemo as
|
|
860
|
-
import { createContext as createContext20, useContext as
|
|
859
|
+
import { useMemo as useMemo28 } from "react";
|
|
860
|
+
import { createContext as createContext20, useContext as useContext30, useMemo as useMemo27 } from "react";
|
|
861
861
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
862
862
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
863
|
-
import React27
|
|
864
|
-
import
|
|
865
|
-
import { useContext as
|
|
866
|
-
import {
|
|
863
|
+
import React27 from "react";
|
|
864
|
+
import React28, { createContext as createContext21 } from "react";
|
|
865
|
+
import { useContext as useContext31, useMemo as useMemo29, useState as useState16 } from "react";
|
|
866
|
+
import { useContext as useContext32 } from "react";
|
|
867
|
+
import { useCallback as useCallback16 } from "react";
|
|
867
868
|
import {
|
|
868
|
-
useCallback as
|
|
869
|
-
useContext as
|
|
870
|
-
useEffect as
|
|
869
|
+
useCallback as useCallback15,
|
|
870
|
+
useContext as useContext33,
|
|
871
|
+
useEffect as useEffect14,
|
|
871
872
|
useLayoutEffect as useLayoutEffect10,
|
|
872
|
-
useMemo as
|
|
873
|
-
useState as
|
|
873
|
+
useMemo as useMemo30,
|
|
874
|
+
useState as useState17
|
|
874
875
|
} from "react";
|
|
875
876
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
876
|
-
import
|
|
877
|
+
import React30, {
|
|
877
878
|
forwardRef as forwardRef9,
|
|
878
|
-
useContext as
|
|
879
|
-
useEffect as
|
|
879
|
+
useContext as useContext34,
|
|
880
|
+
useEffect as useEffect16,
|
|
880
881
|
useImperativeHandle as useImperativeHandle9,
|
|
881
|
-
useMemo as
|
|
882
|
+
useMemo as useMemo31,
|
|
882
883
|
useRef as useRef19,
|
|
883
|
-
useState as
|
|
884
|
+
useState as useState18
|
|
884
885
|
} from "react";
|
|
885
|
-
import { useEffect as
|
|
886
|
+
import { useEffect as useEffect15 } from "react";
|
|
886
887
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
887
888
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
888
|
-
import
|
|
889
|
+
import React32, { forwardRef as forwardRef10, useMemo as useMemo32 } from "react";
|
|
890
|
+
import React33, { useMemo as useMemo33 } from "react";
|
|
889
891
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
890
|
-
import { Children, forwardRef as
|
|
891
|
-
import
|
|
892
|
-
import
|
|
892
|
+
import { Children, forwardRef as forwardRef11, useMemo as useMemo34 } from "react";
|
|
893
|
+
import React34 from "react";
|
|
894
|
+
import React35, { createContext as createContext22 } from "react";
|
|
893
895
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
894
896
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
895
|
-
import
|
|
896
|
-
import { forwardRef as
|
|
897
|
+
import React37 from "react";
|
|
898
|
+
import { forwardRef as forwardRef13, useCallback as useCallback17, useContext as useContext36 } from "react";
|
|
897
899
|
import {
|
|
898
|
-
forwardRef as
|
|
899
|
-
useContext as
|
|
900
|
-
useEffect as
|
|
900
|
+
forwardRef as forwardRef12,
|
|
901
|
+
useContext as useContext35,
|
|
902
|
+
useEffect as useEffect17,
|
|
901
903
|
useImperativeHandle as useImperativeHandle10,
|
|
902
904
|
useLayoutEffect as useLayoutEffect11,
|
|
903
|
-
useMemo as
|
|
905
|
+
useMemo as useMemo35,
|
|
904
906
|
useRef as useRef20
|
|
905
907
|
} from "react";
|
|
906
908
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
@@ -950,7 +952,7 @@ var useIsPlayer = () => {
|
|
|
950
952
|
function truthy(value) {
|
|
951
953
|
return Boolean(value);
|
|
952
954
|
}
|
|
953
|
-
var VERSION = "4.0.
|
|
955
|
+
var VERSION = "4.0.433";
|
|
954
956
|
var checkMultipleRemotionVersions = () => {
|
|
955
957
|
if (typeof globalThis === "undefined") {
|
|
956
958
|
return;
|
|
@@ -1071,6 +1073,17 @@ var AbsoluteFillRefForwarding = (props, ref) => {
|
|
|
1071
1073
|
};
|
|
1072
1074
|
var AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
|
|
1073
1075
|
var SequenceContext = createContext3(null);
|
|
1076
|
+
var exports_timeline_position_state = {};
|
|
1077
|
+
__export2(exports_timeline_position_state, {
|
|
1078
|
+
useTimelineSetFrame: () => useTimelineSetFrame,
|
|
1079
|
+
useTimelinePosition: () => useTimelinePosition,
|
|
1080
|
+
useTimelineContext: () => useTimelineContext,
|
|
1081
|
+
usePlayingState: () => usePlayingState,
|
|
1082
|
+
useAbsoluteTimelinePosition: () => useAbsoluteTimelinePosition,
|
|
1083
|
+
persistCurrentFrame: () => persistCurrentFrame,
|
|
1084
|
+
getInitialFrameState: () => getInitialFrameState,
|
|
1085
|
+
getFrameForComposition: () => getFrameForComposition
|
|
1086
|
+
});
|
|
1074
1087
|
function mulberry32(a) {
|
|
1075
1088
|
let t = a + 1831565813;
|
|
1076
1089
|
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
@@ -1103,15 +1116,55 @@ var random = (seed, dummy) => {
|
|
|
1103
1116
|
}
|
|
1104
1117
|
throw new Error("random() argument must be a number or a string");
|
|
1105
1118
|
};
|
|
1106
|
-
var
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}
|
|
1119
|
+
var getErrorStackWithMessage = (error) => {
|
|
1120
|
+
const stack = error.stack ?? "";
|
|
1121
|
+
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
1122
|
+
${stack}`;
|
|
1123
|
+
};
|
|
1124
|
+
var isErrorLike = (err) => {
|
|
1125
|
+
if (err instanceof Error) {
|
|
1126
|
+
return true;
|
|
1127
|
+
}
|
|
1128
|
+
if (err === null) {
|
|
1129
|
+
return false;
|
|
1130
|
+
}
|
|
1131
|
+
if (typeof err !== "object") {
|
|
1132
|
+
return false;
|
|
1133
|
+
}
|
|
1134
|
+
if (!("stack" in err)) {
|
|
1135
|
+
return false;
|
|
1136
|
+
}
|
|
1137
|
+
if (typeof err.stack !== "string") {
|
|
1138
|
+
return false;
|
|
1139
|
+
}
|
|
1140
|
+
if (!("message" in err)) {
|
|
1141
|
+
return false;
|
|
1142
|
+
}
|
|
1143
|
+
if (typeof err.message !== "string") {
|
|
1144
|
+
return false;
|
|
1145
|
+
}
|
|
1146
|
+
return true;
|
|
1147
|
+
};
|
|
1148
|
+
function cancelRenderInternal(scope, err) {
|
|
1149
|
+
let error;
|
|
1150
|
+
if (isErrorLike(err)) {
|
|
1151
|
+
error = err;
|
|
1152
|
+
if (!error.stack) {
|
|
1153
|
+
error.stack = new Error(error.message).stack;
|
|
1154
|
+
}
|
|
1155
|
+
} else if (typeof err === "string") {
|
|
1156
|
+
error = Error(err);
|
|
1157
|
+
} else {
|
|
1158
|
+
error = Error("Rendering was cancelled");
|
|
1159
|
+
}
|
|
1160
|
+
if (scope) {
|
|
1161
|
+
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
1162
|
+
}
|
|
1163
|
+
throw error;
|
|
1164
|
+
}
|
|
1165
|
+
function cancelRender(err) {
|
|
1166
|
+
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
1167
|
+
}
|
|
1115
1168
|
function getNodeEnvString() {
|
|
1116
1169
|
return ["NOD", "E_EN", "V"].join("");
|
|
1117
1170
|
}
|
|
@@ -1131,144 +1184,405 @@ var getRemotionEnvironment = () => {
|
|
|
1131
1184
|
isClientSideRendering: false
|
|
1132
1185
|
};
|
|
1133
1186
|
};
|
|
1134
|
-
var
|
|
1135
|
-
var
|
|
1136
|
-
|
|
1137
|
-
const [env] = useState(() => getRemotionEnvironment());
|
|
1138
|
-
return context ?? env;
|
|
1139
|
-
};
|
|
1140
|
-
var CompositionManager = createContext4({
|
|
1141
|
-
compositions: [],
|
|
1142
|
-
folders: [],
|
|
1143
|
-
currentCompositionMetadata: null,
|
|
1144
|
-
canvasContent: null
|
|
1145
|
-
});
|
|
1146
|
-
var CompositionSetters = createContext4({
|
|
1147
|
-
registerComposition: () => {
|
|
1148
|
-
return;
|
|
1149
|
-
},
|
|
1150
|
-
unregisterComposition: () => {
|
|
1151
|
-
return;
|
|
1152
|
-
},
|
|
1153
|
-
registerFolder: () => {
|
|
1154
|
-
return;
|
|
1155
|
-
},
|
|
1156
|
-
unregisterFolder: () => {
|
|
1157
|
-
return;
|
|
1158
|
-
},
|
|
1159
|
-
setCanvasContent: () => {
|
|
1160
|
-
return;
|
|
1161
|
-
},
|
|
1162
|
-
updateCompositionDefaultProps: () => {
|
|
1163
|
-
return;
|
|
1164
|
-
},
|
|
1165
|
-
onlyRenderComposition: null
|
|
1166
|
-
});
|
|
1167
|
-
var getKey = () => {
|
|
1168
|
-
return `remotion_inputPropsOverride` + window.location.origin;
|
|
1169
|
-
};
|
|
1170
|
-
var getInputPropsOverride = () => {
|
|
1171
|
-
if (typeof localStorage === "undefined")
|
|
1172
|
-
return null;
|
|
1173
|
-
const override = localStorage.getItem(getKey());
|
|
1174
|
-
if (!override)
|
|
1175
|
-
return null;
|
|
1176
|
-
return JSON.parse(override);
|
|
1187
|
+
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
1188
|
+
var getNumberForLogLevel = (level) => {
|
|
1189
|
+
return logLevels.indexOf(level);
|
|
1177
1190
|
};
|
|
1178
|
-
var
|
|
1179
|
-
|
|
1180
|
-
return;
|
|
1181
|
-
if (override === null) {
|
|
1182
|
-
localStorage.removeItem(getKey());
|
|
1183
|
-
return;
|
|
1184
|
-
}
|
|
1185
|
-
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
1191
|
+
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
1192
|
+
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
1186
1193
|
};
|
|
1187
|
-
var
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
indent,
|
|
1192
|
-
staticBase
|
|
1194
|
+
var transformArgs = ({
|
|
1195
|
+
args,
|
|
1196
|
+
logLevel,
|
|
1197
|
+
tag
|
|
1193
1198
|
}) => {
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
let setUsed = false;
|
|
1198
|
-
try {
|
|
1199
|
-
const serializedString = JSON.stringify(data, function(key, value) {
|
|
1200
|
-
const item = this[key];
|
|
1201
|
-
if (item instanceof Date) {
|
|
1202
|
-
customDateUsed = true;
|
|
1203
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
1204
|
-
}
|
|
1205
|
-
if (item instanceof Map) {
|
|
1206
|
-
mapUsed = true;
|
|
1207
|
-
return value;
|
|
1208
|
-
}
|
|
1209
|
-
if (item instanceof Set) {
|
|
1210
|
-
setUsed = true;
|
|
1211
|
-
return value;
|
|
1212
|
-
}
|
|
1213
|
-
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
1214
|
-
customFileUsed = true;
|
|
1215
|
-
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
1216
|
-
}
|
|
1217
|
-
return value;
|
|
1218
|
-
}, indent);
|
|
1219
|
-
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
1220
|
-
} catch (err) {
|
|
1221
|
-
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
1199
|
+
const arr = [...args];
|
|
1200
|
+
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
1201
|
+
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
1222
1202
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
return JSON.parse(data, (_, value) => {
|
|
1226
|
-
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
1227
|
-
return new Date(value.replace(DATE_TOKEN, ""));
|
|
1228
|
-
}
|
|
1229
|
-
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
1230
|
-
return `${window.remotion_staticBase}/${value.replace(FILE_TOKEN, "")}`;
|
|
1231
|
-
}
|
|
1232
|
-
return value;
|
|
1233
|
-
});
|
|
1234
|
-
};
|
|
1235
|
-
var serializeThenDeserialize = (props) => {
|
|
1236
|
-
return deserializeJSONWithSpecialTypes(serializeJSONWithSpecialTypes({
|
|
1237
|
-
data: props,
|
|
1238
|
-
indent: 2,
|
|
1239
|
-
staticBase: window.remotion_staticBase
|
|
1240
|
-
}).serializedString);
|
|
1241
|
-
};
|
|
1242
|
-
var serializeThenDeserializeInStudio = (props) => {
|
|
1243
|
-
if (getRemotionEnvironment().isStudio) {
|
|
1244
|
-
return serializeThenDeserialize(props);
|
|
1203
|
+
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
1204
|
+
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
1245
1205
|
}
|
|
1246
|
-
return
|
|
1206
|
+
return arr;
|
|
1247
1207
|
};
|
|
1248
|
-
var
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
return;
|
|
1208
|
+
var verbose = (options, ...args) => {
|
|
1209
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
1210
|
+
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
1252
1211
|
}
|
|
1253
|
-
didWarnSSRImport = true;
|
|
1254
|
-
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
1255
|
-
console.warn("To hide this warning, don't call this function on the server:");
|
|
1256
|
-
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
1257
1212
|
};
|
|
1258
|
-
var
|
|
1259
|
-
if (
|
|
1260
|
-
|
|
1261
|
-
return {};
|
|
1262
|
-
}
|
|
1263
|
-
if (getRemotionEnvironment().isPlayer) {
|
|
1264
|
-
throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
|
|
1213
|
+
var trace = (options, ...args) => {
|
|
1214
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
1215
|
+
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
1265
1216
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1217
|
+
};
|
|
1218
|
+
var info = (options, ...args) => {
|
|
1219
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
1220
|
+
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
1269
1221
|
}
|
|
1270
|
-
|
|
1271
|
-
|
|
1222
|
+
};
|
|
1223
|
+
var warn = (options, ...args) => {
|
|
1224
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
1225
|
+
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
var error = (options, ...args) => {
|
|
1229
|
+
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
1230
|
+
};
|
|
1231
|
+
var Log = {
|
|
1232
|
+
trace,
|
|
1233
|
+
verbose,
|
|
1234
|
+
info,
|
|
1235
|
+
warn,
|
|
1236
|
+
error
|
|
1237
|
+
};
|
|
1238
|
+
if (typeof window !== "undefined") {
|
|
1239
|
+
window.remotion_renderReady = false;
|
|
1240
|
+
if (!window.remotion_delayRenderTimeouts) {
|
|
1241
|
+
window.remotion_delayRenderTimeouts = {};
|
|
1242
|
+
}
|
|
1243
|
+
window.remotion_delayRenderHandles = [];
|
|
1244
|
+
}
|
|
1245
|
+
var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
|
|
1246
|
+
var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
|
|
1247
|
+
var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
|
|
1248
|
+
var DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
|
|
1249
|
+
var defaultTimeout = 30000;
|
|
1250
|
+
var delayRenderInternal = ({
|
|
1251
|
+
scope,
|
|
1252
|
+
environment,
|
|
1253
|
+
label,
|
|
1254
|
+
options
|
|
1255
|
+
}) => {
|
|
1256
|
+
if (typeof label !== "string" && label !== null) {
|
|
1257
|
+
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
|
|
1258
|
+
}
|
|
1259
|
+
const handle = Math.random();
|
|
1260
|
+
scope.remotion_delayRenderHandles.push(handle);
|
|
1261
|
+
const called = Error().stack?.replace(/^Error/g, "") ?? "";
|
|
1262
|
+
if (environment.isRendering) {
|
|
1263
|
+
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
1264
|
+
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
1265
|
+
scope.remotion_delayRenderTimeouts[handle] = {
|
|
1266
|
+
label: label ?? null,
|
|
1267
|
+
startTime: Date.now(),
|
|
1268
|
+
timeout: setTimeout(() => {
|
|
1269
|
+
const message = [
|
|
1270
|
+
`A delayRender()`,
|
|
1271
|
+
label ? `"${label}"` : null,
|
|
1272
|
+
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
1273
|
+
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
1274
|
+
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
1275
|
+
DELAY_RENDER_CALLSTACK_TOKEN,
|
|
1276
|
+
called
|
|
1277
|
+
].filter(truthy).join(" ");
|
|
1278
|
+
if (environment.isClientSideRendering) {
|
|
1279
|
+
scope.remotion_cancelledError = getErrorStackWithMessage(Error(message));
|
|
1280
|
+
} else {
|
|
1281
|
+
cancelRenderInternal(scope, Error(message));
|
|
1282
|
+
}
|
|
1283
|
+
}, timeoutToUse)
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
scope.remotion_renderReady = false;
|
|
1287
|
+
return handle;
|
|
1288
|
+
};
|
|
1289
|
+
var continueRenderInternal = ({
|
|
1290
|
+
scope,
|
|
1291
|
+
handle,
|
|
1292
|
+
environment,
|
|
1293
|
+
logLevel
|
|
1294
|
+
}) => {
|
|
1295
|
+
if (typeof handle === "undefined") {
|
|
1296
|
+
throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
|
|
1297
|
+
}
|
|
1298
|
+
if (typeof handle !== "number") {
|
|
1299
|
+
throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
|
|
1300
|
+
}
|
|
1301
|
+
scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
|
|
1302
|
+
if (h === handle) {
|
|
1303
|
+
if (environment.isRendering && scope !== undefined) {
|
|
1304
|
+
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
1305
|
+
return false;
|
|
1306
|
+
}
|
|
1307
|
+
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
1308
|
+
clearTimeout(timeout);
|
|
1309
|
+
const message = [
|
|
1310
|
+
label ? `"${label}"` : "A handle",
|
|
1311
|
+
DELAY_RENDER_CLEAR_TOKEN,
|
|
1312
|
+
`${Date.now() - startTime}ms`
|
|
1313
|
+
].filter(truthy).join(" ");
|
|
1314
|
+
Log.verbose({ logLevel, tag: "delayRender()" }, message);
|
|
1315
|
+
delete scope.remotion_delayRenderTimeouts[handle];
|
|
1316
|
+
}
|
|
1317
|
+
return false;
|
|
1318
|
+
}
|
|
1319
|
+
return true;
|
|
1320
|
+
});
|
|
1321
|
+
if (scope.remotion_delayRenderHandles.length === 0) {
|
|
1322
|
+
scope.remotion_renderReady = true;
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1325
|
+
var LogLevelContext = createContext4({
|
|
1326
|
+
logLevel: "info",
|
|
1327
|
+
mountTime: 0
|
|
1328
|
+
});
|
|
1329
|
+
var useLogLevel = () => {
|
|
1330
|
+
const { logLevel } = React2.useContext(LogLevelContext);
|
|
1331
|
+
if (logLevel === null) {
|
|
1332
|
+
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
1333
|
+
}
|
|
1334
|
+
return logLevel;
|
|
1335
|
+
};
|
|
1336
|
+
var useMountTime = () => {
|
|
1337
|
+
const { mountTime } = React2.useContext(LogLevelContext);
|
|
1338
|
+
if (mountTime === null) {
|
|
1339
|
+
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
1340
|
+
}
|
|
1341
|
+
return mountTime;
|
|
1342
|
+
};
|
|
1343
|
+
var RemotionEnvironmentContext = React3.createContext(null);
|
|
1344
|
+
var useRemotionEnvironment = () => {
|
|
1345
|
+
const context = useContext3(RemotionEnvironmentContext);
|
|
1346
|
+
const [env] = useState(() => getRemotionEnvironment());
|
|
1347
|
+
return context ?? env;
|
|
1348
|
+
};
|
|
1349
|
+
var DelayRenderContextType = createContext5(null);
|
|
1350
|
+
var useDelayRender = () => {
|
|
1351
|
+
const environment = useRemotionEnvironment();
|
|
1352
|
+
const scope = useContext4(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
1353
|
+
const logLevel = useLogLevel();
|
|
1354
|
+
const delayRender2 = useCallback((label, options) => {
|
|
1355
|
+
if (!scope) {
|
|
1356
|
+
return Math.random();
|
|
1357
|
+
}
|
|
1358
|
+
return delayRenderInternal({
|
|
1359
|
+
scope,
|
|
1360
|
+
environment,
|
|
1361
|
+
label: label ?? null,
|
|
1362
|
+
options: options ?? {}
|
|
1363
|
+
});
|
|
1364
|
+
}, [environment, scope]);
|
|
1365
|
+
const continueRender2 = useCallback((handle) => {
|
|
1366
|
+
if (!scope) {
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
continueRenderInternal({
|
|
1370
|
+
scope,
|
|
1371
|
+
handle,
|
|
1372
|
+
environment,
|
|
1373
|
+
logLevel
|
|
1374
|
+
});
|
|
1375
|
+
}, [environment, logLevel, scope]);
|
|
1376
|
+
const cancelRender2 = useCallback((err) => {
|
|
1377
|
+
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
1378
|
+
}, [scope]);
|
|
1379
|
+
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
1380
|
+
};
|
|
1381
|
+
var SetTimelineContext = createContext6({
|
|
1382
|
+
setFrame: () => {
|
|
1383
|
+
throw new Error("default");
|
|
1384
|
+
},
|
|
1385
|
+
setPlaying: () => {
|
|
1386
|
+
throw new Error("default");
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
var TimelineContext = createContext6(null);
|
|
1390
|
+
var AbsoluteTimeContext = createContext6(null);
|
|
1391
|
+
var TimelineContextProvider = ({ children, frameState }) => {
|
|
1392
|
+
const [playing, setPlaying] = useState2(false);
|
|
1393
|
+
const imperativePlaying = useRef(false);
|
|
1394
|
+
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
1395
|
+
const audioAndVideoTags = useRef([]);
|
|
1396
|
+
const [remotionRootId] = useState2(() => String(random(null)));
|
|
1397
|
+
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
1398
|
+
const frame = frameState ?? _frame;
|
|
1399
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
1400
|
+
if (typeof window !== "undefined") {
|
|
1401
|
+
useLayoutEffect(() => {
|
|
1402
|
+
window.remotion_setFrame = (f, composition, attempt) => {
|
|
1403
|
+
window.remotion_attempt = attempt;
|
|
1404
|
+
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
1405
|
+
let asyncUpdate = true;
|
|
1406
|
+
setFrame((s) => {
|
|
1407
|
+
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
1408
|
+
if (currentFrame === f) {
|
|
1409
|
+
asyncUpdate = false;
|
|
1410
|
+
return s;
|
|
1411
|
+
}
|
|
1412
|
+
return {
|
|
1413
|
+
...s,
|
|
1414
|
+
[composition]: f
|
|
1415
|
+
};
|
|
1416
|
+
});
|
|
1417
|
+
if (asyncUpdate) {
|
|
1418
|
+
requestAnimationFrame(() => continueRender2(id));
|
|
1419
|
+
} else {
|
|
1420
|
+
continueRender2(id);
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
window.remotion_isPlayer = false;
|
|
1424
|
+
}, [continueRender2, delayRender2]);
|
|
1425
|
+
}
|
|
1426
|
+
const timelineContextValue = useMemo2(() => {
|
|
1427
|
+
return {
|
|
1428
|
+
frame,
|
|
1429
|
+
playing,
|
|
1430
|
+
imperativePlaying,
|
|
1431
|
+
rootId: remotionRootId,
|
|
1432
|
+
playbackRate,
|
|
1433
|
+
setPlaybackRate,
|
|
1434
|
+
audioAndVideoTags
|
|
1435
|
+
};
|
|
1436
|
+
}, [frame, playbackRate, playing, remotionRootId]);
|
|
1437
|
+
const setTimelineContextValue = useMemo2(() => {
|
|
1438
|
+
return {
|
|
1439
|
+
setFrame,
|
|
1440
|
+
setPlaying
|
|
1441
|
+
};
|
|
1442
|
+
}, []);
|
|
1443
|
+
return /* @__PURE__ */ jsx3(AbsoluteTimeContext.Provider, {
|
|
1444
|
+
value: timelineContextValue,
|
|
1445
|
+
children: /* @__PURE__ */ jsx3(TimelineContext.Provider, {
|
|
1446
|
+
value: timelineContextValue,
|
|
1447
|
+
children: /* @__PURE__ */ jsx3(SetTimelineContext.Provider, {
|
|
1448
|
+
value: setTimelineContextValue,
|
|
1449
|
+
children
|
|
1450
|
+
})
|
|
1451
|
+
})
|
|
1452
|
+
});
|
|
1453
|
+
};
|
|
1454
|
+
var CompositionManager = createContext7({
|
|
1455
|
+
compositions: [],
|
|
1456
|
+
folders: [],
|
|
1457
|
+
currentCompositionMetadata: null,
|
|
1458
|
+
canvasContent: null
|
|
1459
|
+
});
|
|
1460
|
+
var CompositionSetters = createContext7({
|
|
1461
|
+
registerComposition: () => {
|
|
1462
|
+
return;
|
|
1463
|
+
},
|
|
1464
|
+
unregisterComposition: () => {
|
|
1465
|
+
return;
|
|
1466
|
+
},
|
|
1467
|
+
registerFolder: () => {
|
|
1468
|
+
return;
|
|
1469
|
+
},
|
|
1470
|
+
unregisterFolder: () => {
|
|
1471
|
+
return;
|
|
1472
|
+
},
|
|
1473
|
+
setCanvasContent: () => {
|
|
1474
|
+
return;
|
|
1475
|
+
},
|
|
1476
|
+
updateCompositionDefaultProps: () => {
|
|
1477
|
+
return;
|
|
1478
|
+
},
|
|
1479
|
+
onlyRenderComposition: null
|
|
1480
|
+
});
|
|
1481
|
+
var getKey = () => {
|
|
1482
|
+
return `remotion_inputPropsOverride` + window.location.origin;
|
|
1483
|
+
};
|
|
1484
|
+
var getInputPropsOverride = () => {
|
|
1485
|
+
if (typeof localStorage === "undefined")
|
|
1486
|
+
return null;
|
|
1487
|
+
const override = localStorage.getItem(getKey());
|
|
1488
|
+
if (!override)
|
|
1489
|
+
return null;
|
|
1490
|
+
return JSON.parse(override);
|
|
1491
|
+
};
|
|
1492
|
+
var setInputPropsOverride = (override) => {
|
|
1493
|
+
if (typeof localStorage === "undefined")
|
|
1494
|
+
return;
|
|
1495
|
+
if (override === null) {
|
|
1496
|
+
localStorage.removeItem(getKey());
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
localStorage.setItem(getKey(), JSON.stringify(override));
|
|
1500
|
+
};
|
|
1501
|
+
var DATE_TOKEN = "remotion-date:";
|
|
1502
|
+
var FILE_TOKEN = "remotion-file:";
|
|
1503
|
+
var serializeJSONWithSpecialTypes = ({
|
|
1504
|
+
data,
|
|
1505
|
+
indent,
|
|
1506
|
+
staticBase
|
|
1507
|
+
}) => {
|
|
1508
|
+
let customDateUsed = false;
|
|
1509
|
+
let customFileUsed = false;
|
|
1510
|
+
let mapUsed = false;
|
|
1511
|
+
let setUsed = false;
|
|
1512
|
+
try {
|
|
1513
|
+
const serializedString = JSON.stringify(data, function(key, value) {
|
|
1514
|
+
const item = this[key];
|
|
1515
|
+
if (item instanceof Date) {
|
|
1516
|
+
customDateUsed = true;
|
|
1517
|
+
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
1518
|
+
}
|
|
1519
|
+
if (item instanceof Map) {
|
|
1520
|
+
mapUsed = true;
|
|
1521
|
+
return value;
|
|
1522
|
+
}
|
|
1523
|
+
if (item instanceof Set) {
|
|
1524
|
+
setUsed = true;
|
|
1525
|
+
return value;
|
|
1526
|
+
}
|
|
1527
|
+
if (typeof item === "string" && staticBase !== null && item.startsWith(staticBase)) {
|
|
1528
|
+
customFileUsed = true;
|
|
1529
|
+
return `${FILE_TOKEN}${item.replace(staticBase + "/", "")}`;
|
|
1530
|
+
}
|
|
1531
|
+
return value;
|
|
1532
|
+
}, indent);
|
|
1533
|
+
return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
|
|
1534
|
+
} catch (err) {
|
|
1535
|
+
throw new Error("Could not serialize the passed input props to JSON: " + err.message);
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
var deserializeJSONWithSpecialTypes = (data) => {
|
|
1539
|
+
return JSON.parse(data, (_, value) => {
|
|
1540
|
+
if (typeof value === "string" && value.startsWith(DATE_TOKEN)) {
|
|
1541
|
+
return new Date(value.replace(DATE_TOKEN, ""));
|
|
1542
|
+
}
|
|
1543
|
+
if (typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
1544
|
+
return `${window.remotion_staticBase}/${value.replace(FILE_TOKEN, "")}`;
|
|
1545
|
+
}
|
|
1546
|
+
return value;
|
|
1547
|
+
});
|
|
1548
|
+
};
|
|
1549
|
+
var serializeThenDeserialize = (props) => {
|
|
1550
|
+
return deserializeJSONWithSpecialTypes(serializeJSONWithSpecialTypes({
|
|
1551
|
+
data: props,
|
|
1552
|
+
indent: 2,
|
|
1553
|
+
staticBase: window.remotion_staticBase
|
|
1554
|
+
}).serializedString);
|
|
1555
|
+
};
|
|
1556
|
+
var serializeThenDeserializeInStudio = (props) => {
|
|
1557
|
+
if (getRemotionEnvironment().isStudio) {
|
|
1558
|
+
return serializeThenDeserialize(props);
|
|
1559
|
+
}
|
|
1560
|
+
return props;
|
|
1561
|
+
};
|
|
1562
|
+
var didWarnSSRImport = false;
|
|
1563
|
+
var warnOnceSSRImport = () => {
|
|
1564
|
+
if (didWarnSSRImport) {
|
|
1565
|
+
return;
|
|
1566
|
+
}
|
|
1567
|
+
didWarnSSRImport = true;
|
|
1568
|
+
console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.");
|
|
1569
|
+
console.warn("To hide this warning, don't call this function on the server:");
|
|
1570
|
+
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
1571
|
+
};
|
|
1572
|
+
var getInputProps = () => {
|
|
1573
|
+
if (typeof window === "undefined") {
|
|
1574
|
+
warnOnceSSRImport();
|
|
1575
|
+
return {};
|
|
1576
|
+
}
|
|
1577
|
+
if (getRemotionEnvironment().isPlayer) {
|
|
1578
|
+
throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");
|
|
1579
|
+
}
|
|
1580
|
+
const override = getInputPropsOverride();
|
|
1581
|
+
if (override) {
|
|
1582
|
+
return override;
|
|
1583
|
+
}
|
|
1584
|
+
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
1585
|
+
throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
|
|
1272
1586
|
}
|
|
1273
1587
|
const param = window.remotion_inputProps;
|
|
1274
1588
|
if (!param) {
|
|
@@ -1277,7 +1591,7 @@ var getInputProps = () => {
|
|
|
1277
1591
|
const parsed = deserializeJSONWithSpecialTypes(param);
|
|
1278
1592
|
return parsed;
|
|
1279
1593
|
};
|
|
1280
|
-
var EditorPropsContext =
|
|
1594
|
+
var EditorPropsContext = createContext8({
|
|
1281
1595
|
props: {},
|
|
1282
1596
|
updateProps: () => {
|
|
1283
1597
|
throw new Error("Not implemented");
|
|
@@ -1286,11 +1600,11 @@ var EditorPropsContext = createContext5({
|
|
|
1286
1600
|
throw new Error("Not implemented");
|
|
1287
1601
|
}
|
|
1288
1602
|
});
|
|
1289
|
-
var editorPropsProviderRef =
|
|
1290
|
-
var timeValueRef =
|
|
1603
|
+
var editorPropsProviderRef = React5.createRef();
|
|
1604
|
+
var timeValueRef = React5.createRef();
|
|
1291
1605
|
var EditorPropsProvider = ({ children }) => {
|
|
1292
|
-
const [props, setProps] =
|
|
1293
|
-
const updateProps =
|
|
1606
|
+
const [props, setProps] = React5.useState({});
|
|
1607
|
+
const updateProps = useCallback2(({
|
|
1294
1608
|
defaultProps,
|
|
1295
1609
|
id,
|
|
1296
1610
|
newProps
|
|
@@ -1302,7 +1616,7 @@ var EditorPropsProvider = ({ children }) => {
|
|
|
1302
1616
|
};
|
|
1303
1617
|
});
|
|
1304
1618
|
}, []);
|
|
1305
|
-
const resetUnsaved =
|
|
1619
|
+
const resetUnsaved = useCallback2((compositionId) => {
|
|
1306
1620
|
setProps((prev) => {
|
|
1307
1621
|
if (prev[compositionId]) {
|
|
1308
1622
|
const newProps = { ...prev };
|
|
@@ -1318,10 +1632,10 @@ var EditorPropsProvider = ({ children }) => {
|
|
|
1318
1632
|
setProps
|
|
1319
1633
|
};
|
|
1320
1634
|
}, [props]);
|
|
1321
|
-
const ctx =
|
|
1635
|
+
const ctx = useMemo3(() => {
|
|
1322
1636
|
return { props, updateProps, resetUnsaved };
|
|
1323
1637
|
}, [props, resetUnsaved, updateProps]);
|
|
1324
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ jsx4(EditorPropsContext.Provider, {
|
|
1325
1639
|
value: ctx,
|
|
1326
1640
|
children
|
|
1327
1641
|
});
|
|
@@ -1378,24 +1692,24 @@ function validateFps(fps, location, isGif) {
|
|
|
1378
1692
|
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
1379
1693
|
}
|
|
1380
1694
|
}
|
|
1381
|
-
var ResolveCompositionContext =
|
|
1695
|
+
var ResolveCompositionContext = createContext9(null);
|
|
1382
1696
|
var resolveCompositionsRef = createRef();
|
|
1383
1697
|
var needsResolution = (composition) => {
|
|
1384
1698
|
return Boolean(composition.calculateMetadata);
|
|
1385
1699
|
};
|
|
1386
1700
|
var PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally";
|
|
1387
1701
|
var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
1388
|
-
const context =
|
|
1389
|
-
const { props: allEditorProps } =
|
|
1390
|
-
const { compositions, canvasContent, currentCompositionMetadata } =
|
|
1702
|
+
const context = useContext5(ResolveCompositionContext);
|
|
1703
|
+
const { props: allEditorProps } = useContext5(EditorPropsContext);
|
|
1704
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
1391
1705
|
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
1392
1706
|
const compositionId = preferredCompositionId ?? currentComposition;
|
|
1393
1707
|
const composition = compositions.find((c) => c.id === compositionId);
|
|
1394
|
-
const selectedEditorProps =
|
|
1708
|
+
const selectedEditorProps = useMemo4(() => {
|
|
1395
1709
|
return composition ? allEditorProps[composition.id] ?? {} : {};
|
|
1396
1710
|
}, [allEditorProps, composition]);
|
|
1397
1711
|
const env = useRemotionEnvironment();
|
|
1398
|
-
return
|
|
1712
|
+
return useMemo4(() => {
|
|
1399
1713
|
if (!composition) {
|
|
1400
1714
|
return null;
|
|
1401
1715
|
}
|
|
@@ -1455,12 +1769,12 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
1455
1769
|
]);
|
|
1456
1770
|
};
|
|
1457
1771
|
var useVideo = () => {
|
|
1458
|
-
const { canvasContent, compositions, currentCompositionMetadata } =
|
|
1772
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext6(CompositionManager);
|
|
1459
1773
|
const selected = compositions.find((c) => {
|
|
1460
1774
|
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
1461
1775
|
});
|
|
1462
1776
|
const resolved = useResolvedVideoConfig(selected?.id ?? null);
|
|
1463
|
-
return
|
|
1777
|
+
return useMemo5(() => {
|
|
1464
1778
|
if (!resolved) {
|
|
1465
1779
|
return null;
|
|
1466
1780
|
}
|
|
@@ -1479,367 +1793,66 @@ var useVideo = () => {
|
|
|
1479
1793
|
id: selected.id,
|
|
1480
1794
|
...currentCompositionMetadata ?? {},
|
|
1481
1795
|
component: selected.component
|
|
1482
|
-
};
|
|
1483
|
-
}, [currentCompositionMetadata, resolved, selected]);
|
|
1484
|
-
};
|
|
1485
|
-
var makeKey = () => {
|
|
1486
|
-
return `remotion.time-all`;
|
|
1487
|
-
};
|
|
1488
|
-
var persistCurrentFrame = (time) => {
|
|
1489
|
-
localStorage.setItem(makeKey(), JSON.stringify(time));
|
|
1490
|
-
};
|
|
1491
|
-
var getInitialFrameState = () => {
|
|
1492
|
-
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
1493
|
-
const obj = JSON.parse(item);
|
|
1494
|
-
return obj;
|
|
1495
|
-
};
|
|
1496
|
-
var getFrameForComposition = (composition) => {
|
|
1497
|
-
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
1498
|
-
const obj = JSON.parse(item);
|
|
1499
|
-
if (obj[composition] !== undefined) {
|
|
1500
|
-
return Number(obj[composition]);
|
|
1501
|
-
}
|
|
1502
|
-
if (typeof window === "undefined") {
|
|
1503
|
-
return 0;
|
|
1504
|
-
}
|
|
1505
|
-
return window.remotion_initialFrame ?? 0;
|
|
1506
|
-
};
|
|
1507
|
-
var useTimelinePosition = () => {
|
|
1508
|
-
const videoConfig = useVideo();
|
|
1509
|
-
const state = useContext5(TimelineContext);
|
|
1510
|
-
const env = useRemotionEnvironment();
|
|
1511
|
-
if (!videoConfig) {
|
|
1512
|
-
return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
|
|
1513
|
-
}
|
|
1514
|
-
const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
|
|
1515
|
-
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
1516
|
-
};
|
|
1517
|
-
var useTimelineSetFrame = () => {
|
|
1518
|
-
const { setFrame } = useContext5(SetTimelineContext);
|
|
1519
|
-
return setFrame;
|
|
1520
|
-
};
|
|
1521
|
-
var usePlayingState = () => {
|
|
1522
|
-
const { playing, imperativePlaying } = useContext5(TimelineContext);
|
|
1523
|
-
const { setPlaying } = useContext5(SetTimelineContext);
|
|
1524
|
-
return useMemo5(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
1525
|
-
};
|
|
1526
|
-
var getErrorStackWithMessage = (error) => {
|
|
1527
|
-
const stack = error.stack ?? "";
|
|
1528
|
-
return stack.startsWith("Error:") ? stack : `${error.message}
|
|
1529
|
-
${stack}`;
|
|
1530
|
-
};
|
|
1531
|
-
var isErrorLike = (err) => {
|
|
1532
|
-
if (err instanceof Error) {
|
|
1533
|
-
return true;
|
|
1534
|
-
}
|
|
1535
|
-
if (err === null) {
|
|
1536
|
-
return false;
|
|
1537
|
-
}
|
|
1538
|
-
if (typeof err !== "object") {
|
|
1539
|
-
return false;
|
|
1540
|
-
}
|
|
1541
|
-
if (!("stack" in err)) {
|
|
1542
|
-
return false;
|
|
1543
|
-
}
|
|
1544
|
-
if (typeof err.stack !== "string") {
|
|
1545
|
-
return false;
|
|
1546
|
-
}
|
|
1547
|
-
if (!("message" in err)) {
|
|
1548
|
-
return false;
|
|
1549
|
-
}
|
|
1550
|
-
if (typeof err.message !== "string") {
|
|
1551
|
-
return false;
|
|
1552
|
-
}
|
|
1553
|
-
return true;
|
|
1554
|
-
};
|
|
1555
|
-
function cancelRenderInternal(scope, err) {
|
|
1556
|
-
let error;
|
|
1557
|
-
if (isErrorLike(err)) {
|
|
1558
|
-
error = err;
|
|
1559
|
-
if (!error.stack) {
|
|
1560
|
-
error.stack = new Error(error.message).stack;
|
|
1561
|
-
}
|
|
1562
|
-
} else if (typeof err === "string") {
|
|
1563
|
-
error = Error(err);
|
|
1564
|
-
} else {
|
|
1565
|
-
error = Error("Rendering was cancelled");
|
|
1566
|
-
}
|
|
1567
|
-
if (scope) {
|
|
1568
|
-
scope.remotion_cancelledError = getErrorStackWithMessage(error);
|
|
1569
|
-
}
|
|
1570
|
-
throw error;
|
|
1571
|
-
}
|
|
1572
|
-
function cancelRender(err) {
|
|
1573
|
-
return cancelRenderInternal(typeof window !== "undefined" ? window : undefined, err);
|
|
1574
|
-
}
|
|
1575
|
-
var logLevels = ["trace", "verbose", "info", "warn", "error"];
|
|
1576
|
-
var getNumberForLogLevel = (level) => {
|
|
1577
|
-
return logLevels.indexOf(level);
|
|
1578
|
-
};
|
|
1579
|
-
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
1580
|
-
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
1581
|
-
};
|
|
1582
|
-
var transformArgs = ({
|
|
1583
|
-
args,
|
|
1584
|
-
logLevel,
|
|
1585
|
-
tag
|
|
1586
|
-
}) => {
|
|
1587
|
-
const arr = [...args];
|
|
1588
|
-
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
1589
|
-
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
1590
|
-
}
|
|
1591
|
-
if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
1592
|
-
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
1593
|
-
}
|
|
1594
|
-
return arr;
|
|
1595
|
-
};
|
|
1596
|
-
var verbose = (options, ...args) => {
|
|
1597
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
1598
|
-
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
1599
|
-
}
|
|
1600
|
-
};
|
|
1601
|
-
var trace = (options, ...args) => {
|
|
1602
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
1603
|
-
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
1604
|
-
}
|
|
1605
|
-
};
|
|
1606
|
-
var info = (options, ...args) => {
|
|
1607
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
1608
|
-
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
1609
|
-
}
|
|
1610
|
-
};
|
|
1611
|
-
var warn = (options, ...args) => {
|
|
1612
|
-
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
1613
|
-
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
var error = (options, ...args) => {
|
|
1617
|
-
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
1618
|
-
};
|
|
1619
|
-
var Log = {
|
|
1620
|
-
trace,
|
|
1621
|
-
verbose,
|
|
1622
|
-
info,
|
|
1623
|
-
warn,
|
|
1624
|
-
error
|
|
1625
|
-
};
|
|
1626
|
-
if (typeof window !== "undefined") {
|
|
1627
|
-
window.remotion_renderReady = false;
|
|
1628
|
-
if (!window.remotion_delayRenderTimeouts) {
|
|
1629
|
-
window.remotion_delayRenderTimeouts = {};
|
|
1630
|
-
}
|
|
1631
|
-
window.remotion_delayRenderHandles = [];
|
|
1632
|
-
}
|
|
1633
|
-
var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
|
|
1634
|
-
var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
|
|
1635
|
-
var DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
|
|
1636
|
-
var DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
|
|
1637
|
-
var defaultTimeout = 30000;
|
|
1638
|
-
var delayRenderInternal = ({
|
|
1639
|
-
scope,
|
|
1640
|
-
environment,
|
|
1641
|
-
label,
|
|
1642
|
-
options
|
|
1643
|
-
}) => {
|
|
1644
|
-
if (typeof label !== "string" && label !== null) {
|
|
1645
|
-
throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
|
|
1646
|
-
}
|
|
1647
|
-
const handle = Math.random();
|
|
1648
|
-
scope.remotion_delayRenderHandles.push(handle);
|
|
1649
|
-
const called = Error().stack?.replace(/^Error/g, "") ?? "";
|
|
1650
|
-
if (environment.isRendering) {
|
|
1651
|
-
const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
|
|
1652
|
-
const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
|
|
1653
|
-
scope.remotion_delayRenderTimeouts[handle] = {
|
|
1654
|
-
label: label ?? null,
|
|
1655
|
-
startTime: Date.now(),
|
|
1656
|
-
timeout: setTimeout(() => {
|
|
1657
|
-
const message = [
|
|
1658
|
-
`A delayRender()`,
|
|
1659
|
-
label ? `"${label}"` : null,
|
|
1660
|
-
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
1661
|
-
retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
|
|
1662
|
-
retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
|
|
1663
|
-
DELAY_RENDER_CALLSTACK_TOKEN,
|
|
1664
|
-
called
|
|
1665
|
-
].filter(truthy).join(" ");
|
|
1666
|
-
if (environment.isClientSideRendering) {
|
|
1667
|
-
scope.remotion_cancelledError = getErrorStackWithMessage(Error(message));
|
|
1668
|
-
} else {
|
|
1669
|
-
cancelRenderInternal(scope, Error(message));
|
|
1670
|
-
}
|
|
1671
|
-
}, timeoutToUse)
|
|
1672
|
-
};
|
|
1673
|
-
}
|
|
1674
|
-
scope.remotion_renderReady = false;
|
|
1675
|
-
return handle;
|
|
1676
|
-
};
|
|
1677
|
-
var continueRenderInternal = ({
|
|
1678
|
-
scope,
|
|
1679
|
-
handle,
|
|
1680
|
-
environment,
|
|
1681
|
-
logLevel
|
|
1682
|
-
}) => {
|
|
1683
|
-
if (typeof handle === "undefined") {
|
|
1684
|
-
throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
|
|
1685
|
-
}
|
|
1686
|
-
if (typeof handle !== "number") {
|
|
1687
|
-
throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
|
|
1688
|
-
}
|
|
1689
|
-
scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
|
|
1690
|
-
if (h === handle) {
|
|
1691
|
-
if (environment.isRendering && scope !== undefined) {
|
|
1692
|
-
if (!scope.remotion_delayRenderTimeouts[handle]) {
|
|
1693
|
-
return false;
|
|
1694
|
-
}
|
|
1695
|
-
const { label, startTime, timeout } = scope.remotion_delayRenderTimeouts[handle];
|
|
1696
|
-
clearTimeout(timeout);
|
|
1697
|
-
const message = [
|
|
1698
|
-
label ? `"${label}"` : "A handle",
|
|
1699
|
-
DELAY_RENDER_CLEAR_TOKEN,
|
|
1700
|
-
`${Date.now() - startTime}ms`
|
|
1701
|
-
].filter(truthy).join(" ");
|
|
1702
|
-
Log.verbose({ logLevel, tag: "delayRender()" }, message);
|
|
1703
|
-
delete scope.remotion_delayRenderTimeouts[handle];
|
|
1704
|
-
}
|
|
1705
|
-
return false;
|
|
1706
|
-
}
|
|
1707
|
-
return true;
|
|
1708
|
-
});
|
|
1709
|
-
if (scope.remotion_delayRenderHandles.length === 0) {
|
|
1710
|
-
scope.remotion_renderReady = true;
|
|
1796
|
+
};
|
|
1797
|
+
}, [currentCompositionMetadata, resolved, selected]);
|
|
1798
|
+
};
|
|
1799
|
+
var makeKey = () => {
|
|
1800
|
+
return `remotion.time-all`;
|
|
1801
|
+
};
|
|
1802
|
+
var persistCurrentFrame = (time) => {
|
|
1803
|
+
localStorage.setItem(makeKey(), JSON.stringify(time));
|
|
1804
|
+
};
|
|
1805
|
+
var getInitialFrameState = () => {
|
|
1806
|
+
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
1807
|
+
const obj = JSON.parse(item);
|
|
1808
|
+
return obj;
|
|
1809
|
+
};
|
|
1810
|
+
var getFrameForComposition = (composition) => {
|
|
1811
|
+
const item = localStorage.getItem(makeKey()) ?? "{}";
|
|
1812
|
+
const obj = JSON.parse(item);
|
|
1813
|
+
if (obj[composition] !== undefined) {
|
|
1814
|
+
return Number(obj[composition]);
|
|
1815
|
+
}
|
|
1816
|
+
if (typeof window === "undefined") {
|
|
1817
|
+
return 0;
|
|
1711
1818
|
}
|
|
1819
|
+
return window.remotion_initialFrame ?? 0;
|
|
1712
1820
|
};
|
|
1713
|
-
var
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
const { logLevel } = React4.useContext(LogLevelContext);
|
|
1719
|
-
if (logLevel === null) {
|
|
1720
|
-
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
1821
|
+
var useTimelinePositionFromContext = (state) => {
|
|
1822
|
+
const videoConfig = useVideo();
|
|
1823
|
+
const env = useRemotionEnvironment();
|
|
1824
|
+
if (!videoConfig) {
|
|
1825
|
+
return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
|
|
1721
1826
|
}
|
|
1722
|
-
|
|
1827
|
+
const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
|
|
1828
|
+
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
1723
1829
|
};
|
|
1724
|
-
var
|
|
1725
|
-
const
|
|
1726
|
-
if (
|
|
1727
|
-
throw new Error("
|
|
1830
|
+
var useTimelineContext = () => {
|
|
1831
|
+
const state = useContext7(TimelineContext);
|
|
1832
|
+
if (state === null) {
|
|
1833
|
+
throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
1728
1834
|
}
|
|
1729
|
-
return
|
|
1835
|
+
return state;
|
|
1730
1836
|
};
|
|
1731
|
-
var
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
1735
|
-
const logLevel = useLogLevel();
|
|
1736
|
-
const delayRender2 = useCallback2((label, options) => {
|
|
1737
|
-
if (!scope) {
|
|
1738
|
-
return Math.random();
|
|
1739
|
-
}
|
|
1740
|
-
return delayRenderInternal({
|
|
1741
|
-
scope,
|
|
1742
|
-
environment,
|
|
1743
|
-
label: label ?? null,
|
|
1744
|
-
options: options ?? {}
|
|
1745
|
-
});
|
|
1746
|
-
}, [environment, scope]);
|
|
1747
|
-
const continueRender2 = useCallback2((handle) => {
|
|
1748
|
-
if (!scope) {
|
|
1749
|
-
return;
|
|
1750
|
-
}
|
|
1751
|
-
continueRenderInternal({
|
|
1752
|
-
scope,
|
|
1753
|
-
handle,
|
|
1754
|
-
environment,
|
|
1755
|
-
logLevel
|
|
1756
|
-
});
|
|
1757
|
-
}, [environment, logLevel, scope]);
|
|
1758
|
-
const cancelRender2 = useCallback2((err) => {
|
|
1759
|
-
return cancelRenderInternal(scope ?? (typeof window !== "undefined" ? window : undefined), err);
|
|
1760
|
-
}, [scope]);
|
|
1761
|
-
return { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 };
|
|
1837
|
+
var useTimelinePosition = () => {
|
|
1838
|
+
const state = useTimelineContext();
|
|
1839
|
+
return useTimelinePositionFromContext(state);
|
|
1762
1840
|
};
|
|
1763
|
-
var
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
setPlaying: () => {
|
|
1768
|
-
throw new Error("default");
|
|
1769
|
-
}
|
|
1770
|
-
});
|
|
1771
|
-
var TimelineContext = createContext9({
|
|
1772
|
-
frame: {},
|
|
1773
|
-
playing: false,
|
|
1774
|
-
playbackRate: 1,
|
|
1775
|
-
rootId: "",
|
|
1776
|
-
imperativePlaying: {
|
|
1777
|
-
current: false
|
|
1778
|
-
},
|
|
1779
|
-
setPlaybackRate: () => {
|
|
1780
|
-
throw new Error("default");
|
|
1781
|
-
},
|
|
1782
|
-
audioAndVideoTags: { current: [] }
|
|
1783
|
-
});
|
|
1784
|
-
var TimelineContextProvider = ({ children, frameState }) => {
|
|
1785
|
-
const [playing, setPlaying] = useState2(false);
|
|
1786
|
-
const imperativePlaying = useRef(false);
|
|
1787
|
-
const [playbackRate, setPlaybackRate] = useState2(1);
|
|
1788
|
-
const audioAndVideoTags = useRef([]);
|
|
1789
|
-
const [remotionRootId] = useState2(() => String(random(null)));
|
|
1790
|
-
const [_frame, setFrame] = useState2(() => getInitialFrameState());
|
|
1791
|
-
const frame = frameState ?? _frame;
|
|
1792
|
-
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
1793
|
-
if (typeof window !== "undefined") {
|
|
1794
|
-
useLayoutEffect(() => {
|
|
1795
|
-
window.remotion_setFrame = (f, composition, attempt) => {
|
|
1796
|
-
window.remotion_attempt = attempt;
|
|
1797
|
-
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
1798
|
-
let asyncUpdate = true;
|
|
1799
|
-
setFrame((s) => {
|
|
1800
|
-
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
1801
|
-
if (currentFrame === f) {
|
|
1802
|
-
asyncUpdate = false;
|
|
1803
|
-
return s;
|
|
1804
|
-
}
|
|
1805
|
-
return {
|
|
1806
|
-
...s,
|
|
1807
|
-
[composition]: f
|
|
1808
|
-
};
|
|
1809
|
-
});
|
|
1810
|
-
if (asyncUpdate) {
|
|
1811
|
-
requestAnimationFrame(() => continueRender2(id));
|
|
1812
|
-
} else {
|
|
1813
|
-
continueRender2(id);
|
|
1814
|
-
}
|
|
1815
|
-
};
|
|
1816
|
-
window.remotion_isPlayer = false;
|
|
1817
|
-
}, [continueRender2, delayRender2]);
|
|
1841
|
+
var useAbsoluteTimelinePosition = () => {
|
|
1842
|
+
const state = useContext7(AbsoluteTimeContext);
|
|
1843
|
+
if (state === null) {
|
|
1844
|
+
throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");
|
|
1818
1845
|
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
}, [frame, playbackRate, playing, remotionRootId]);
|
|
1830
|
-
const setTimelineContextValue = useMemo6(() => {
|
|
1831
|
-
return {
|
|
1832
|
-
setFrame,
|
|
1833
|
-
setPlaying
|
|
1834
|
-
};
|
|
1835
|
-
}, []);
|
|
1836
|
-
return /* @__PURE__ */ jsx4(TimelineContext.Provider, {
|
|
1837
|
-
value: timelineContextValue,
|
|
1838
|
-
children: /* @__PURE__ */ jsx4(SetTimelineContext.Provider, {
|
|
1839
|
-
value: setTimelineContextValue,
|
|
1840
|
-
children
|
|
1841
|
-
})
|
|
1842
|
-
});
|
|
1846
|
+
return useTimelinePositionFromContext(state);
|
|
1847
|
+
};
|
|
1848
|
+
var useTimelineSetFrame = () => {
|
|
1849
|
+
const { setFrame } = useContext7(SetTimelineContext);
|
|
1850
|
+
return setFrame;
|
|
1851
|
+
};
|
|
1852
|
+
var usePlayingState = () => {
|
|
1853
|
+
const { playing, imperativePlaying } = useTimelineContext();
|
|
1854
|
+
const { setPlaying } = useContext7(SetTimelineContext);
|
|
1855
|
+
return useMemo6(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
1843
1856
|
};
|
|
1844
1857
|
var CanUseRemotionHooks = createContext10(false);
|
|
1845
1858
|
var CanUseRemotionHooksProvider = ({ children }) => {
|
|
@@ -1948,7 +1961,7 @@ var Freeze = ({
|
|
|
1948
1961
|
return active(frame);
|
|
1949
1962
|
}
|
|
1950
1963
|
}, [active, frame]);
|
|
1951
|
-
const timelineContext =
|
|
1964
|
+
const timelineContext = useTimelineContext();
|
|
1952
1965
|
const sequenceContext = useContext11(SequenceContext);
|
|
1953
1966
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
1954
1967
|
const timelineValue = useMemo8(() => {
|
|
@@ -1989,18 +2002,36 @@ var Freeze = ({
|
|
|
1989
2002
|
var NonceContext = createContext11({
|
|
1990
2003
|
getNonce: () => 0
|
|
1991
2004
|
});
|
|
2005
|
+
var fastRefreshNonce = 0;
|
|
2006
|
+
try {
|
|
2007
|
+
if (typeof __webpack_module__ !== "undefined") {
|
|
2008
|
+
if (__webpack_module__.hot) {
|
|
2009
|
+
__webpack_module__.hot.addStatusHandler((status) => {
|
|
2010
|
+
if (status === "idle") {
|
|
2011
|
+
fastRefreshNonce++;
|
|
2012
|
+
}
|
|
2013
|
+
});
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
} catch {}
|
|
1992
2017
|
var useNonce = () => {
|
|
1993
2018
|
const context = useContext12(NonceContext);
|
|
1994
|
-
const
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2019
|
+
const nonce = context.getNonce();
|
|
2020
|
+
const nonceRef = useRef2(nonce);
|
|
2021
|
+
nonceRef.current = nonce;
|
|
2022
|
+
const history = useRef2([[fastRefreshNonce, nonce]]);
|
|
2023
|
+
const get = useCallback3(() => {
|
|
2024
|
+
if (fastRefreshNonce !== history.current[history.current.length - 1][0]) {
|
|
2025
|
+
history.current = [
|
|
2026
|
+
...history.current,
|
|
2027
|
+
[fastRefreshNonce, nonceRef.current]
|
|
2028
|
+
];
|
|
1999
2029
|
}
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2030
|
+
return history.current;
|
|
2031
|
+
}, [history]);
|
|
2032
|
+
return useMemo9(() => {
|
|
2033
|
+
return { get };
|
|
2034
|
+
}, [get]);
|
|
2004
2035
|
};
|
|
2005
2036
|
var PremountContext = createContext12({
|
|
2006
2037
|
premountFramesRemaining: 0,
|
|
@@ -2021,22 +2052,28 @@ var SequenceVisibilityToggleContext = React8.createContext({
|
|
|
2021
2052
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
2022
2053
|
}
|
|
2023
2054
|
});
|
|
2024
|
-
var
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
throw new Error("
|
|
2055
|
+
var VisualModeOverridesContext = React8.createContext({
|
|
2056
|
+
dragOverrides: {},
|
|
2057
|
+
setDragOverrides: () => {
|
|
2058
|
+
throw new Error("VisualModeOverridesContext not initialized");
|
|
2028
2059
|
},
|
|
2029
|
-
|
|
2030
|
-
throw new Error("
|
|
2031
|
-
}
|
|
2060
|
+
clearDragOverrides: () => {
|
|
2061
|
+
throw new Error("VisualModeOverridesContext not initialized");
|
|
2062
|
+
},
|
|
2063
|
+
codeValues: {},
|
|
2064
|
+
setCodeValues: () => {
|
|
2065
|
+
throw new Error("VisualModeOverridesContext not initialized");
|
|
2066
|
+
},
|
|
2067
|
+
visualModeEnabled: false
|
|
2032
2068
|
});
|
|
2033
|
-
var SequenceManagerProvider = ({ children }) => {
|
|
2034
|
-
const [sequences, setSequences] =
|
|
2035
|
-
const [hidden, setHidden] =
|
|
2036
|
-
const [
|
|
2037
|
-
const controlOverridesRef = useRef3(
|
|
2038
|
-
controlOverridesRef.current =
|
|
2039
|
-
const
|
|
2069
|
+
var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
2070
|
+
const [sequences, setSequences] = useState3([]);
|
|
2071
|
+
const [hidden, setHidden] = useState3({});
|
|
2072
|
+
const [dragOverrides, setControlOverrides] = useState3({});
|
|
2073
|
+
const controlOverridesRef = useRef3(dragOverrides);
|
|
2074
|
+
controlOverridesRef.current = dragOverrides;
|
|
2075
|
+
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
2076
|
+
const setDragOverrides = useCallback4((sequenceId, key, value) => {
|
|
2040
2077
|
setControlOverrides((prev) => ({
|
|
2041
2078
|
...prev,
|
|
2042
2079
|
[sequenceId]: {
|
|
@@ -2045,7 +2082,7 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2045
2082
|
}
|
|
2046
2083
|
}));
|
|
2047
2084
|
}, []);
|
|
2048
|
-
const
|
|
2085
|
+
const clearDragOverrides = useCallback4((sequenceId) => {
|
|
2049
2086
|
setControlOverrides((prev) => {
|
|
2050
2087
|
if (!prev[sequenceId]) {
|
|
2051
2088
|
return prev;
|
|
@@ -2055,39 +2092,65 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
2055
2092
|
return next;
|
|
2056
2093
|
});
|
|
2057
2094
|
}, []);
|
|
2058
|
-
const
|
|
2095
|
+
const setCodeValues = useCallback4((sequenceId, values) => {
|
|
2096
|
+
setCodeValuesMapState((prev) => {
|
|
2097
|
+
if (prev[sequenceId] === values) {
|
|
2098
|
+
return prev;
|
|
2099
|
+
}
|
|
2100
|
+
if (values === null) {
|
|
2101
|
+
if (!(sequenceId in prev)) {
|
|
2102
|
+
return prev;
|
|
2103
|
+
}
|
|
2104
|
+
const next = { ...prev };
|
|
2105
|
+
delete next[sequenceId];
|
|
2106
|
+
return next;
|
|
2107
|
+
}
|
|
2108
|
+
return { ...prev, [sequenceId]: values };
|
|
2109
|
+
});
|
|
2110
|
+
}, []);
|
|
2111
|
+
const registerSequence = useCallback4((seq) => {
|
|
2059
2112
|
setSequences((seqs) => {
|
|
2060
2113
|
return [...seqs, seq];
|
|
2061
2114
|
});
|
|
2062
2115
|
}, []);
|
|
2063
|
-
const unregisterSequence =
|
|
2116
|
+
const unregisterSequence = useCallback4((seq) => {
|
|
2064
2117
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
2065
2118
|
}, []);
|
|
2066
|
-
const sequenceContext =
|
|
2119
|
+
const sequenceContext = useMemo10(() => {
|
|
2067
2120
|
return {
|
|
2068
2121
|
registerSequence,
|
|
2069
2122
|
sequences,
|
|
2070
2123
|
unregisterSequence
|
|
2071
2124
|
};
|
|
2072
2125
|
}, [registerSequence, sequences, unregisterSequence]);
|
|
2073
|
-
const hiddenContext =
|
|
2126
|
+
const hiddenContext = useMemo10(() => {
|
|
2074
2127
|
return {
|
|
2075
2128
|
hidden,
|
|
2076
2129
|
setHidden
|
|
2077
2130
|
};
|
|
2078
2131
|
}, [hidden]);
|
|
2079
|
-
const overrideContext =
|
|
2132
|
+
const overrideContext = useMemo10(() => {
|
|
2080
2133
|
return {
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2134
|
+
visualModeEnabled,
|
|
2135
|
+
dragOverrides,
|
|
2136
|
+
setDragOverrides,
|
|
2137
|
+
clearDragOverrides,
|
|
2138
|
+
codeValues,
|
|
2139
|
+
setCodeValues
|
|
2084
2140
|
};
|
|
2085
|
-
}, [
|
|
2141
|
+
}, [
|
|
2142
|
+
visualModeEnabled,
|
|
2143
|
+
dragOverrides,
|
|
2144
|
+
setDragOverrides,
|
|
2145
|
+
clearDragOverrides,
|
|
2146
|
+
codeValues,
|
|
2147
|
+
setCodeValues
|
|
2148
|
+
]);
|
|
2086
2149
|
return /* @__PURE__ */ jsx7(SequenceManager.Provider, {
|
|
2087
2150
|
value: sequenceContext,
|
|
2088
2151
|
children: /* @__PURE__ */ jsx7(SequenceVisibilityToggleContext.Provider, {
|
|
2089
2152
|
value: hiddenContext,
|
|
2090
|
-
children: /* @__PURE__ */ jsx7(
|
|
2153
|
+
children: /* @__PURE__ */ jsx7(VisualModeOverridesContext.Provider, {
|
|
2091
2154
|
value: overrideContext,
|
|
2092
2155
|
children
|
|
2093
2156
|
})
|
|
@@ -2111,9 +2174,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2111
2174
|
...other
|
|
2112
2175
|
}, ref) => {
|
|
2113
2176
|
const { layout = "absolute-fill" } = other;
|
|
2114
|
-
const [id] =
|
|
2177
|
+
const [id] = useState4(() => String(Math.random()));
|
|
2115
2178
|
const parentSequence = useContext13(SequenceContext);
|
|
2116
|
-
const { rootId } =
|
|
2179
|
+
const { rootId } = useTimelineContext();
|
|
2117
2180
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
2118
2181
|
const nonce = useNonce();
|
|
2119
2182
|
if (layout !== "absolute-fill" && layout !== "none") {
|
|
@@ -2140,13 +2203,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2140
2203
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
2141
2204
|
const { registerSequence, unregisterSequence } = useContext13(SequenceManager);
|
|
2142
2205
|
const { hidden } = useContext13(SequenceVisibilityToggleContext);
|
|
2143
|
-
const premounting =
|
|
2206
|
+
const premounting = useMemo11(() => {
|
|
2144
2207
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
2145
2208
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
2146
|
-
const postmounting =
|
|
2209
|
+
const postmounting = useMemo11(() => {
|
|
2147
2210
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
2148
2211
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
2149
|
-
const contextValue =
|
|
2212
|
+
const contextValue = useMemo11(() => {
|
|
2150
2213
|
return {
|
|
2151
2214
|
cumulatedFrom,
|
|
2152
2215
|
relativeFrom: from,
|
|
@@ -2173,12 +2236,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2173
2236
|
premountDisplay,
|
|
2174
2237
|
postmountDisplay
|
|
2175
2238
|
]);
|
|
2176
|
-
const timelineClipName =
|
|
2239
|
+
const timelineClipName = useMemo11(() => {
|
|
2177
2240
|
return name ?? "";
|
|
2178
2241
|
}, [name]);
|
|
2179
2242
|
const env = useRemotionEnvironment();
|
|
2180
2243
|
const inheritedStack = other?.stack ?? null;
|
|
2181
|
-
|
|
2244
|
+
useEffect(() => {
|
|
2182
2245
|
if (!env.isStudio) {
|
|
2183
2246
|
return;
|
|
2184
2247
|
}
|
|
@@ -2191,7 +2254,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2191
2254
|
type: "sequence",
|
|
2192
2255
|
rootId,
|
|
2193
2256
|
showInTimeline,
|
|
2194
|
-
nonce,
|
|
2257
|
+
nonce: nonce.get(),
|
|
2195
2258
|
loopDisplay,
|
|
2196
2259
|
stack: stack ?? inheritedStack,
|
|
2197
2260
|
premountDisplay: premountDisplay ?? null,
|
|
@@ -2225,7 +2288,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2225
2288
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
2226
2289
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
2227
2290
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
2228
|
-
const defaultStyle =
|
|
2291
|
+
const defaultStyle = useMemo11(() => {
|
|
2229
2292
|
return {
|
|
2230
2293
|
flexDirection: undefined,
|
|
2231
2294
|
...width ? { width } : {},
|
|
@@ -2252,7 +2315,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2252
2315
|
};
|
|
2253
2316
|
var RegularSequence = forwardRef2(RegularSequenceRefForwardingFunction);
|
|
2254
2317
|
var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
2255
|
-
const
|
|
2318
|
+
const parentPremountContext = useContext13(PremountContext);
|
|
2319
|
+
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
2256
2320
|
if (props.layout === "none") {
|
|
2257
2321
|
throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');
|
|
2258
2322
|
}
|
|
@@ -2271,7 +2335,7 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
2271
2335
|
const postmountingActive = frame > endThreshold && frame <= endThreshold + postmountFor;
|
|
2272
2336
|
const freezeFrame = premountingActive ? from : postmountingActive ? from + durationInFrames - 1 : 0;
|
|
2273
2337
|
const isFreezingActive = premountingActive || postmountingActive;
|
|
2274
|
-
const style =
|
|
2338
|
+
const style = useMemo11(() => {
|
|
2275
2339
|
return {
|
|
2276
2340
|
...passedStyle,
|
|
2277
2341
|
opacity: premountingActive || postmountingActive ? 0 : 1,
|
|
@@ -2286,10 +2350,9 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
2286
2350
|
styleWhilePremounted,
|
|
2287
2351
|
styleWhilePostmounted
|
|
2288
2352
|
]);
|
|
2289
|
-
const
|
|
2290
|
-
const
|
|
2291
|
-
const
|
|
2292
|
-
const premountContextValue = useMemo10(() => {
|
|
2353
|
+
const { playing } = useTimelineContext();
|
|
2354
|
+
const premountFramesRemaining = premountingActive ? from - frame : 0;
|
|
2355
|
+
const premountContextValue = useMemo11(() => {
|
|
2293
2356
|
return {
|
|
2294
2357
|
premountFramesRemaining,
|
|
2295
2358
|
playing: parentPremountContext.playing || playing
|
|
@@ -2384,7 +2447,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
2384
2447
|
};
|
|
2385
2448
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
2386
2449
|
const canvasRef = useRef4(null);
|
|
2387
|
-
const draw =
|
|
2450
|
+
const draw = useCallback5((imageData) => {
|
|
2388
2451
|
const canvas = canvasRef.current;
|
|
2389
2452
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
2390
2453
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -2587,7 +2650,7 @@ var AnimatedImage = forwardRef3(({
|
|
|
2587
2650
|
...props
|
|
2588
2651
|
}, canvasRef) => {
|
|
2589
2652
|
const mountState = useRef5({ isMounted: true });
|
|
2590
|
-
|
|
2653
|
+
useEffect2(() => {
|
|
2591
2654
|
const { current } = mountState;
|
|
2592
2655
|
current.isMounted = true;
|
|
2593
2656
|
return () => {
|
|
@@ -2595,9 +2658,9 @@ var AnimatedImage = forwardRef3(({
|
|
|
2595
2658
|
};
|
|
2596
2659
|
}, []);
|
|
2597
2660
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
2598
|
-
const [imageDecoder, setImageDecoder] =
|
|
2661
|
+
const [imageDecoder, setImageDecoder] = useState5(null);
|
|
2599
2662
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
2600
|
-
const [decodeHandle] =
|
|
2663
|
+
const [decodeHandle] = useState5(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
|
|
2601
2664
|
const frame = useCurrentFrame();
|
|
2602
2665
|
const { fps } = useVideoConfig();
|
|
2603
2666
|
const currentTime = frame / playbackRate / fps;
|
|
@@ -2611,8 +2674,8 @@ var AnimatedImage = forwardRef3(({
|
|
|
2611
2674
|
}
|
|
2612
2675
|
return c;
|
|
2613
2676
|
}, []);
|
|
2614
|
-
const [initialLoopBehavior] =
|
|
2615
|
-
|
|
2677
|
+
const [initialLoopBehavior] = useState5(() => loopBehavior);
|
|
2678
|
+
useEffect2(() => {
|
|
2616
2679
|
const controller = new AbortController;
|
|
2617
2680
|
decodeImage({
|
|
2618
2681
|
resolvedSrc,
|
|
@@ -2722,9 +2785,9 @@ var RenderAssetManager = createContext13({
|
|
|
2722
2785
|
renderAssets: []
|
|
2723
2786
|
});
|
|
2724
2787
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
2725
|
-
const [renderAssets, setRenderAssets] =
|
|
2788
|
+
const [renderAssets, setRenderAssets] = useState6([]);
|
|
2726
2789
|
const renderAssetsRef = useRef6([]);
|
|
2727
|
-
const registerRenderAsset =
|
|
2790
|
+
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
2728
2791
|
validateRenderAsset(renderAsset);
|
|
2729
2792
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
2730
2793
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -2741,7 +2804,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
2741
2804
|
};
|
|
2742
2805
|
}, []);
|
|
2743
2806
|
}
|
|
2744
|
-
const unregisterRenderAsset =
|
|
2807
|
+
const unregisterRenderAsset = useCallback6((id) => {
|
|
2745
2808
|
renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
|
|
2746
2809
|
setRenderAssets(renderAssetsRef.current);
|
|
2747
2810
|
}, []);
|
|
@@ -2755,7 +2818,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
2755
2818
|
};
|
|
2756
2819
|
}
|
|
2757
2820
|
}, []);
|
|
2758
|
-
const contextValue =
|
|
2821
|
+
const contextValue = useMemo12(() => {
|
|
2759
2822
|
return {
|
|
2760
2823
|
registerRenderAsset,
|
|
2761
2824
|
unregisterRenderAsset,
|
|
@@ -2772,7 +2835,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
2772
2835
|
const { registerRenderAsset, unregisterRenderAsset } = useContext14(RenderAssetManager);
|
|
2773
2836
|
const env = useRemotionEnvironment();
|
|
2774
2837
|
const frame = useCurrentFrame();
|
|
2775
|
-
const [id] =
|
|
2838
|
+
const [id] = useState7(() => {
|
|
2776
2839
|
return String(Math.random());
|
|
2777
2840
|
});
|
|
2778
2841
|
useLayoutEffect4(() => {
|
|
@@ -2877,14 +2940,14 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
2877
2940
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
2878
2941
|
const start = iteration * durationInFrames;
|
|
2879
2942
|
const from = Math.min(start, maxFrame);
|
|
2880
|
-
const loopDisplay =
|
|
2943
|
+
const loopDisplay = useMemo13(() => {
|
|
2881
2944
|
return {
|
|
2882
2945
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
2883
2946
|
startOffset: -from,
|
|
2884
2947
|
durationInFrames
|
|
2885
2948
|
};
|
|
2886
2949
|
}, [compDuration, durationInFrames, from, times]);
|
|
2887
|
-
const loopContext =
|
|
2950
|
+
const loopContext = useMemo13(() => {
|
|
2888
2951
|
return {
|
|
2889
2952
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
2890
2953
|
durationInFrames
|
|
@@ -2921,8 +2984,8 @@ var setPreloads = (updater) => {
|
|
|
2921
2984
|
updaters.forEach((u) => u());
|
|
2922
2985
|
};
|
|
2923
2986
|
var PrefetchProvider = ({ children }) => {
|
|
2924
|
-
const [_preloads, _setPreloads] =
|
|
2925
|
-
|
|
2987
|
+
const [_preloads, _setPreloads] = useState8(() => preloads);
|
|
2988
|
+
useEffect3(() => {
|
|
2926
2989
|
const updaterFunction = () => {
|
|
2927
2990
|
_setPreloads(preloads);
|
|
2928
2991
|
};
|
|
@@ -3242,7 +3305,7 @@ var DurationsContext = createContext16({
|
|
|
3242
3305
|
});
|
|
3243
3306
|
var DurationsContextProvider = ({ children }) => {
|
|
3244
3307
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
3245
|
-
const value =
|
|
3308
|
+
const value = useMemo14(() => {
|
|
3246
3309
|
return {
|
|
3247
3310
|
durations,
|
|
3248
3311
|
setDurations
|
|
@@ -3376,7 +3439,7 @@ var useSingletonAudioContext = ({
|
|
|
3376
3439
|
audioEnabled
|
|
3377
3440
|
}) => {
|
|
3378
3441
|
const env = useRemotionEnvironment();
|
|
3379
|
-
const audioContext =
|
|
3442
|
+
const audioContext = useMemo15(() => {
|
|
3380
3443
|
if (env.isRendering) {
|
|
3381
3444
|
return null;
|
|
3382
3445
|
}
|
|
@@ -3423,7 +3486,7 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
3423
3486
|
var SharedAudioContext = createContext17(null);
|
|
3424
3487
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
|
|
3425
3488
|
const audios = useRef7([]);
|
|
3426
|
-
const [initialNumberOfAudioTags] =
|
|
3489
|
+
const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
|
|
3427
3490
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
3428
3491
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
3429
3492
|
}
|
|
@@ -3433,7 +3496,64 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3433
3496
|
latencyHint: audioLatencyHint,
|
|
3434
3497
|
audioEnabled
|
|
3435
3498
|
});
|
|
3436
|
-
const
|
|
3499
|
+
const audioSyncAnchor = useMemo16(() => ({ value: 0 }), []);
|
|
3500
|
+
const prevEndTimes = useRef7({ scheduledEndTime: null, mediaEndTime: null });
|
|
3501
|
+
const scheduleAudioNode = useMemo16(() => {
|
|
3502
|
+
return ({
|
|
3503
|
+
node,
|
|
3504
|
+
mediaTimestamp,
|
|
3505
|
+
targetTime,
|
|
3506
|
+
currentTime,
|
|
3507
|
+
sequenceEndTime,
|
|
3508
|
+
sequenceStartTime,
|
|
3509
|
+
debugAudioScheduling
|
|
3510
|
+
}) => {
|
|
3511
|
+
if (!audioContext) {
|
|
3512
|
+
throw new Error("Audio context not found");
|
|
3513
|
+
}
|
|
3514
|
+
const bufferDuration = node.buffer?.duration ?? 0;
|
|
3515
|
+
const unclampedMediaEndTime = mediaTimestamp + bufferDuration;
|
|
3516
|
+
const needsTrimEnd = unclampedMediaEndTime > sequenceEndTime;
|
|
3517
|
+
const needsTrimStart = mediaTimestamp < sequenceStartTime;
|
|
3518
|
+
const offsetBecauseOfTrim = needsTrimStart ? sequenceStartTime - mediaTimestamp : 0;
|
|
3519
|
+
const offsetBecauseOfTooLate = targetTime < 0 ? -targetTime : 0;
|
|
3520
|
+
const offset = offsetBecauseOfTrim + offsetBecauseOfTooLate;
|
|
3521
|
+
const duration = needsTrimEnd ? bufferDuration - Math.max(0, unclampedMediaEndTime - sequenceEndTime) - offset : bufferDuration - offset;
|
|
3522
|
+
const scheduledTime = targetTime + currentTime + offset;
|
|
3523
|
+
if (offset < 0) {
|
|
3524
|
+
throw new Error("offset < 0: " + JSON.stringify({
|
|
3525
|
+
offset,
|
|
3526
|
+
targetTime,
|
|
3527
|
+
currentTime,
|
|
3528
|
+
offsetBecauseOfTrim,
|
|
3529
|
+
offsetBecauseOfTooLate
|
|
3530
|
+
}));
|
|
3531
|
+
}
|
|
3532
|
+
if (duration > 0) {
|
|
3533
|
+
node.start(scheduledTime, offset, duration);
|
|
3534
|
+
}
|
|
3535
|
+
const scheduledEndTime = scheduledTime + duration / node.playbackRate.value;
|
|
3536
|
+
const mediaTime = mediaTimestamp + offset;
|
|
3537
|
+
const mediaEndTime = mediaTime + duration;
|
|
3538
|
+
const latency = audioContext.baseLatency + audioContext.outputLatency;
|
|
3539
|
+
const timeDiff = scheduledTime - currentTime - latency;
|
|
3540
|
+
const prev = prevEndTimes.current;
|
|
3541
|
+
const scheduledMismatch = prev.scheduledEndTime !== null && Math.abs(scheduledTime - prev.scheduledEndTime) > 0.001;
|
|
3542
|
+
const mediaMismatch = prev.mediaEndTime !== null && Math.abs(mediaTime - prev.mediaEndTime) > 0.001;
|
|
3543
|
+
if (debugAudioScheduling) {
|
|
3544
|
+
Log.info({ logLevel, tag: "audio-scheduling" }, "scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s", scheduledMismatch ? "color: red; font-weight: bold" : "", scheduledTime.toFixed(4), "", scheduledEndTime.toFixed(4), mediaMismatch ? "color: red; font-weight: bold" : "", mediaTime.toFixed(4), "", mediaEndTime.toFixed(4), duration < 0 ? "color: red; font-weight: bold" : timeDiff < 0 ? "color: red; font-weight: bold" : "color: blue; font-weight: bold", duration < 0 ? "missed " + Math.abs(offset).toFixed(2) + "s" : Math.abs(timeDiff).toFixed(2) + (timeDiff < 0 ? " delay" : " ahead"), "", "current=" + currentTime.toFixed(4), "offset=" + offset.toFixed(4), "latency=" + latency.toFixed(4), "state=" + audioContext.state);
|
|
3545
|
+
}
|
|
3546
|
+
prev.scheduledEndTime = scheduledEndTime;
|
|
3547
|
+
prev.mediaEndTime = mediaEndTime;
|
|
3548
|
+
return duration > 0 ? {
|
|
3549
|
+
type: "started",
|
|
3550
|
+
scheduledTime
|
|
3551
|
+
} : {
|
|
3552
|
+
type: "not-started"
|
|
3553
|
+
};
|
|
3554
|
+
};
|
|
3555
|
+
}, [audioContext, logLevel]);
|
|
3556
|
+
const refs = useMemo16(() => {
|
|
3437
3557
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
3438
3558
|
const ref = createRef2();
|
|
3439
3559
|
return {
|
|
@@ -3457,7 +3577,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3457
3577
|
};
|
|
3458
3578
|
}, [refs]);
|
|
3459
3579
|
const takenAudios = useRef7(new Array(numberOfAudioTags).fill(false));
|
|
3460
|
-
const rerenderAudios =
|
|
3580
|
+
const rerenderAudios = useCallback7(() => {
|
|
3461
3581
|
refs.forEach(({ ref, id }) => {
|
|
3462
3582
|
const data = audios.current?.find((a) => a.id === id);
|
|
3463
3583
|
const { current } = ref;
|
|
@@ -3478,7 +3598,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3478
3598
|
});
|
|
3479
3599
|
});
|
|
3480
3600
|
}, [refs]);
|
|
3481
|
-
const registerAudio =
|
|
3601
|
+
const registerAudio = useCallback7((options) => {
|
|
3482
3602
|
const { aud, audioId, premounting, postmounting } = options;
|
|
3483
3603
|
const found = audios.current?.find((a) => a.audioId === audioId);
|
|
3484
3604
|
if (found) {
|
|
@@ -3507,7 +3627,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3507
3627
|
rerenderAudios();
|
|
3508
3628
|
return newElem;
|
|
3509
3629
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
3510
|
-
const unregisterAudio =
|
|
3630
|
+
const unregisterAudio = useCallback7((id) => {
|
|
3511
3631
|
const cloned = [...takenAudios.current];
|
|
3512
3632
|
const index = refs.findIndex((r) => r.id === id);
|
|
3513
3633
|
if (index === -1) {
|
|
@@ -3518,7 +3638,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3518
3638
|
audios.current = audios.current?.filter((a) => a.id !== id);
|
|
3519
3639
|
rerenderAudios();
|
|
3520
3640
|
}, [refs, rerenderAudios]);
|
|
3521
|
-
const updateAudio =
|
|
3641
|
+
const updateAudio = useCallback7(({
|
|
3522
3642
|
aud,
|
|
3523
3643
|
audioId,
|
|
3524
3644
|
id,
|
|
@@ -3554,7 +3674,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3554
3674
|
}, [rerenderAudios]);
|
|
3555
3675
|
const mountTime = useMountTime();
|
|
3556
3676
|
const env = useRemotionEnvironment();
|
|
3557
|
-
const playAllAudios =
|
|
3677
|
+
const playAllAudios = useCallback7(() => {
|
|
3558
3678
|
refs.forEach((ref) => {
|
|
3559
3679
|
const audio = audios.current.find((a) => a.el === ref.ref);
|
|
3560
3680
|
if (audio?.premounting) {
|
|
@@ -3572,14 +3692,16 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3572
3692
|
});
|
|
3573
3693
|
audioContext?.resume();
|
|
3574
3694
|
}, [audioContext, logLevel, mountTime, refs, env.isPlayer]);
|
|
3575
|
-
const value =
|
|
3695
|
+
const value = useMemo16(() => {
|
|
3576
3696
|
return {
|
|
3577
3697
|
registerAudio,
|
|
3578
3698
|
unregisterAudio,
|
|
3579
3699
|
updateAudio,
|
|
3580
3700
|
playAllAudios,
|
|
3581
3701
|
numberOfAudioTags,
|
|
3582
|
-
audioContext
|
|
3702
|
+
audioContext,
|
|
3703
|
+
audioSyncAnchor,
|
|
3704
|
+
scheduleAudioNode
|
|
3583
3705
|
};
|
|
3584
3706
|
}, [
|
|
3585
3707
|
numberOfAudioTags,
|
|
@@ -3587,7 +3709,9 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3587
3709
|
registerAudio,
|
|
3588
3710
|
unregisterAudio,
|
|
3589
3711
|
updateAudio,
|
|
3590
|
-
audioContext
|
|
3712
|
+
audioContext,
|
|
3713
|
+
audioSyncAnchor,
|
|
3714
|
+
scheduleAudioNode
|
|
3591
3715
|
]);
|
|
3592
3716
|
return /* @__PURE__ */ jsxs2(SharedAudioContext.Provider, {
|
|
3593
3717
|
value,
|
|
@@ -3610,7 +3734,7 @@ var useSharedAudio = ({
|
|
|
3610
3734
|
postmounting
|
|
3611
3735
|
}) => {
|
|
3612
3736
|
const ctx = useContext16(SharedAudioContext);
|
|
3613
|
-
const [elem] =
|
|
3737
|
+
const [elem] = useState9(() => {
|
|
3614
3738
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
3615
3739
|
return ctx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
3616
3740
|
}
|
|
@@ -3904,7 +4028,7 @@ var useBasicMediaInTimeline = ({
|
|
|
3904
4028
|
const startsAt = useMediaStartsAt();
|
|
3905
4029
|
const parentSequence = useContext19(SequenceContext);
|
|
3906
4030
|
const videoConfig = useVideoConfig();
|
|
3907
|
-
const [initialVolume] =
|
|
4031
|
+
const [initialVolume] = useState10(() => volume);
|
|
3908
4032
|
const mediaDuration = calculateMediaDuration({
|
|
3909
4033
|
mediaDurationInFrames: videoConfig.durationInFrames,
|
|
3910
4034
|
playbackRate,
|
|
@@ -3912,7 +4036,7 @@ var useBasicMediaInTimeline = ({
|
|
|
3912
4036
|
trimAfter
|
|
3913
4037
|
});
|
|
3914
4038
|
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
|
|
3915
|
-
const volumes =
|
|
4039
|
+
const volumes = useMemo17(() => {
|
|
3916
4040
|
if (typeof volume === "number") {
|
|
3917
4041
|
return volume;
|
|
3918
4042
|
}
|
|
@@ -3924,14 +4048,14 @@ var useBasicMediaInTimeline = ({
|
|
|
3924
4048
|
});
|
|
3925
4049
|
}).join(",");
|
|
3926
4050
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
3927
|
-
|
|
4051
|
+
useEffect4(() => {
|
|
3928
4052
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
3929
4053
|
warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
|
|
3930
4054
|
}
|
|
3931
4055
|
}, [initialVolume, mediaType, src, volume]);
|
|
3932
4056
|
const doesVolumeChange = typeof volume === "function";
|
|
3933
4057
|
const nonce = useNonce();
|
|
3934
|
-
const { rootId } =
|
|
4058
|
+
const { rootId } = useTimelineContext();
|
|
3935
4059
|
const env = useRemotionEnvironment();
|
|
3936
4060
|
return {
|
|
3937
4061
|
volumes,
|
|
@@ -3978,7 +4102,7 @@ var useMediaInTimeline = ({
|
|
|
3978
4102
|
trimBefore: undefined,
|
|
3979
4103
|
playbackRate
|
|
3980
4104
|
});
|
|
3981
|
-
|
|
4105
|
+
useEffect4(() => {
|
|
3982
4106
|
if (!src) {
|
|
3983
4107
|
throw new Error("No src passed");
|
|
3984
4108
|
}
|
|
@@ -3999,7 +4123,7 @@ var useMediaInTimeline = ({
|
|
|
3999
4123
|
rootId,
|
|
4000
4124
|
volume: volumes,
|
|
4001
4125
|
showInTimeline: true,
|
|
4002
|
-
nonce,
|
|
4126
|
+
nonce: nonce.get(),
|
|
4003
4127
|
startMediaFrom: 0 - startsAt,
|
|
4004
4128
|
doesVolumeChange,
|
|
4005
4129
|
loopDisplay,
|
|
@@ -4036,13 +4160,13 @@ var useMediaInTimeline = ({
|
|
|
4036
4160
|
]);
|
|
4037
4161
|
};
|
|
4038
4162
|
var useBufferManager = (logLevel, mountTime) => {
|
|
4039
|
-
const [blocks, setBlocks] =
|
|
4040
|
-
const [onBufferingCallbacks, setOnBufferingCallbacks] =
|
|
4041
|
-
const [onResumeCallbacks, setOnResumeCallbacks] =
|
|
4163
|
+
const [blocks, setBlocks] = useState11([]);
|
|
4164
|
+
const [onBufferingCallbacks, setOnBufferingCallbacks] = useState11([]);
|
|
4165
|
+
const [onResumeCallbacks, setOnResumeCallbacks] = useState11([]);
|
|
4042
4166
|
const env = useRemotionEnvironment();
|
|
4043
4167
|
const rendering = env.isRendering;
|
|
4044
4168
|
const buffering = useRef10(false);
|
|
4045
|
-
const addBlock =
|
|
4169
|
+
const addBlock = useCallback8((block) => {
|
|
4046
4170
|
if (rendering) {
|
|
4047
4171
|
return {
|
|
4048
4172
|
unblock: () => {
|
|
@@ -4063,7 +4187,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4063
4187
|
}
|
|
4064
4188
|
};
|
|
4065
4189
|
}, [rendering]);
|
|
4066
|
-
const listenForBuffering =
|
|
4190
|
+
const listenForBuffering = useCallback8((callback) => {
|
|
4067
4191
|
setOnBufferingCallbacks((c) => [...c, callback]);
|
|
4068
4192
|
return {
|
|
4069
4193
|
remove: () => {
|
|
@@ -4071,7 +4195,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4071
4195
|
}
|
|
4072
4196
|
};
|
|
4073
4197
|
}, []);
|
|
4074
|
-
const listenForResume =
|
|
4198
|
+
const listenForResume = useCallback8((callback) => {
|
|
4075
4199
|
setOnResumeCallbacks((c) => [...c, callback]);
|
|
4076
4200
|
return {
|
|
4077
4201
|
remove: () => {
|
|
@@ -4079,7 +4203,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4079
4203
|
}
|
|
4080
4204
|
};
|
|
4081
4205
|
}, []);
|
|
4082
|
-
|
|
4206
|
+
useEffect5(() => {
|
|
4083
4207
|
if (rendering) {
|
|
4084
4208
|
return;
|
|
4085
4209
|
}
|
|
@@ -4109,7 +4233,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4109
4233
|
}
|
|
4110
4234
|
}, [blocks]);
|
|
4111
4235
|
}
|
|
4112
|
-
return
|
|
4236
|
+
return useMemo18(() => {
|
|
4113
4237
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
4114
4238
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
4115
4239
|
};
|
|
@@ -4123,8 +4247,8 @@ var BufferingProvider = ({ children }) => {
|
|
|
4123
4247
|
});
|
|
4124
4248
|
};
|
|
4125
4249
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
4126
|
-
const [isBuffering, setIsBuffering] =
|
|
4127
|
-
|
|
4250
|
+
const [isBuffering, setIsBuffering] = useState11(bufferManager.buffering.current);
|
|
4251
|
+
useEffect5(() => {
|
|
4128
4252
|
const onBuffer = () => {
|
|
4129
4253
|
setIsBuffering(true);
|
|
4130
4254
|
};
|
|
@@ -4147,7 +4271,7 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
4147
4271
|
var useBufferState = () => {
|
|
4148
4272
|
const buffer = useContext21(BufferingContextReact);
|
|
4149
4273
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
4150
|
-
return
|
|
4274
|
+
return useMemo19(() => ({
|
|
4151
4275
|
delayPlayback: () => {
|
|
4152
4276
|
if (!addBlock) {
|
|
4153
4277
|
throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
|
|
@@ -4173,7 +4297,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
4173
4297
|
}) => {
|
|
4174
4298
|
const bufferingRef = useRef11(false);
|
|
4175
4299
|
const { delayPlayback } = useBufferState();
|
|
4176
|
-
const bufferUntilFirstFrame =
|
|
4300
|
+
const bufferUntilFirstFrame = useCallback9((requestedTime) => {
|
|
4177
4301
|
if (mediaType !== "video") {
|
|
4178
4302
|
return;
|
|
4179
4303
|
}
|
|
@@ -4244,7 +4368,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
4244
4368
|
onVariableFpsVideoDetected,
|
|
4245
4369
|
pauseWhenBuffering
|
|
4246
4370
|
]);
|
|
4247
|
-
return
|
|
4371
|
+
return useMemo20(() => {
|
|
4248
4372
|
return {
|
|
4249
4373
|
isBuffering: () => bufferingRef.current,
|
|
4250
4374
|
bufferUntilFirstFrame
|
|
@@ -4292,8 +4416,8 @@ var useMediaBuffering = ({
|
|
|
4292
4416
|
src
|
|
4293
4417
|
}) => {
|
|
4294
4418
|
const buffer = useBufferState();
|
|
4295
|
-
const [isBuffering, setIsBuffering] =
|
|
4296
|
-
|
|
4419
|
+
const [isBuffering, setIsBuffering] = useState12(false);
|
|
4420
|
+
useEffect6(() => {
|
|
4297
4421
|
let cleanupFns = [];
|
|
4298
4422
|
const { current } = element;
|
|
4299
4423
|
if (!current) {
|
|
@@ -4426,7 +4550,7 @@ var useRequestVideoCallbackTime = ({
|
|
|
4426
4550
|
onVariableFpsVideoDetected
|
|
4427
4551
|
}) => {
|
|
4428
4552
|
const currentTime = useRef12(null);
|
|
4429
|
-
|
|
4553
|
+
useEffect7(() => {
|
|
4430
4554
|
const { current } = mediaRef;
|
|
4431
4555
|
if (current) {
|
|
4432
4556
|
currentTime.current = {
|
|
@@ -4646,7 +4770,7 @@ var useMediaPlayback = ({
|
|
|
4646
4770
|
isPostmounting,
|
|
4647
4771
|
onAutoPlayError
|
|
4648
4772
|
}) => {
|
|
4649
|
-
const { playbackRate: globalPlaybackRate } =
|
|
4773
|
+
const { playbackRate: globalPlaybackRate } = useTimelineContext();
|
|
4650
4774
|
const frame = useCurrentFrame();
|
|
4651
4775
|
const absoluteFrame = useTimelinePosition();
|
|
4652
4776
|
const [playing] = usePlayingState();
|
|
@@ -4661,7 +4785,7 @@ var useMediaPlayback = ({
|
|
|
4661
4785
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
4662
4786
|
}
|
|
4663
4787
|
const isVariableFpsVideoMap = useRef13({});
|
|
4664
|
-
const onVariableFpsVideoDetected =
|
|
4788
|
+
const onVariableFpsVideoDetected = useCallback10(() => {
|
|
4665
4789
|
if (!src) {
|
|
4666
4790
|
return;
|
|
4667
4791
|
}
|
|
@@ -4712,7 +4836,7 @@ var useMediaPlayback = ({
|
|
|
4712
4836
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
4713
4837
|
})();
|
|
4714
4838
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
4715
|
-
|
|
4839
|
+
useEffect8(() => {
|
|
4716
4840
|
if (mediaRef.current?.paused) {
|
|
4717
4841
|
return;
|
|
4718
4842
|
}
|
|
@@ -4757,7 +4881,7 @@ var useMediaPlayback = ({
|
|
|
4757
4881
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
4758
4882
|
}
|
|
4759
4883
|
}, [mediaRef, playbackRate]);
|
|
4760
|
-
|
|
4884
|
+
useEffect8(() => {
|
|
4761
4885
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
4762
4886
|
if (!mediaRef.current) {
|
|
4763
4887
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -4882,11 +5006,11 @@ var useMediaTag = ({
|
|
|
4882
5006
|
isPremounting,
|
|
4883
5007
|
isPostmounting
|
|
4884
5008
|
}) => {
|
|
4885
|
-
const { audioAndVideoTags, imperativePlaying } =
|
|
5009
|
+
const { audioAndVideoTags, imperativePlaying } = useTimelineContext();
|
|
4886
5010
|
const logLevel = useLogLevel();
|
|
4887
5011
|
const mountTime = useMountTime();
|
|
4888
5012
|
const env = useRemotionEnvironment();
|
|
4889
|
-
|
|
5013
|
+
useEffect9(() => {
|
|
4890
5014
|
const tag = {
|
|
4891
5015
|
id,
|
|
4892
5016
|
play: (reason) => {
|
|
@@ -4938,16 +5062,16 @@ var SetMediaVolumeContext = createContext18({
|
|
|
4938
5062
|
}
|
|
4939
5063
|
});
|
|
4940
5064
|
var useMediaVolumeState = () => {
|
|
4941
|
-
const { mediaVolume } =
|
|
4942
|
-
const { setMediaVolume } =
|
|
4943
|
-
return
|
|
5065
|
+
const { mediaVolume } = useContext23(MediaVolumeContext);
|
|
5066
|
+
const { setMediaVolume } = useContext23(SetMediaVolumeContext);
|
|
5067
|
+
return useMemo21(() => {
|
|
4944
5068
|
return [mediaVolume, setMediaVolume];
|
|
4945
5069
|
}, [mediaVolume, setMediaVolume]);
|
|
4946
5070
|
};
|
|
4947
5071
|
var useMediaMutedState = () => {
|
|
4948
|
-
const { mediaMuted } =
|
|
4949
|
-
const { setMediaMuted } =
|
|
4950
|
-
return
|
|
5072
|
+
const { mediaMuted } = useContext23(MediaVolumeContext);
|
|
5073
|
+
const { setMediaMuted } = useContext23(SetMediaVolumeContext);
|
|
5074
|
+
return useMemo21(() => {
|
|
4951
5075
|
return [mediaMuted, setMediaMuted];
|
|
4952
5076
|
}, [mediaMuted, setMediaMuted]);
|
|
4953
5077
|
};
|
|
@@ -4957,7 +5081,7 @@ var warnAboutTooHighVolume = (volume) => {
|
|
|
4957
5081
|
}
|
|
4958
5082
|
};
|
|
4959
5083
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
4960
|
-
const [initialShouldPreMountAudioElements] =
|
|
5084
|
+
const [initialShouldPreMountAudioElements] = useState13(props.shouldPreMountAudioTags);
|
|
4961
5085
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
4962
5086
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
4963
5087
|
}
|
|
@@ -4996,13 +5120,13 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
4996
5120
|
const [mediaVolume] = useMediaVolumeState();
|
|
4997
5121
|
const [mediaMuted] = useMediaMutedState();
|
|
4998
5122
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
4999
|
-
const { hidden } =
|
|
5123
|
+
const { hidden } = useContext24(SequenceVisibilityToggleContext);
|
|
5000
5124
|
if (!src) {
|
|
5001
5125
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
5002
5126
|
}
|
|
5003
5127
|
const preloadedSrc = usePreload(src);
|
|
5004
|
-
const sequenceContext =
|
|
5005
|
-
const [timelineId] =
|
|
5128
|
+
const sequenceContext = useContext24(SequenceContext);
|
|
5129
|
+
const [timelineId] = useState13(() => String(Math.random()));
|
|
5006
5130
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
5007
5131
|
const userPreferredVolume = evaluateVolume({
|
|
5008
5132
|
frame: volumePropFrame,
|
|
@@ -5015,7 +5139,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5015
5139
|
requestsVideoFrame: false,
|
|
5016
5140
|
isClientSideRendering: false
|
|
5017
5141
|
});
|
|
5018
|
-
const propsToPass =
|
|
5142
|
+
const propsToPass = useMemo22(() => {
|
|
5019
5143
|
return {
|
|
5020
5144
|
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
5021
5145
|
src: preloadedSrc,
|
|
@@ -5033,7 +5157,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5033
5157
|
userPreferredVolume,
|
|
5034
5158
|
crossOriginValue
|
|
5035
5159
|
]);
|
|
5036
|
-
const id =
|
|
5160
|
+
const id = useMemo22(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
5037
5161
|
src,
|
|
5038
5162
|
sequenceContext?.relativeFrom,
|
|
5039
5163
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5105,7 +5229,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5105
5229
|
}, [audioRef]);
|
|
5106
5230
|
const currentOnDurationCallback = useRef14(onDuration);
|
|
5107
5231
|
currentOnDurationCallback.current = onDuration;
|
|
5108
|
-
|
|
5232
|
+
useEffect10(() => {
|
|
5109
5233
|
const { current } = audioRef;
|
|
5110
5234
|
if (!current) {
|
|
5111
5235
|
return;
|
|
@@ -5156,10 +5280,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5156
5280
|
const absoluteFrame = useTimelinePosition();
|
|
5157
5281
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5158
5282
|
const frame = useCurrentFrame();
|
|
5159
|
-
const sequenceContext =
|
|
5160
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
5283
|
+
const sequenceContext = useContext25(SequenceContext);
|
|
5284
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext25(RenderAssetManager);
|
|
5161
5285
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
5162
|
-
const id =
|
|
5286
|
+
const id = useMemo23(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5163
5287
|
props.src,
|
|
5164
5288
|
sequenceContext?.relativeFrom,
|
|
5165
5289
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5174,7 +5298,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5174
5298
|
useImperativeHandle6(ref, () => {
|
|
5175
5299
|
return audioRef.current;
|
|
5176
5300
|
}, []);
|
|
5177
|
-
|
|
5301
|
+
useEffect11(() => {
|
|
5178
5302
|
if (!props.src) {
|
|
5179
5303
|
throw new Error("No src passed");
|
|
5180
5304
|
}
|
|
@@ -5266,7 +5390,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
5266
5390
|
};
|
|
5267
5391
|
var AudioForRendering = forwardRef5(AudioForRenderingRefForwardingFunction);
|
|
5268
5392
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
5269
|
-
const audioContext =
|
|
5393
|
+
const audioContext = useContext26(SharedAudioContext);
|
|
5270
5394
|
const {
|
|
5271
5395
|
startFrom,
|
|
5272
5396
|
endAt,
|
|
@@ -5285,12 +5409,12 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5285
5409
|
if (environment.isClientSideRendering) {
|
|
5286
5410
|
throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
5287
5411
|
}
|
|
5288
|
-
const { durations, setDurations } =
|
|
5412
|
+
const { durations, setDurations } = useContext26(DurationsContext);
|
|
5289
5413
|
if (typeof props.src !== "string") {
|
|
5290
5414
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
5291
5415
|
}
|
|
5292
5416
|
const preloadedSrc = usePreload(props.src);
|
|
5293
|
-
const onError =
|
|
5417
|
+
const onError = useCallback11((e) => {
|
|
5294
5418
|
console.log(e.currentTarget.error);
|
|
5295
5419
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
5296
5420
|
if (loop) {
|
|
@@ -5304,7 +5428,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5304
5428
|
console.warn(errMessage);
|
|
5305
5429
|
}
|
|
5306
5430
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
5307
|
-
const onDuration =
|
|
5431
|
+
const onDuration = useCallback11((src, durationInSeconds) => {
|
|
5308
5432
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
5309
5433
|
}, [setDurations]);
|
|
5310
5434
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -5478,7 +5602,7 @@ var useLazyComponent = ({
|
|
|
5478
5602
|
if ("component" in compProps) {
|
|
5479
5603
|
componentRef.current = compProps.component;
|
|
5480
5604
|
}
|
|
5481
|
-
const lazy =
|
|
5605
|
+
const lazy = useMemo25(() => {
|
|
5482
5606
|
if ("component" in compProps) {
|
|
5483
5607
|
if (typeof document === "undefined" || noSuspense) {
|
|
5484
5608
|
return compProps.component;
|
|
@@ -5523,7 +5647,7 @@ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
|
5523
5647
|
};
|
|
5524
5648
|
var Fallback = () => {
|
|
5525
5649
|
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
5526
|
-
|
|
5650
|
+
useEffect13(() => {
|
|
5527
5651
|
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
5528
5652
|
return () => continueRender2(fallback);
|
|
5529
5653
|
}, [continueRender2, delayRender2]);
|
|
@@ -5539,7 +5663,7 @@ var InnerComposition = ({
|
|
|
5539
5663
|
schema,
|
|
5540
5664
|
...compProps
|
|
5541
5665
|
}) => {
|
|
5542
|
-
const compManager =
|
|
5666
|
+
const compManager = useContext28(CompositionSetters);
|
|
5543
5667
|
const { registerComposition, unregisterComposition } = compManager;
|
|
5544
5668
|
const video = useVideo();
|
|
5545
5669
|
const lazy = useLazyComponent({
|
|
@@ -5550,7 +5674,7 @@ var InnerComposition = ({
|
|
|
5550
5674
|
const nonce = useNonce();
|
|
5551
5675
|
const isPlayer = useIsPlayer();
|
|
5552
5676
|
const environment = useRemotionEnvironment();
|
|
5553
|
-
const canUseComposition =
|
|
5677
|
+
const canUseComposition = useContext28(CanUseRemotionHooks);
|
|
5554
5678
|
if (typeof window !== "undefined") {
|
|
5555
5679
|
window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
|
|
5556
5680
|
}
|
|
@@ -5560,8 +5684,8 @@ var InnerComposition = ({
|
|
|
5560
5684
|
}
|
|
5561
5685
|
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
5562
5686
|
}
|
|
5563
|
-
const { folderName, parentName } =
|
|
5564
|
-
|
|
5687
|
+
const { folderName, parentName } = useContext28(FolderContext);
|
|
5688
|
+
useEffect13(() => {
|
|
5565
5689
|
if (!id) {
|
|
5566
5690
|
throw new Error("No id for composition passed.");
|
|
5567
5691
|
}
|
|
@@ -5576,7 +5700,7 @@ var InnerComposition = ({
|
|
|
5576
5700
|
folderName,
|
|
5577
5701
|
component: lazy,
|
|
5578
5702
|
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
5579
|
-
nonce,
|
|
5703
|
+
nonce: nonce.get(),
|
|
5580
5704
|
parentFolderName: parentName,
|
|
5581
5705
|
schema: schema ?? null,
|
|
5582
5706
|
calculateMetadata: compProps.calculateMetadata ?? null
|
|
@@ -5600,7 +5724,7 @@ var InnerComposition = ({
|
|
|
5600
5724
|
registerComposition,
|
|
5601
5725
|
unregisterComposition
|
|
5602
5726
|
]);
|
|
5603
|
-
|
|
5727
|
+
useEffect13(() => {
|
|
5604
5728
|
window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
|
|
5605
5729
|
detail: {
|
|
5606
5730
|
resetUnsaved: id
|
|
@@ -5639,7 +5763,7 @@ var InnerComposition = ({
|
|
|
5639
5763
|
return null;
|
|
5640
5764
|
};
|
|
5641
5765
|
var Composition = (props2) => {
|
|
5642
|
-
const { onlyRenderComposition } =
|
|
5766
|
+
const { onlyRenderComposition } = useContext28(CompositionSetters);
|
|
5643
5767
|
if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
|
|
5644
5768
|
return null;
|
|
5645
5769
|
}
|
|
@@ -5657,15 +5781,15 @@ var IFrameRefForwarding = ({
|
|
|
5657
5781
|
...props2
|
|
5658
5782
|
}, ref) => {
|
|
5659
5783
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
5660
|
-
const [handle] =
|
|
5784
|
+
const [handle] = useState14(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
5661
5785
|
retries: delayRenderRetries ?? undefined,
|
|
5662
5786
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
5663
5787
|
}));
|
|
5664
|
-
const didLoad =
|
|
5788
|
+
const didLoad = useCallback12((e) => {
|
|
5665
5789
|
continueRender2(handle);
|
|
5666
5790
|
onLoad?.(e);
|
|
5667
5791
|
}, [handle, onLoad, continueRender2]);
|
|
5668
|
-
const didGetError =
|
|
5792
|
+
const didGetError = useCallback12((e) => {
|
|
5669
5793
|
continueRender2(handle);
|
|
5670
5794
|
if (onError) {
|
|
5671
5795
|
onError(e);
|
|
@@ -5699,7 +5823,7 @@ var ImgRefForwarding = ({
|
|
|
5699
5823
|
const imageRef = useRef17(null);
|
|
5700
5824
|
const errors = useRef17({});
|
|
5701
5825
|
const { delayPlayback } = useBufferState();
|
|
5702
|
-
const sequenceContext =
|
|
5826
|
+
const sequenceContext = useContext29(SequenceContext);
|
|
5703
5827
|
if (!src) {
|
|
5704
5828
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
5705
5829
|
}
|
|
@@ -5711,7 +5835,7 @@ var ImgRefForwarding = ({
|
|
|
5711
5835
|
return imageRef.current;
|
|
5712
5836
|
}, []);
|
|
5713
5837
|
const actualSrc = usePreload(src);
|
|
5714
|
-
const retryIn =
|
|
5838
|
+
const retryIn = useCallback13((timeout) => {
|
|
5715
5839
|
if (!imageRef.current) {
|
|
5716
5840
|
return;
|
|
5717
5841
|
}
|
|
@@ -5728,7 +5852,8 @@ var ImgRefForwarding = ({
|
|
|
5728
5852
|
imageRef.current.setAttribute("src", newSrc);
|
|
5729
5853
|
}, timeout);
|
|
5730
5854
|
}, []);
|
|
5731
|
-
const
|
|
5855
|
+
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
5856
|
+
const didGetError = useCallback13((e) => {
|
|
5732
5857
|
if (!errors.current) {
|
|
5733
5858
|
return;
|
|
5734
5859
|
}
|
|
@@ -5743,9 +5868,10 @@ var ImgRefForwarding = ({
|
|
|
5743
5868
|
retryIn(backoff);
|
|
5744
5869
|
return;
|
|
5745
5870
|
}
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5871
|
+
try {
|
|
5872
|
+
cancelRender2("Error loading image with src: " + imageRef.current?.src);
|
|
5873
|
+
} catch {}
|
|
5874
|
+
}, [cancelRender2, maxRetries, onError, retryIn]);
|
|
5749
5875
|
if (typeof window !== "undefined") {
|
|
5750
5876
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
5751
5877
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
@@ -5790,7 +5916,7 @@ var ImgRefForwarding = ({
|
|
|
5790
5916
|
current.src = actualSrc;
|
|
5791
5917
|
current.decode().then(onComplete).catch((err) => {
|
|
5792
5918
|
console.warn(err);
|
|
5793
|
-
if (current.complete) {
|
|
5919
|
+
if (current.complete && current.naturalWidth > 0 && current.naturalHeight > 0) {
|
|
5794
5920
|
onComplete();
|
|
5795
5921
|
} else {
|
|
5796
5922
|
current.addEventListener("load", onComplete);
|
|
@@ -5838,43 +5964,43 @@ var CompositionManagerProvider = ({
|
|
|
5838
5964
|
initialCompositions,
|
|
5839
5965
|
initialCanvasContent
|
|
5840
5966
|
}) => {
|
|
5841
|
-
const [folders, setFolders] =
|
|
5842
|
-
const [canvasContent, setCanvasContent] =
|
|
5843
|
-
const [compositions, setCompositions] =
|
|
5967
|
+
const [folders, setFolders] = useState15([]);
|
|
5968
|
+
const [canvasContent, setCanvasContent] = useState15(initialCanvasContent);
|
|
5969
|
+
const [compositions, setCompositions] = useState15(initialCompositions);
|
|
5844
5970
|
const currentcompositionsRef = useRef18(compositions);
|
|
5845
|
-
const updateCompositions =
|
|
5971
|
+
const updateCompositions = useCallback14((updateComps) => {
|
|
5846
5972
|
setCompositions((comps) => {
|
|
5847
5973
|
const updated = updateComps(comps);
|
|
5848
5974
|
currentcompositionsRef.current = updated;
|
|
5849
5975
|
return updated;
|
|
5850
5976
|
});
|
|
5851
5977
|
}, []);
|
|
5852
|
-
const registerComposition =
|
|
5978
|
+
const registerComposition = useCallback14((comp) => {
|
|
5853
5979
|
updateCompositions((comps) => {
|
|
5854
5980
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
5855
5981
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
5856
5982
|
}
|
|
5857
|
-
|
|
5858
|
-
return value;
|
|
5983
|
+
return [...comps, comp];
|
|
5859
5984
|
});
|
|
5860
5985
|
}, [updateCompositions]);
|
|
5861
|
-
const unregisterComposition =
|
|
5986
|
+
const unregisterComposition = useCallback14((id) => {
|
|
5862
5987
|
setCompositions((comps) => {
|
|
5863
5988
|
return comps.filter((c2) => c2.id !== id);
|
|
5864
5989
|
});
|
|
5865
5990
|
}, []);
|
|
5866
|
-
const registerFolder =
|
|
5991
|
+
const registerFolder = useCallback14((name, parent, nonce) => {
|
|
5867
5992
|
setFolders((prevFolders) => {
|
|
5868
5993
|
return [
|
|
5869
5994
|
...prevFolders,
|
|
5870
5995
|
{
|
|
5871
5996
|
name,
|
|
5872
|
-
parent
|
|
5997
|
+
parent,
|
|
5998
|
+
nonce
|
|
5873
5999
|
}
|
|
5874
6000
|
];
|
|
5875
6001
|
});
|
|
5876
6002
|
}, []);
|
|
5877
|
-
const unregisterFolder =
|
|
6003
|
+
const unregisterFolder = useCallback14((name, parent) => {
|
|
5878
6004
|
setFolders((prevFolders) => {
|
|
5879
6005
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
5880
6006
|
});
|
|
@@ -5884,7 +6010,7 @@ var CompositionManagerProvider = ({
|
|
|
5884
6010
|
getCompositions: () => currentcompositionsRef.current
|
|
5885
6011
|
};
|
|
5886
6012
|
}, []);
|
|
5887
|
-
const updateCompositionDefaultProps =
|
|
6013
|
+
const updateCompositionDefaultProps = useCallback14((id, newDefaultProps) => {
|
|
5888
6014
|
setCompositions((comps) => {
|
|
5889
6015
|
const updated = comps.map((c2) => {
|
|
5890
6016
|
if (c2.id === id) {
|
|
@@ -5898,7 +6024,7 @@ var CompositionManagerProvider = ({
|
|
|
5898
6024
|
return updated;
|
|
5899
6025
|
});
|
|
5900
6026
|
}, []);
|
|
5901
|
-
const compositionManagerSetters =
|
|
6027
|
+
const compositionManagerSetters = useMemo26(() => {
|
|
5902
6028
|
return {
|
|
5903
6029
|
registerComposition,
|
|
5904
6030
|
unregisterComposition,
|
|
@@ -5916,7 +6042,7 @@ var CompositionManagerProvider = ({
|
|
|
5916
6042
|
updateCompositionDefaultProps,
|
|
5917
6043
|
onlyRenderComposition
|
|
5918
6044
|
]);
|
|
5919
|
-
const compositionManagerContextValue =
|
|
6045
|
+
const compositionManagerContextValue = useMemo26(() => {
|
|
5920
6046
|
return {
|
|
5921
6047
|
compositions,
|
|
5922
6048
|
folders,
|
|
@@ -5990,6 +6116,27 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
5990
6116
|
}
|
|
5991
6117
|
`;
|
|
5992
6118
|
};
|
|
6119
|
+
var getEffectiveVisualModeValue = ({
|
|
6120
|
+
codeValue,
|
|
6121
|
+
runtimeValue,
|
|
6122
|
+
dragOverrideValue,
|
|
6123
|
+
defaultValue,
|
|
6124
|
+
shouldResortToDefaultValueIfUndefined = false
|
|
6125
|
+
}) => {
|
|
6126
|
+
if (dragOverrideValue !== undefined) {
|
|
6127
|
+
return dragOverrideValue;
|
|
6128
|
+
}
|
|
6129
|
+
if (!codeValue) {
|
|
6130
|
+
return runtimeValue;
|
|
6131
|
+
}
|
|
6132
|
+
if (!codeValue.canUpdate) {
|
|
6133
|
+
return runtimeValue;
|
|
6134
|
+
}
|
|
6135
|
+
if (codeValue.codeValue === undefined && shouldResortToDefaultValueIfUndefined) {
|
|
6136
|
+
return defaultValue;
|
|
6137
|
+
}
|
|
6138
|
+
return codeValue.codeValue;
|
|
6139
|
+
};
|
|
5993
6140
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
5994
6141
|
var getPreviewDomElement = () => {
|
|
5995
6142
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
@@ -6014,7 +6161,7 @@ var waitForRoot = (fn) => {
|
|
|
6014
6161
|
};
|
|
6015
6162
|
var MediaEnabledContext = createContext20(null);
|
|
6016
6163
|
var useVideoEnabled = () => {
|
|
6017
|
-
const context =
|
|
6164
|
+
const context = useContext30(MediaEnabledContext);
|
|
6018
6165
|
if (!context) {
|
|
6019
6166
|
return window.remotion_videoEnabled;
|
|
6020
6167
|
}
|
|
@@ -6024,7 +6171,7 @@ var useVideoEnabled = () => {
|
|
|
6024
6171
|
return context.videoEnabled;
|
|
6025
6172
|
};
|
|
6026
6173
|
var useAudioEnabled = () => {
|
|
6027
|
-
const context =
|
|
6174
|
+
const context = useContext30(MediaEnabledContext);
|
|
6028
6175
|
if (!context) {
|
|
6029
6176
|
return window.remotion_audioEnabled;
|
|
6030
6177
|
}
|
|
@@ -6038,7 +6185,7 @@ var MediaEnabledProvider = ({
|
|
|
6038
6185
|
videoEnabled,
|
|
6039
6186
|
audioEnabled
|
|
6040
6187
|
}) => {
|
|
6041
|
-
const value =
|
|
6188
|
+
const value = useMemo27(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
6042
6189
|
return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
|
|
6043
6190
|
value,
|
|
6044
6191
|
children
|
|
@@ -6052,15 +6199,15 @@ var RemotionRootContexts = ({
|
|
|
6052
6199
|
videoEnabled,
|
|
6053
6200
|
audioEnabled,
|
|
6054
6201
|
frameState,
|
|
6055
|
-
|
|
6202
|
+
visualModeEnabled
|
|
6056
6203
|
}) => {
|
|
6057
|
-
const nonceContext =
|
|
6204
|
+
const nonceContext = useMemo28(() => {
|
|
6058
6205
|
let counter = 0;
|
|
6059
6206
|
return {
|
|
6060
6207
|
getNonce: () => counter++
|
|
6061
6208
|
};
|
|
6062
|
-
}, [
|
|
6063
|
-
const logging =
|
|
6209
|
+
}, []);
|
|
6210
|
+
const logging = useMemo28(() => {
|
|
6064
6211
|
return { logLevel, mountTime: Date.now() };
|
|
6065
6212
|
}, [logLevel]);
|
|
6066
6213
|
return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
|
|
@@ -6075,6 +6222,7 @@ var RemotionRootContexts = ({
|
|
|
6075
6222
|
children: /* @__PURE__ */ jsx27(EditorPropsProvider, {
|
|
6076
6223
|
children: /* @__PURE__ */ jsx27(PrefetchProvider, {
|
|
6077
6224
|
children: /* @__PURE__ */ jsx27(SequenceManagerProvider, {
|
|
6225
|
+
visualModeEnabled,
|
|
6078
6226
|
children: /* @__PURE__ */ jsx27(SharedAudioContextProvider, {
|
|
6079
6227
|
numberOfAudioTags,
|
|
6080
6228
|
audioLatencyHint,
|
|
@@ -6257,6 +6405,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
6257
6405
|
};
|
|
6258
6406
|
}
|
|
6259
6407
|
};
|
|
6408
|
+
var SequenceStackTracesUpdateContext = React27.createContext(() => {});
|
|
6260
6409
|
var getEnvVariables = () => {
|
|
6261
6410
|
if (getRemotionEnvironment().isRendering) {
|
|
6262
6411
|
const param = window.remotion_envVariables;
|
|
@@ -6282,7 +6431,7 @@ var setupEnvVariables = () => {
|
|
|
6282
6431
|
window.process.env[key] = env[key];
|
|
6283
6432
|
});
|
|
6284
6433
|
};
|
|
6285
|
-
var CurrentScaleContext =
|
|
6434
|
+
var CurrentScaleContext = React28.createContext(null);
|
|
6286
6435
|
var PreviewSizeContext = createContext21({
|
|
6287
6436
|
setSize: () => {
|
|
6288
6437
|
return;
|
|
@@ -6308,7 +6457,7 @@ var calculateScale = ({
|
|
|
6308
6457
|
};
|
|
6309
6458
|
var useSchema = (schema, currentValue) => {
|
|
6310
6459
|
const env = useRemotionEnvironment();
|
|
6311
|
-
const earlyReturn =
|
|
6460
|
+
const earlyReturn = useMemo29(() => {
|
|
6312
6461
|
if (!env.isStudio || env.isReadOnlyStudio) {
|
|
6313
6462
|
return {
|
|
6314
6463
|
controls: undefined,
|
|
@@ -6320,35 +6469,64 @@ var useSchema = (schema, currentValue) => {
|
|
|
6320
6469
|
if (earlyReturn) {
|
|
6321
6470
|
return earlyReturn;
|
|
6322
6471
|
}
|
|
6323
|
-
const [overrideId] =
|
|
6324
|
-
const {
|
|
6325
|
-
|
|
6472
|
+
const [overrideId] = useState16(() => String(Math.random()));
|
|
6473
|
+
const {
|
|
6474
|
+
visualModeEnabled,
|
|
6475
|
+
dragOverrides: overrides,
|
|
6476
|
+
codeValues
|
|
6477
|
+
} = useContext31(VisualModeOverridesContext);
|
|
6478
|
+
const controls = useMemo29(() => {
|
|
6479
|
+
if (!visualModeEnabled) {
|
|
6480
|
+
return;
|
|
6481
|
+
}
|
|
6326
6482
|
if (schema === null || currentValue === null) {
|
|
6483
|
+
return;
|
|
6484
|
+
}
|
|
6485
|
+
return {
|
|
6486
|
+
schema,
|
|
6487
|
+
currentValue,
|
|
6488
|
+
overrideId
|
|
6489
|
+
};
|
|
6490
|
+
}, [schema, currentValue, overrideId, visualModeEnabled]);
|
|
6491
|
+
return useMemo29(() => {
|
|
6492
|
+
if (controls === undefined || currentValue === null || schema === null || !visualModeEnabled) {
|
|
6327
6493
|
return {
|
|
6328
6494
|
controls: undefined,
|
|
6329
6495
|
values: currentValue ?? {}
|
|
6330
6496
|
};
|
|
6331
6497
|
}
|
|
6332
6498
|
const overrideValues = overrides[overrideId] ?? {};
|
|
6333
|
-
const
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6499
|
+
const propStatus = codeValues[overrideId];
|
|
6500
|
+
const currentValueKeys = Object.keys(currentValue);
|
|
6501
|
+
const keysToUpdate = new Set(currentValueKeys).values();
|
|
6502
|
+
const merged = {};
|
|
6503
|
+
for (const key of keysToUpdate) {
|
|
6504
|
+
const codeValueStatus = propStatus?.[key] ?? null;
|
|
6505
|
+
merged[key] = getEffectiveVisualModeValue({
|
|
6506
|
+
codeValue: codeValueStatus,
|
|
6507
|
+
runtimeValue: currentValue[key],
|
|
6508
|
+
dragOverrideValue: overrideValues[key],
|
|
6509
|
+
defaultValue: schema[key]?.default,
|
|
6510
|
+
shouldResortToDefaultValueIfUndefined: false
|
|
6511
|
+
});
|
|
6338
6512
|
}
|
|
6339
6513
|
return {
|
|
6340
|
-
controls
|
|
6341
|
-
schema,
|
|
6342
|
-
currentValue,
|
|
6343
|
-
overrideId
|
|
6344
|
-
},
|
|
6514
|
+
controls,
|
|
6345
6515
|
values: merged
|
|
6346
6516
|
};
|
|
6347
|
-
}, [
|
|
6517
|
+
}, [
|
|
6518
|
+
controls,
|
|
6519
|
+
currentValue,
|
|
6520
|
+
overrideId,
|
|
6521
|
+
overrides,
|
|
6522
|
+
codeValues,
|
|
6523
|
+
schema,
|
|
6524
|
+
visualModeEnabled
|
|
6525
|
+
]);
|
|
6348
6526
|
};
|
|
6349
6527
|
var useSequenceControlOverride = (key) => {
|
|
6350
|
-
const seqContext =
|
|
6351
|
-
const { overrides } =
|
|
6528
|
+
const seqContext = useContext32(SequenceContext);
|
|
6529
|
+
const { dragOverrides: overrides } = useContext32(VisualModeOverridesContext);
|
|
6352
6530
|
if (!seqContext) {
|
|
6353
6531
|
return;
|
|
6354
6532
|
}
|
|
@@ -6385,13 +6563,13 @@ var OffthreadVideoForRendering = ({
|
|
|
6385
6563
|
const frame = useCurrentFrame();
|
|
6386
6564
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
6387
6565
|
const videoConfig = useUnsafeVideoConfig();
|
|
6388
|
-
const sequenceContext =
|
|
6566
|
+
const sequenceContext = useContext33(SequenceContext);
|
|
6389
6567
|
const mediaStartsAt = useMediaStartsAt();
|
|
6390
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
6568
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
|
|
6391
6569
|
if (!src) {
|
|
6392
6570
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
6393
6571
|
}
|
|
6394
|
-
const id =
|
|
6572
|
+
const id = useMemo30(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
6395
6573
|
src,
|
|
6396
6574
|
sequenceContext?.cumulatedFrom,
|
|
6397
6575
|
sequenceContext?.relativeFrom,
|
|
@@ -6406,7 +6584,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6406
6584
|
mediaVolume: 1
|
|
6407
6585
|
});
|
|
6408
6586
|
warnAboutTooHighVolume(volume);
|
|
6409
|
-
|
|
6587
|
+
useEffect14(() => {
|
|
6410
6588
|
if (!src) {
|
|
6411
6589
|
throw new Error("No src passed");
|
|
6412
6590
|
}
|
|
@@ -6446,14 +6624,14 @@ var OffthreadVideoForRendering = ({
|
|
|
6446
6624
|
sequenceContext?.relativeFrom,
|
|
6447
6625
|
audioStreamIndex
|
|
6448
6626
|
]);
|
|
6449
|
-
const currentTime =
|
|
6627
|
+
const currentTime = useMemo30(() => {
|
|
6450
6628
|
return getExpectedMediaFrameUncorrected({
|
|
6451
6629
|
frame,
|
|
6452
6630
|
playbackRate: playbackRate || 1,
|
|
6453
6631
|
startFrom: -mediaStartsAt
|
|
6454
6632
|
}) / videoConfig.fps;
|
|
6455
6633
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
6456
|
-
const actualSrc =
|
|
6634
|
+
const actualSrc = useMemo30(() => {
|
|
6457
6635
|
return getOffthreadVideoSource({
|
|
6458
6636
|
src,
|
|
6459
6637
|
currentTime,
|
|
@@ -6461,7 +6639,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6461
6639
|
toneMapped
|
|
6462
6640
|
});
|
|
6463
6641
|
}, [toneMapped, currentTime, src, transparent]);
|
|
6464
|
-
const [imageSrc, setImageSrc] =
|
|
6642
|
+
const [imageSrc, setImageSrc] = useState17(null);
|
|
6465
6643
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6466
6644
|
useLayoutEffect10(() => {
|
|
6467
6645
|
if (!window.remotion_videoEnabled) {
|
|
@@ -6534,17 +6712,17 @@ var OffthreadVideoForRendering = ({
|
|
|
6534
6712
|
continueRender2,
|
|
6535
6713
|
delayRender2
|
|
6536
6714
|
]);
|
|
6537
|
-
const onErr =
|
|
6715
|
+
const onErr = useCallback15(() => {
|
|
6538
6716
|
if (onError) {
|
|
6539
6717
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
6540
6718
|
} else {
|
|
6541
6719
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
6542
6720
|
}
|
|
6543
6721
|
}, [imageSrc, onError]);
|
|
6544
|
-
const className =
|
|
6722
|
+
const className = useMemo30(() => {
|
|
6545
6723
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
6546
6724
|
}, [props2.className]);
|
|
6547
|
-
const onImageFrame =
|
|
6725
|
+
const onImageFrame = useCallback15((img) => {
|
|
6548
6726
|
if (onVideoFrame) {
|
|
6549
6727
|
onVideoFrame(img);
|
|
6550
6728
|
}
|
|
@@ -6567,7 +6745,7 @@ var useEmitVideoFrame = ({
|
|
|
6567
6745
|
ref,
|
|
6568
6746
|
onVideoFrame
|
|
6569
6747
|
}) => {
|
|
6570
|
-
|
|
6748
|
+
useEffect15(() => {
|
|
6571
6749
|
const { current } = ref;
|
|
6572
6750
|
if (!current) {
|
|
6573
6751
|
return;
|
|
@@ -6590,12 +6768,12 @@ var useEmitVideoFrame = ({
|
|
|
6590
6768
|
}, [onVideoFrame, ref]);
|
|
6591
6769
|
};
|
|
6592
6770
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
6593
|
-
const context =
|
|
6771
|
+
const context = useContext34(SharedAudioContext);
|
|
6594
6772
|
if (!context) {
|
|
6595
6773
|
throw new Error("SharedAudioContext not found");
|
|
6596
6774
|
}
|
|
6597
6775
|
const videoRef = useRef19(null);
|
|
6598
|
-
const sharedSource =
|
|
6776
|
+
const sharedSource = useMemo31(() => {
|
|
6599
6777
|
if (!context.audioContext) {
|
|
6600
6778
|
return null;
|
|
6601
6779
|
}
|
|
@@ -6604,7 +6782,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6604
6782
|
ref: videoRef
|
|
6605
6783
|
});
|
|
6606
6784
|
}, [context.audioContext]);
|
|
6607
|
-
const effectToUse =
|
|
6785
|
+
const effectToUse = React30.useInsertionEffect ?? React30.useLayoutEffect;
|
|
6608
6786
|
effectToUse(() => {
|
|
6609
6787
|
return () => {
|
|
6610
6788
|
requestAnimationFrame(() => {
|
|
@@ -6646,11 +6824,11 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6646
6824
|
}
|
|
6647
6825
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
6648
6826
|
const { fps, durationInFrames } = useVideoConfig();
|
|
6649
|
-
const parentSequence =
|
|
6650
|
-
const { hidden } =
|
|
6827
|
+
const parentSequence = useContext34(SequenceContext);
|
|
6828
|
+
const { hidden } = useContext34(SequenceVisibilityToggleContext);
|
|
6651
6829
|
const logLevel = useLogLevel();
|
|
6652
6830
|
const mountTime = useMountTime();
|
|
6653
|
-
const [timelineId] =
|
|
6831
|
+
const [timelineId] = useState18(() => String(Math.random()));
|
|
6654
6832
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
6655
6833
|
if (typeof acceptableTimeShift !== "undefined") {
|
|
6656
6834
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
@@ -6716,13 +6894,13 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6716
6894
|
useImperativeHandle9(ref, () => {
|
|
6717
6895
|
return videoRef.current;
|
|
6718
6896
|
}, []);
|
|
6719
|
-
|
|
6897
|
+
useState18(() => playbackLogging({
|
|
6720
6898
|
logLevel,
|
|
6721
6899
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
6722
6900
|
tag: "video",
|
|
6723
6901
|
mountTime
|
|
6724
6902
|
}));
|
|
6725
|
-
|
|
6903
|
+
useEffect16(() => {
|
|
6726
6904
|
const { current } = videoRef;
|
|
6727
6905
|
if (!current) {
|
|
6728
6906
|
return;
|
|
@@ -6753,7 +6931,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6753
6931
|
const currentOnDurationCallback = useRef19(onDuration);
|
|
6754
6932
|
currentOnDurationCallback.current = onDuration;
|
|
6755
6933
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
6756
|
-
|
|
6934
|
+
useEffect16(() => {
|
|
6757
6935
|
const { current } = videoRef;
|
|
6758
6936
|
if (!current) {
|
|
6759
6937
|
return;
|
|
@@ -6770,7 +6948,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6770
6948
|
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
6771
6949
|
};
|
|
6772
6950
|
}, [src]);
|
|
6773
|
-
|
|
6951
|
+
useEffect16(() => {
|
|
6774
6952
|
const { current } = videoRef;
|
|
6775
6953
|
if (!current) {
|
|
6776
6954
|
return;
|
|
@@ -6781,7 +6959,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6781
6959
|
current.preload = "auto";
|
|
6782
6960
|
}
|
|
6783
6961
|
}, []);
|
|
6784
|
-
const actualStyle =
|
|
6962
|
+
const actualStyle = useMemo31(() => {
|
|
6785
6963
|
return {
|
|
6786
6964
|
...style,
|
|
6787
6965
|
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
@@ -6821,7 +6999,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
6821
6999
|
if (environment.isClientSideRendering) {
|
|
6822
7000
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
6823
7001
|
}
|
|
6824
|
-
const onDuration =
|
|
7002
|
+
const onDuration = useCallback16(() => {
|
|
6825
7003
|
return;
|
|
6826
7004
|
}, []);
|
|
6827
7005
|
if (typeof props2.src !== "string") {
|
|
@@ -6962,20 +7140,82 @@ var OffthreadVideo = ({
|
|
|
6962
7140
|
};
|
|
6963
7141
|
addSequenceStackTraces(OffthreadVideo);
|
|
6964
7142
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
7143
|
+
var getNestedValue = (obj, key) => {
|
|
7144
|
+
const parts = key.split(".");
|
|
7145
|
+
let current = obj;
|
|
7146
|
+
for (const part of parts) {
|
|
7147
|
+
if (current === null || current === undefined || typeof current !== "object")
|
|
7148
|
+
return;
|
|
7149
|
+
current = current[part];
|
|
7150
|
+
}
|
|
7151
|
+
return current;
|
|
7152
|
+
};
|
|
7153
|
+
var mergeValues = (props2, values, schemaKeys) => {
|
|
7154
|
+
const merged = { ...props2 };
|
|
7155
|
+
for (const key of schemaKeys) {
|
|
7156
|
+
const value = values[key];
|
|
7157
|
+
const parts = key.split(".");
|
|
7158
|
+
if (parts.length === 1) {
|
|
7159
|
+
merged[key] = value;
|
|
7160
|
+
continue;
|
|
7161
|
+
}
|
|
7162
|
+
let current = merged;
|
|
7163
|
+
for (let i = 0;i < parts.length - 1; i++) {
|
|
7164
|
+
const part = parts[i];
|
|
7165
|
+
if (typeof current[part] === "object" && current[part] !== null) {
|
|
7166
|
+
current[part] = { ...current[part] };
|
|
7167
|
+
} else {
|
|
7168
|
+
current[part] = {};
|
|
7169
|
+
}
|
|
7170
|
+
current = current[part];
|
|
7171
|
+
}
|
|
7172
|
+
current[parts[parts.length - 1]] = value;
|
|
7173
|
+
}
|
|
7174
|
+
return merged;
|
|
7175
|
+
};
|
|
7176
|
+
var wrapInSchema = (Component, schema) => {
|
|
7177
|
+
const schemaKeys = Object.keys(schema);
|
|
7178
|
+
const Wrapped = forwardRef10((props2, ref) => {
|
|
7179
|
+
const env = useRemotionEnvironment();
|
|
7180
|
+
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
7181
|
+
return React32.createElement(Component, {
|
|
7182
|
+
...props2,
|
|
7183
|
+
controls: null,
|
|
7184
|
+
ref
|
|
7185
|
+
});
|
|
7186
|
+
}
|
|
7187
|
+
const schemaInput = useMemo32(() => {
|
|
7188
|
+
const input = {};
|
|
7189
|
+
for (const key of schemaKeys) {
|
|
7190
|
+
input[key] = getNestedValue(props2, key);
|
|
7191
|
+
}
|
|
7192
|
+
return input;
|
|
7193
|
+
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
7194
|
+
const { controls, values } = useSchema(schema, schemaInput);
|
|
7195
|
+
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
7196
|
+
return React32.createElement(Component, {
|
|
7197
|
+
...mergedProps,
|
|
7198
|
+
controls,
|
|
7199
|
+
ref
|
|
7200
|
+
});
|
|
7201
|
+
});
|
|
7202
|
+
Wrapped.displayName = `wrapInSchema(${Component.displayName || Component.name || "Component"})`;
|
|
7203
|
+
return Wrapped;
|
|
7204
|
+
};
|
|
6965
7205
|
function useRemotionContexts() {
|
|
6966
|
-
const compositionManagerCtx =
|
|
6967
|
-
const timelineContext =
|
|
6968
|
-
const setTimelineContext =
|
|
6969
|
-
const sequenceContext =
|
|
6970
|
-
const nonceContext =
|
|
6971
|
-
const canUseRemotionHooksContext =
|
|
6972
|
-
const preloadContext =
|
|
6973
|
-
const resolveCompositionContext =
|
|
6974
|
-
const renderAssetManagerContext =
|
|
6975
|
-
const sequenceManagerContext =
|
|
6976
|
-
const bufferManagerContext =
|
|
6977
|
-
const logLevelContext =
|
|
6978
|
-
return
|
|
7206
|
+
const compositionManagerCtx = React33.useContext(CompositionManager);
|
|
7207
|
+
const timelineContext = React33.useContext(TimelineContext);
|
|
7208
|
+
const setTimelineContext = React33.useContext(SetTimelineContext);
|
|
7209
|
+
const sequenceContext = React33.useContext(SequenceContext);
|
|
7210
|
+
const nonceContext = React33.useContext(NonceContext);
|
|
7211
|
+
const canUseRemotionHooksContext = React33.useContext(CanUseRemotionHooks);
|
|
7212
|
+
const preloadContext = React33.useContext(PreloadContext);
|
|
7213
|
+
const resolveCompositionContext = React33.useContext(ResolveCompositionContext);
|
|
7214
|
+
const renderAssetManagerContext = React33.useContext(RenderAssetManager);
|
|
7215
|
+
const sequenceManagerContext = React33.useContext(SequenceManager);
|
|
7216
|
+
const bufferManagerContext = React33.useContext(BufferingContextReact);
|
|
7217
|
+
const logLevelContext = React33.useContext(LogLevelContext);
|
|
7218
|
+
return useMemo33(() => ({
|
|
6979
7219
|
compositionManagerCtx,
|
|
6980
7220
|
timelineContext,
|
|
6981
7221
|
setTimelineContext,
|
|
@@ -7049,6 +7289,7 @@ var Internals = {
|
|
|
7049
7289
|
useUnsafeVideoConfig,
|
|
7050
7290
|
useFrameForVolumeProp,
|
|
7051
7291
|
useTimelinePosition,
|
|
7292
|
+
useAbsoluteTimelinePosition,
|
|
7052
7293
|
evaluateVolume,
|
|
7053
7294
|
getAbsoluteSrc,
|
|
7054
7295
|
Timeline: exports_timeline_position_state,
|
|
@@ -7058,10 +7299,12 @@ var Internals = {
|
|
|
7058
7299
|
VideoForPreview,
|
|
7059
7300
|
CompositionManager,
|
|
7060
7301
|
CompositionSetters,
|
|
7061
|
-
|
|
7302
|
+
VisualModeOverridesContext,
|
|
7062
7303
|
SequenceManager,
|
|
7304
|
+
SequenceStackTracesUpdateContext,
|
|
7063
7305
|
SequenceVisibilityToggleContext,
|
|
7064
7306
|
useSchema,
|
|
7307
|
+
wrapInSchema,
|
|
7065
7308
|
useSequenceControlOverride,
|
|
7066
7309
|
RemotionRootContexts,
|
|
7067
7310
|
CompositionManagerProvider,
|
|
@@ -7109,6 +7352,7 @@ var Internals = {
|
|
|
7109
7352
|
REMOTION_STUDIO_CONTAINER_ELEMENT,
|
|
7110
7353
|
RenderAssetManager,
|
|
7111
7354
|
persistCurrentFrame,
|
|
7355
|
+
useTimelineContext,
|
|
7112
7356
|
useTimelineSetFrame,
|
|
7113
7357
|
isIosSafari,
|
|
7114
7358
|
WATCH_REMOTION_STATIC_FILES,
|
|
@@ -7143,7 +7387,9 @@ var Internals = {
|
|
|
7143
7387
|
TimelinePosition: exports_timeline_position_state,
|
|
7144
7388
|
DelayRenderContextType,
|
|
7145
7389
|
TimelineContext,
|
|
7146
|
-
|
|
7390
|
+
AbsoluteTimeContext,
|
|
7391
|
+
RenderAssetManagerProvider,
|
|
7392
|
+
getEffectiveVisualModeValue
|
|
7147
7393
|
};
|
|
7148
7394
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
7149
7395
|
var PERCENTAGE = NUMBER + "%";
|
|
@@ -7172,9 +7418,9 @@ var validateFrame = ({
|
|
|
7172
7418
|
}
|
|
7173
7419
|
};
|
|
7174
7420
|
var flattenChildren = (children) => {
|
|
7175
|
-
const childrenArray =
|
|
7421
|
+
const childrenArray = React34.Children.toArray(children);
|
|
7176
7422
|
return childrenArray.reduce((flatChildren, child) => {
|
|
7177
|
-
if (child.type ===
|
|
7423
|
+
if (child.type === React34.Fragment) {
|
|
7178
7424
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
7179
7425
|
}
|
|
7180
7426
|
flatChildren.push(child);
|
|
@@ -7195,7 +7441,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
|
|
|
7195
7441
|
});
|
|
7196
7442
|
};
|
|
7197
7443
|
var useRequireToBeInsideSeries = () => {
|
|
7198
|
-
const isInsideSeries =
|
|
7444
|
+
const isInsideSeries = React35.useContext(IsInsideSeriesContext);
|
|
7199
7445
|
if (!isInsideSeries) {
|
|
7200
7446
|
throw new Error("This component must be inside a <Series /> component.");
|
|
7201
7447
|
}
|
|
@@ -7206,9 +7452,9 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
7206
7452
|
children
|
|
7207
7453
|
});
|
|
7208
7454
|
};
|
|
7209
|
-
var SeriesSequence =
|
|
7455
|
+
var SeriesSequence = forwardRef11(SeriesSequenceRefForwardingFunction);
|
|
7210
7456
|
var Series = (props2) => {
|
|
7211
|
-
const childrenValue =
|
|
7457
|
+
const childrenValue = useMemo34(() => {
|
|
7212
7458
|
let startFrame = 0;
|
|
7213
7459
|
const flattenedChildren = flattenChildren(props2.children);
|
|
7214
7460
|
return Children.map(flattenedChildren, (child, i) => {
|
|
@@ -7741,14 +7987,14 @@ var VideoForRenderingForwardFunction = ({
|
|
|
7741
7987
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
7742
7988
|
const videoConfig = useUnsafeVideoConfig();
|
|
7743
7989
|
const videoRef = useRef20(null);
|
|
7744
|
-
const sequenceContext =
|
|
7990
|
+
const sequenceContext = useContext35(SequenceContext);
|
|
7745
7991
|
const mediaStartsAt = useMediaStartsAt();
|
|
7746
7992
|
const environment = useRemotionEnvironment();
|
|
7747
7993
|
const logLevel = useLogLevel();
|
|
7748
7994
|
const mountTime = useMountTime();
|
|
7749
7995
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7750
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
7751
|
-
const id =
|
|
7996
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext35(RenderAssetManager);
|
|
7997
|
+
const id = useMemo35(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
7752
7998
|
props2.src,
|
|
7753
7999
|
sequenceContext?.cumulatedFrom,
|
|
7754
8000
|
sequenceContext?.relativeFrom,
|
|
@@ -7763,7 +8009,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
7763
8009
|
mediaVolume: 1
|
|
7764
8010
|
});
|
|
7765
8011
|
warnAboutTooHighVolume(volume);
|
|
7766
|
-
|
|
8012
|
+
useEffect17(() => {
|
|
7767
8013
|
if (!props2.src) {
|
|
7768
8014
|
throw new Error("No src passed");
|
|
7769
8015
|
}
|
|
@@ -7806,7 +8052,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
7806
8052
|
useImperativeHandle10(ref, () => {
|
|
7807
8053
|
return videoRef.current;
|
|
7808
8054
|
}, []);
|
|
7809
|
-
|
|
8055
|
+
useEffect17(() => {
|
|
7810
8056
|
if (!window.remotion_videoEnabled) {
|
|
7811
8057
|
return;
|
|
7812
8058
|
}
|
|
@@ -7930,7 +8176,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
7930
8176
|
...props2
|
|
7931
8177
|
});
|
|
7932
8178
|
};
|
|
7933
|
-
var VideoForRendering =
|
|
8179
|
+
var VideoForRendering = forwardRef12(VideoForRenderingForwardFunction);
|
|
7934
8180
|
var VideoForwardingFunction = (props2, ref) => {
|
|
7935
8181
|
const {
|
|
7936
8182
|
startFrom,
|
|
@@ -7951,7 +8197,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
7951
8197
|
if (environment.isClientSideRendering) {
|
|
7952
8198
|
throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
7953
8199
|
}
|
|
7954
|
-
const { durations, setDurations } =
|
|
8200
|
+
const { durations, setDurations } = useContext36(DurationsContext);
|
|
7955
8201
|
if (typeof ref === "string") {
|
|
7956
8202
|
throw new Error("string refs are not supported");
|
|
7957
8203
|
}
|
|
@@ -7959,10 +8205,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
7959
8205
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
7960
8206
|
}
|
|
7961
8207
|
const preloadedSrc = usePreload(props2.src);
|
|
7962
|
-
const onDuration =
|
|
8208
|
+
const onDuration = useCallback17((src, durationInSeconds) => {
|
|
7963
8209
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
7964
8210
|
}, [setDurations]);
|
|
7965
|
-
const onVideoFrame =
|
|
8211
|
+
const onVideoFrame = useCallback17(() => {}, []);
|
|
7966
8212
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
7967
8213
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
7968
8214
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -8035,7 +8281,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
8035
8281
|
onAutoPlayError: onAutoPlayError ?? undefined
|
|
8036
8282
|
});
|
|
8037
8283
|
};
|
|
8038
|
-
var Html5Video =
|
|
8284
|
+
var Html5Video = forwardRef13(VideoForwardingFunction);
|
|
8039
8285
|
addSequenceStackTraces(Html5Video);
|
|
8040
8286
|
checkMultipleRemotionVersions();
|
|
8041
8287
|
var proxyObj = {};
|
|
@@ -8378,7 +8624,7 @@ var ExpertCard = ({ expert, Link }) => {
|
|
|
8378
8624
|
});
|
|
8379
8625
|
};
|
|
8380
8626
|
var ExpertsPageContent = ({ Link }) => {
|
|
8381
|
-
const expertsInRandomOrder =
|
|
8627
|
+
const expertsInRandomOrder = useMemo36(() => {
|
|
8382
8628
|
if (typeof window === "undefined") {
|
|
8383
8629
|
return [];
|
|
8384
8630
|
}
|