remotion 4.0.0-lambda.1 → 4.0.0-newpathfunctions.13

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.
Files changed (504) hide show
  1. package/LICENSE.md +8 -8
  2. package/README.md +30 -19
  3. package/dist/AbsoluteFill.d.ts +2 -2
  4. package/dist/AbsoluteFill.js +7 -7
  5. package/dist/CanUseRemotionHooks.d.ts +5 -0
  6. package/dist/CanUseRemotionHooks.js +10 -0
  7. package/dist/Clipper.d.ts +7 -0
  8. package/dist/Clipper.js +24 -0
  9. package/dist/Composition.d.ts +3 -1
  10. package/dist/Composition.js +34 -10
  11. package/dist/CompositionManager.d.ts +9 -8
  12. package/dist/CompositionManager.js +9 -3
  13. package/dist/Folder.d.ts +1 -1
  14. package/dist/Folder.js +0 -0
  15. package/dist/IFrame.d.ts +0 -0
  16. package/dist/IFrame.js +0 -0
  17. package/dist/Img.d.ts +0 -0
  18. package/dist/Img.js +31 -21
  19. package/dist/LayerMaster.d.ts +8 -0
  20. package/dist/LayerMaster.js +39 -0
  21. package/dist/NativeLayers.d.ts +13 -0
  22. package/dist/NativeLayers.js +29 -0
  23. package/dist/Null.d.ts +2 -0
  24. package/dist/Null.js +25 -0
  25. package/dist/RemotionRoot.d.ts +1 -0
  26. package/dist/RemotionRoot.js +9 -6
  27. package/dist/Sequence.d.ts +13 -4
  28. package/dist/Sequence.js +38 -30
  29. package/dist/Still.d.ts +1 -1
  30. package/dist/Still.js +0 -0
  31. package/dist/absolute-src.d.ts +0 -0
  32. package/dist/absolute-src.js +0 -0
  33. package/dist/asset-types.d.ts +1 -4
  34. package/dist/asset-types.js +0 -0
  35. package/dist/audio/Audio.d.ts +5 -3
  36. package/dist/audio/Audio.js +24 -4
  37. package/dist/audio/AudioForDevelopment.d.ts +6 -2
  38. package/dist/audio/AudioForDevelopment.js +42 -6
  39. package/dist/audio/AudioForRendering.d.ts +9 -2
  40. package/dist/audio/AudioForRendering.js +48 -5
  41. package/dist/audio/index.d.ts +0 -0
  42. package/dist/audio/index.js +0 -0
  43. package/dist/audio/props.d.ts +4 -2
  44. package/dist/audio/props.js +0 -0
  45. package/dist/audio/shared-audio-tags.d.ts +9 -4
  46. package/dist/audio/shared-audio-tags.js +117 -45
  47. package/dist/audio/use-audio-frame.d.ts +0 -0
  48. package/dist/audio/use-audio-frame.js +0 -0
  49. package/dist/bezier.d.ts +0 -0
  50. package/dist/bezier.js +0 -0
  51. package/dist/config/input-props.d.ts +0 -0
  52. package/dist/config/input-props.js +12 -14
  53. package/dist/config.d.ts +285 -0
  54. package/dist/config.js +21 -0
  55. package/dist/default-css.d.ts +1 -0
  56. package/dist/default-css.js +9 -2
  57. package/dist/delay-render.d.ts +0 -0
  58. package/dist/delay-render.js +4 -4
  59. package/dist/easing.d.ts +0 -0
  60. package/dist/easing.js +0 -0
  61. package/dist/freeze.d.ts +0 -0
  62. package/dist/freeze.js +0 -0
  63. package/dist/get-asset-file-name.d.ts +0 -0
  64. package/dist/get-asset-file-name.js +0 -0
  65. package/dist/get-compositions-from-markup.d.ts +3 -0
  66. package/dist/get-compositions-from-markup.js +19 -0
  67. package/dist/get-environment.d.ts +1 -0
  68. package/dist/get-environment.js +14 -2
  69. package/dist/get-preview-dom-element.d.ts +0 -0
  70. package/dist/get-preview-dom-element.js +0 -0
  71. package/dist/get-static-files.d.ts +17 -0
  72. package/dist/get-static-files.js +31 -0
  73. package/dist/get-timeline-clip-name.d.ts +0 -0
  74. package/dist/get-timeline-clip-name.js +2 -1
  75. package/dist/index.d.ts +33 -5
  76. package/dist/index.js +18 -3
  77. package/dist/internals.d.ts +50 -101
  78. package/dist/internals.js +16 -91
  79. package/dist/interpolate-colors.d.ts +0 -0
  80. package/dist/interpolate-colors.js +0 -0
  81. package/dist/interpolate.d.ts +0 -0
  82. package/dist/interpolate.js +0 -0
  83. package/dist/is-approximately-the-same.d.ts +0 -0
  84. package/dist/is-approximately-the-same.js +0 -0
  85. package/dist/is-player.d.ts +3 -0
  86. package/dist/is-player.js +14 -0
  87. package/dist/layers.d.ts +24 -0
  88. package/dist/layers.js +149 -0
  89. package/dist/loading-indicator.d.ts +0 -0
  90. package/dist/loading-indicator.js +0 -0
  91. package/dist/loop/index.d.ts +2 -2
  92. package/dist/loop/index.js +7 -5
  93. package/dist/multiple-versions-warning.d.ts +0 -0
  94. package/dist/multiple-versions-warning.js +23 -4
  95. package/dist/nonce.d.ts +0 -0
  96. package/dist/nonce.js +0 -0
  97. package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
  98. package/dist/play-and-handle-not-allowed-error.js +4 -0
  99. package/dist/portal-node.d.ts +0 -0
  100. package/dist/portal-node.js +0 -0
  101. package/dist/prefetch-state.d.ts +8 -0
  102. package/dist/prefetch-state.js +27 -0
  103. package/dist/prefetch.d.ts +9 -0
  104. package/dist/prefetch.js +108 -0
  105. package/dist/random.d.ts +2 -1
  106. package/dist/random.js +0 -0
  107. package/dist/register-root.d.ts +1 -1
  108. package/dist/register-root.js +3 -0
  109. package/dist/series/flatten-children.d.ts +1 -1
  110. package/dist/series/flatten-children.js +0 -0
  111. package/dist/series/index.d.ts +4 -4
  112. package/dist/series/index.js +4 -2
  113. package/dist/setup-env-variables.d.ts +0 -0
  114. package/dist/setup-env-variables.js +0 -0
  115. package/dist/spring/index.d.ts +8 -4
  116. package/dist/spring/index.js +21 -6
  117. package/dist/spring/measure-spring.d.ts +1 -1
  118. package/dist/spring/measure-spring.js +1 -1
  119. package/dist/spring/spring-utils.d.ts +0 -0
  120. package/dist/spring/spring-utils.js +0 -0
  121. package/dist/static-file.d.ts +4 -0
  122. package/dist/static-file.js +10 -0
  123. package/dist/timeline-position-state.d.ts +1 -1
  124. package/dist/timeline-position-state.js +0 -0
  125. package/dist/truthy.d.ts +0 -0
  126. package/dist/truthy.js +0 -0
  127. package/dist/use-current-frame.d.ts +0 -1
  128. package/dist/use-current-frame.js +10 -7
  129. package/dist/use-lazy-component.d.ts +3 -3
  130. package/dist/use-lazy-component.js +0 -0
  131. package/dist/use-media-in-timeline.d.ts +4 -3
  132. package/dist/use-media-in-timeline.js +13 -6
  133. package/dist/use-media-playback.d.ts +5 -2
  134. package/dist/use-media-playback.js +11 -6
  135. package/dist/use-media-tag-volume.d.ts +1 -1
  136. package/dist/use-media-tag-volume.js +0 -0
  137. package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
  138. package/dist/use-sync-volume-with-media-tag.js +1 -0
  139. package/dist/use-unsafe-video-config.d.ts +1 -1
  140. package/dist/use-unsafe-video-config.js +0 -0
  141. package/dist/use-video-config.d.ts +1 -1
  142. package/dist/use-video-config.js +10 -1
  143. package/dist/use-video.d.ts +13 -1
  144. package/dist/use-video.js +16 -3
  145. package/dist/validate-media-props.d.ts +3 -3
  146. package/dist/validate-media-props.js +0 -0
  147. package/dist/validate-start-from-props.d.ts +0 -0
  148. package/dist/validate-start-from-props.js +0 -0
  149. package/dist/validation/validate-composition-id.d.ts +0 -0
  150. package/dist/validation/validate-composition-id.js +0 -0
  151. package/dist/validation/validate-dimensions.d.ts +0 -0
  152. package/dist/validation/validate-dimensions.js +0 -0
  153. package/dist/validation/validate-duration-in-frames.d.ts +0 -0
  154. package/dist/validation/validate-duration-in-frames.js +0 -0
  155. package/dist/validation/validate-folder-name.d.ts +0 -0
  156. package/dist/validation/validate-folder-name.js +0 -0
  157. package/dist/validation/validate-fps.d.ts +1 -1
  158. package/dist/validation/validate-fps.js +4 -1
  159. package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
  160. package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
  161. package/dist/validation/validation-spring-duration.d.ts +1 -0
  162. package/dist/validation/validation-spring-duration.js +21 -0
  163. package/dist/version.d.ts +1 -0
  164. package/dist/version.js +5 -0
  165. package/dist/video/NativeVideo.d.ts +5 -0
  166. package/dist/video/NativeVideo.js +33 -0
  167. package/dist/video/NativeVideoForRendering.d.ts +8 -0
  168. package/dist/video/NativeVideoForRendering.js +14 -0
  169. package/dist/video/OffthreadVideo.d.ts +2 -2
  170. package/dist/video/OffthreadVideo.js +10 -2
  171. package/dist/video/OffthreadVideoForRendering.d.ts +1 -1
  172. package/dist/video/OffthreadVideoForRendering.js +24 -13
  173. package/dist/video/Video.d.ts +5 -3
  174. package/dist/video/Video.js +25 -4
  175. package/dist/video/VideoForDevelopment.d.ts +10 -2
  176. package/dist/video/VideoForDevelopment.js +75 -7
  177. package/dist/video/VideoForRendering.d.ts +9 -2
  178. package/dist/video/VideoForRendering.js +80 -23
  179. package/dist/video/duration-state.d.ts +17 -0
  180. package/dist/video/duration-state.js +34 -0
  181. package/dist/video/get-current-time.d.ts +2 -1
  182. package/dist/video/get-current-time.js +7 -7
  183. package/dist/video/index.d.ts +1 -1
  184. package/dist/video/index.js +0 -0
  185. package/dist/video/props.d.ts +9 -3
  186. package/dist/video/props.js +0 -0
  187. package/dist/video/video-fragment.d.ts +12 -0
  188. package/dist/video/video-fragment.js +60 -0
  189. package/dist/video-config.d.ts +0 -0
  190. package/dist/video-config.js +0 -0
  191. package/dist/volume-position-state.d.ts +0 -0
  192. package/dist/volume-position-state.js +0 -0
  193. package/dist/volume-prop.d.ts +2 -1
  194. package/dist/volume-prop.js +4 -3
  195. package/dist/warn-about-non-seekable-media.d.ts +1 -1
  196. package/dist/warn-about-non-seekable-media.js +14 -2
  197. package/dist/wrap-remotion-context.d.ts +5 -0
  198. package/dist/wrap-remotion-context.js +13 -1
  199. package/package.json +26 -16
  200. package/.turbo/turbo-build.log +0 -5
  201. package/dist/AbsoluteFill.d.ts.map +0 -1
  202. package/dist/AbsoluteFill.js.map +0 -1
  203. package/dist/Composition.d.ts.map +0 -1
  204. package/dist/Composition.js.map +0 -1
  205. package/dist/CompositionManager.d.ts.map +0 -1
  206. package/dist/CompositionManager.js.map +0 -1
  207. package/dist/IFrame.d.ts.map +0 -1
  208. package/dist/IFrame.js.map +0 -1
  209. package/dist/Img.d.ts.map +0 -1
  210. package/dist/Img.js.map +0 -1
  211. package/dist/RemotionRoot.d.ts.map +0 -1
  212. package/dist/RemotionRoot.js.map +0 -1
  213. package/dist/Still.d.ts.map +0 -1
  214. package/dist/Still.js.map +0 -1
  215. package/dist/absolute-src.d.ts.map +0 -1
  216. package/dist/absolute-src.js.map +0 -1
  217. package/dist/asset-types.d.ts.map +0 -1
  218. package/dist/asset-types.js.map +0 -1
  219. package/dist/audio/Audio.d.ts.map +0 -1
  220. package/dist/audio/Audio.js.map +0 -1
  221. package/dist/audio/AudioForDevelopment.d.ts.map +0 -1
  222. package/dist/audio/AudioForDevelopment.js.map +0 -1
  223. package/dist/audio/AudioForRendering.d.ts.map +0 -1
  224. package/dist/audio/AudioForRendering.js.map +0 -1
  225. package/dist/audio/index.d.ts.map +0 -1
  226. package/dist/audio/index.js.map +0 -1
  227. package/dist/audio/props.d.ts.map +0 -1
  228. package/dist/audio/props.js.map +0 -1
  229. package/dist/audio/shared-audio-tags.d.ts.map +0 -1
  230. package/dist/audio/shared-audio-tags.js.map +0 -1
  231. package/dist/audio/use-audio-frame.d.ts.map +0 -1
  232. package/dist/audio/use-audio-frame.js.map +0 -1
  233. package/dist/bezier.d.ts.map +0 -1
  234. package/dist/bezier.js.map +0 -1
  235. package/dist/compress-assets.d.ts +0 -7
  236. package/dist/compress-assets.d.ts.map +0 -1
  237. package/dist/compress-assets.js +0 -25
  238. package/dist/compress-assets.js.map +0 -1
  239. package/dist/config/browser-executable.d.ts +0 -3
  240. package/dist/config/browser-executable.d.ts.map +0 -1
  241. package/dist/config/browser-executable.js +0 -12
  242. package/dist/config/browser-executable.js.map +0 -1
  243. package/dist/config/browser.d.ts +0 -4
  244. package/dist/config/browser.d.ts.map +0 -1
  245. package/dist/config/browser.js +0 -19
  246. package/dist/config/browser.js.map +0 -1
  247. package/dist/config/bundle-out-dir.d.ts +0 -2
  248. package/dist/config/bundle-out-dir.js +0 -12
  249. package/dist/config/chromium-flags.d.ts +0 -10
  250. package/dist/config/chromium-flags.d.ts.map +0 -1
  251. package/dist/config/chromium-flags.js +0 -34
  252. package/dist/config/chromium-flags.js.map +0 -1
  253. package/dist/config/codec.d.ts +0 -17
  254. package/dist/config/codec.d.ts.map +0 -1
  255. package/dist/config/codec.js +0 -103
  256. package/dist/config/codec.js.map +0 -1
  257. package/dist/config/concurrency.d.ts +0 -3
  258. package/dist/config/concurrency.d.ts.map +0 -1
  259. package/dist/config/concurrency.js +0 -15
  260. package/dist/config/concurrency.js.map +0 -1
  261. package/dist/config/crf.d.ts +0 -9
  262. package/dist/config/crf.d.ts.map +0 -1
  263. package/dist/config/crf.js +0 -83
  264. package/dist/config/crf.js.map +0 -1
  265. package/dist/config/env-file.d.ts +0 -2
  266. package/dist/config/env-file.d.ts.map +0 -1
  267. package/dist/config/env-file.js +0 -10
  268. package/dist/config/env-file.js.map +0 -1
  269. package/dist/config/every-nth-file.d.ts +0 -2
  270. package/dist/config/every-nth-file.js +0 -12
  271. package/dist/config/ffmpeg-executable.d.ts +0 -5
  272. package/dist/config/ffmpeg-executable.d.ts.map +0 -1
  273. package/dist/config/ffmpeg-executable.js +0 -21
  274. package/dist/config/ffmpeg-executable.js.map +0 -1
  275. package/dist/config/frame-range.d.ts +0 -5
  276. package/dist/config/frame-range.d.ts.map +0 -1
  277. package/dist/config/frame-range.js +0 -80
  278. package/dist/config/frame-range.js.map +0 -1
  279. package/dist/config/image-format.d.ts +0 -8
  280. package/dist/config/image-format.d.ts.map +0 -1
  281. package/dist/config/image-format.js +0 -37
  282. package/dist/config/image-format.js.map +0 -1
  283. package/dist/config/image-sequence.d.ts +0 -3
  284. package/dist/config/image-sequence.d.ts.map +0 -1
  285. package/dist/config/image-sequence.js +0 -15
  286. package/dist/config/image-sequence.js.map +0 -1
  287. package/dist/config/index.d.ts +0 -167
  288. package/dist/config/index.d.ts.map +0 -1
  289. package/dist/config/index.js +0 -180
  290. package/dist/config/index.js.map +0 -1
  291. package/dist/config/input-props.d.ts.map +0 -1
  292. package/dist/config/input-props.js.map +0 -1
  293. package/dist/config/log.d.ts +0 -7
  294. package/dist/config/log.d.ts.map +0 -1
  295. package/dist/config/log.js +0 -25
  296. package/dist/config/log.js.map +0 -1
  297. package/dist/config/loop.d.ts +0 -3
  298. package/dist/config/loop.js +0 -15
  299. package/dist/config/max-timeline-tracks.d.ts +0 -2
  300. package/dist/config/max-timeline-tracks.d.ts.map +0 -1
  301. package/dist/config/max-timeline-tracks.js +0 -24
  302. package/dist/config/max-timeline-tracks.js.map +0 -1
  303. package/dist/config/override-webpack.d.ts +0 -6
  304. package/dist/config/override-webpack.d.ts.map +0 -1
  305. package/dist/config/override-webpack.js +0 -14
  306. package/dist/config/override-webpack.js.map +0 -1
  307. package/dist/config/overwrite.d.ts +0 -3
  308. package/dist/config/overwrite.d.ts.map +0 -1
  309. package/dist/config/overwrite.js +0 -14
  310. package/dist/config/overwrite.js.map +0 -1
  311. package/dist/config/pixel-format.d.ts +0 -8
  312. package/dist/config/pixel-format.d.ts.map +0 -1
  313. package/dist/config/pixel-format.js +0 -38
  314. package/dist/config/pixel-format.js.map +0 -1
  315. package/dist/config/preview-server.d.ts +0 -2
  316. package/dist/config/preview-server.d.ts.map +0 -1
  317. package/dist/config/preview-server.js +0 -20
  318. package/dist/config/preview-server.js.map +0 -1
  319. package/dist/config/prores-profile.d.ts +0 -7
  320. package/dist/config/prores-profile.d.ts.map +0 -1
  321. package/dist/config/prores-profile.js +0 -32
  322. package/dist/config/prores-profile.js.map +0 -1
  323. package/dist/config/public-path.d.ts +0 -2
  324. package/dist/config/public-path.js +0 -12
  325. package/dist/config/quality.d.ts +0 -2
  326. package/dist/config/quality.d.ts.map +0 -1
  327. package/dist/config/quality.js +0 -17
  328. package/dist/config/quality.js.map +0 -1
  329. package/dist/config/scale.d.ts +0 -3
  330. package/dist/config/scale.d.ts.map +0 -1
  331. package/dist/config/scale.js +0 -15
  332. package/dist/config/scale.js.map +0 -1
  333. package/dist/config/still-frame.d.ts +0 -2
  334. package/dist/config/still-frame.d.ts.map +0 -1
  335. package/dist/config/still-frame.js +0 -12
  336. package/dist/config/still-frame.js.map +0 -1
  337. package/dist/config/timeout.d.ts +0 -2
  338. package/dist/config/timeout.d.ts.map +0 -1
  339. package/dist/config/timeout.js +0 -17
  340. package/dist/config/timeout.js.map +0 -1
  341. package/dist/config/webpack-caching.d.ts +0 -3
  342. package/dist/config/webpack-caching.d.ts.map +0 -1
  343. package/dist/config/webpack-caching.js +0 -16
  344. package/dist/config/webpack-caching.js.map +0 -1
  345. package/dist/default-css.d.ts.map +0 -1
  346. package/dist/default-css.js.map +0 -1
  347. package/dist/delay-render.d.ts.map +0 -1
  348. package/dist/delay-render.js.map +0 -1
  349. package/dist/easing.d.ts.map +0 -1
  350. package/dist/easing.js.map +0 -1
  351. package/dist/feature-flags.d.ts +0 -1
  352. package/dist/feature-flags.d.ts.map +0 -1
  353. package/dist/feature-flags.js +0 -7
  354. package/dist/feature-flags.js.map +0 -1
  355. package/dist/freeze.d.ts.map +0 -1
  356. package/dist/freeze.js.map +0 -1
  357. package/dist/get-asset-file-name.d.ts.map +0 -1
  358. package/dist/get-asset-file-name.js.map +0 -1
  359. package/dist/get-environment.d.ts.map +0 -1
  360. package/dist/get-environment.js.map +0 -1
  361. package/dist/get-preview-dom-element.d.ts.map +0 -1
  362. package/dist/get-preview-dom-element.js.map +0 -1
  363. package/dist/get-timeline-clip-name.d.ts.map +0 -1
  364. package/dist/get-timeline-clip-name.js.map +0 -1
  365. package/dist/index.d.ts.map +0 -1
  366. package/dist/index.js.map +0 -1
  367. package/dist/initial-frame.d.ts +0 -2
  368. package/dist/initial-frame.d.ts.map +0 -1
  369. package/dist/initial-frame.js +0 -12
  370. package/dist/initial-frame.js.map +0 -1
  371. package/dist/internals.d.ts.map +0 -1
  372. package/dist/internals.js.map +0 -1
  373. package/dist/interpolate.d.ts.map +0 -1
  374. package/dist/interpolate.js.map +0 -1
  375. package/dist/interpolateColors.d.ts +0 -5
  376. package/dist/interpolateColors.d.ts.map +0 -1
  377. package/dist/interpolateColors.js +0 -401
  378. package/dist/interpolateColors.js.map +0 -1
  379. package/dist/is-approximately-the-same.d.ts.map +0 -1
  380. package/dist/is-approximately-the-same.js.map +0 -1
  381. package/dist/is-audio-codec.d.ts +0 -2
  382. package/dist/is-audio-codec.d.ts.map +0 -1
  383. package/dist/is-audio-codec.js +0 -7
  384. package/dist/is-audio-codec.js.map +0 -1
  385. package/dist/loop/index.d.ts.map +0 -1
  386. package/dist/loop/index.js.map +0 -1
  387. package/dist/multiple-versions-warning.d.ts.map +0 -1
  388. package/dist/multiple-versions-warning.js.map +0 -1
  389. package/dist/nonce.d.ts.map +0 -1
  390. package/dist/nonce.js.map +0 -1
  391. package/dist/perf/index.d.ts +0 -5
  392. package/dist/perf/index.d.ts.map +0 -1
  393. package/dist/perf/index.js +0 -35
  394. package/dist/perf/index.js.map +0 -1
  395. package/dist/play-and-handle-not-allowed-error.d.ts.map +0 -1
  396. package/dist/play-and-handle-not-allowed-error.js.map +0 -1
  397. package/dist/random.d.ts.map +0 -1
  398. package/dist/random.js.map +0 -1
  399. package/dist/register-root.d.ts.map +0 -1
  400. package/dist/register-root.js.map +0 -1
  401. package/dist/sequencing/index.d.ts +0 -19
  402. package/dist/sequencing/index.d.ts.map +0 -1
  403. package/dist/sequencing/index.js +0 -123
  404. package/dist/sequencing/index.js.map +0 -1
  405. package/dist/series/flatten-children.d.ts.map +0 -1
  406. package/dist/series/flatten-children.js.map +0 -1
  407. package/dist/series/index.d.ts.map +0 -1
  408. package/dist/series/index.js.map +0 -1
  409. package/dist/setup-env-variables.d.ts.map +0 -1
  410. package/dist/setup-env-variables.js.map +0 -1
  411. package/dist/spring/index.d.ts.map +0 -1
  412. package/dist/spring/index.js.map +0 -1
  413. package/dist/spring/measure-spring.d.ts.map +0 -1
  414. package/dist/spring/measure-spring.js.map +0 -1
  415. package/dist/spring/spring-utils.d.ts.map +0 -1
  416. package/dist/spring/spring-utils.js.map +0 -1
  417. package/dist/static-file.d.ts.map +0 -1
  418. package/dist/static-file.js.map +0 -1
  419. package/dist/timeline-inout-position-state.d.ts +0 -12
  420. package/dist/timeline-inout-position-state.d.ts.map +0 -1
  421. package/dist/timeline-inout-position-state.js +0 -23
  422. package/dist/timeline-inout-position-state.js.map +0 -1
  423. package/dist/timeline-position-state.d.ts.map +0 -1
  424. package/dist/timeline-position-state.js.map +0 -1
  425. package/dist/timeout.d.ts +0 -2
  426. package/dist/timeout.d.ts.map +0 -1
  427. package/dist/timeout.js +0 -12
  428. package/dist/timeout.js.map +0 -1
  429. package/dist/truthy.d.ts.map +0 -1
  430. package/dist/truthy.js.map +0 -1
  431. package/dist/use-frame.d.ts +0 -7
  432. package/dist/use-frame.d.ts.map +0 -1
  433. package/dist/use-frame.js +0 -25
  434. package/dist/use-frame.js.map +0 -1
  435. package/dist/use-lazy-component.d.ts.map +0 -1
  436. package/dist/use-lazy-component.js.map +0 -1
  437. package/dist/use-media-in-timeline.d.ts.map +0 -1
  438. package/dist/use-media-in-timeline.js.map +0 -1
  439. package/dist/use-media-playback.d.ts.map +0 -1
  440. package/dist/use-media-playback.js.map +0 -1
  441. package/dist/use-media-tag-volume.d.ts.map +0 -1
  442. package/dist/use-media-tag-volume.js.map +0 -1
  443. package/dist/use-sync-volume-with-media-tag.d.ts.map +0 -1
  444. package/dist/use-sync-volume-with-media-tag.js.map +0 -1
  445. package/dist/use-unsafe-video-config.d.ts.map +0 -1
  446. package/dist/use-unsafe-video-config.js.map +0 -1
  447. package/dist/use-video-config.d.ts.map +0 -1
  448. package/dist/use-video-config.js.map +0 -1
  449. package/dist/use-video.d.ts.map +0 -1
  450. package/dist/use-video.js.map +0 -1
  451. package/dist/validate-media-props.d.ts.map +0 -1
  452. package/dist/validate-media-props.js.map +0 -1
  453. package/dist/validate-start-from-props.d.ts.map +0 -1
  454. package/dist/validate-start-from-props.js.map +0 -1
  455. package/dist/validation/validate-composition-id.d.ts.map +0 -1
  456. package/dist/validation/validate-composition-id.js.map +0 -1
  457. package/dist/validation/validate-dimensions.d.ts.map +0 -1
  458. package/dist/validation/validate-dimensions.js.map +0 -1
  459. package/dist/validation/validate-duration-in-frames.d.ts.map +0 -1
  460. package/dist/validation/validate-duration-in-frames.js.map +0 -1
  461. package/dist/validation/validate-every-nth-frame.d.ts +0 -1
  462. package/dist/validation/validate-every-nth-frame.js +0 -21
  463. package/dist/validation/validate-folder-name.d.ts.map +0 -1
  464. package/dist/validation/validate-folder-name.js.map +0 -1
  465. package/dist/validation/validate-fps.d.ts.map +0 -1
  466. package/dist/validation/validate-fps.js.map +0 -1
  467. package/dist/validation/validate-frame.d.ts +0 -1
  468. package/dist/validation/validate-frame.d.ts.map +0 -1
  469. package/dist/validation/validate-frame.js +0 -24
  470. package/dist/validation/validate-frame.js.map +0 -1
  471. package/dist/validation/validate-image-format.d.ts +0 -2
  472. package/dist/validation/validate-image-format.d.ts.map +0 -1
  473. package/dist/validation/validate-image-format.js +0 -9
  474. package/dist/validation/validate-image-format.js.map +0 -1
  475. package/dist/validation/validate-opengl-renderer.d.ts +0 -4
  476. package/dist/validation/validate-opengl-renderer.d.ts.map +0 -1
  477. package/dist/validation/validate-opengl-renderer.js +0 -14
  478. package/dist/validation/validate-opengl-renderer.js.map +0 -1
  479. package/dist/validation/validate-quality.d.ts +0 -1
  480. package/dist/validation/validate-quality.d.ts.map +0 -1
  481. package/dist/validation/validate-quality.js +0 -21
  482. package/dist/validation/validate-quality.js.map +0 -1
  483. package/dist/video/Video.d.ts.map +0 -1
  484. package/dist/video/Video.js.map +0 -1
  485. package/dist/video/VideoForDevelopment.d.ts.map +0 -1
  486. package/dist/video/VideoForDevelopment.js.map +0 -1
  487. package/dist/video/VideoForRendering.d.ts.map +0 -1
  488. package/dist/video/VideoForRendering.js.map +0 -1
  489. package/dist/video/get-current-time.d.ts.map +0 -1
  490. package/dist/video/get-current-time.js.map +0 -1
  491. package/dist/video/index.d.ts.map +0 -1
  492. package/dist/video/index.js.map +0 -1
  493. package/dist/video/props.d.ts.map +0 -1
  494. package/dist/video/props.js.map +0 -1
  495. package/dist/video-config.d.ts.map +0 -1
  496. package/dist/video-config.js.map +0 -1
  497. package/dist/volume-position-state.d.ts.map +0 -1
  498. package/dist/volume-position-state.js.map +0 -1
  499. package/dist/volume-prop.d.ts.map +0 -1
  500. package/dist/volume-prop.js.map +0 -1
  501. package/dist/warn-about-non-seekable-media.d.ts.map +0 -1
  502. package/dist/warn-about-non-seekable-media.js.map +0 -1
  503. package/dist/wrap-remotion-context.d.ts.map +0 -1
  504. package/dist/wrap-remotion-context.js.map +0 -1
package/dist/random.js CHANGED
File without changes
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import type React from 'react';
2
2
  export declare const registerRoot: (comp: React.FC) => void;
3
3
  export declare const getRoot: () => React.FC<{}> | null;
4
4
  export declare const waitForRoot: (fn: (comp: React.FC) => void) => (() => void);
@@ -4,6 +4,9 @@ exports.waitForRoot = exports.getRoot = exports.registerRoot = void 0;
4
4
  let Root = null;
5
5
  let listeners = [];
6
6
  const registerRoot = (comp) => {
7
+ if (!comp) {
8
+ throw new Error(`You must pass a React component to registerRoot(), but ${JSON.stringify(comp)} was passed.`);
9
+ }
7
10
  if (Root) {
8
11
  throw new Error('registerRoot() was called more than once.');
9
12
  }
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const flattenChildren: (children: React.ReactNode) => (React.ReactChild | React.ReactFragment | React.ReactPortal)[];
2
+ export declare const flattenChildren: (children: React.ReactNode) => (string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | React.ReactPortal)[];
File without changes
@@ -1,10 +1,10 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- import { SequenceProps } from '../Sequence';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ import type { LayoutAndStyle, SequenceProps } from '../Sequence';
3
3
  declare type SeriesSequenceProps = PropsWithChildren<{
4
4
  durationInFrames: number;
5
5
  offset?: number;
6
- } & Pick<SequenceProps, 'layout' | 'name'>>;
7
- declare const SeriesSequence: ({ children }: SeriesSequenceProps) => JSX.Element;
6
+ } & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
7
+ declare const SeriesSequence: import("react").ForwardRefExoticComponent<SeriesSequenceProps & import("react").RefAttributes<HTMLDivElement>>;
8
8
  declare const Series: FC<{
9
9
  children: React.ReactNode;
10
10
  }> & {
@@ -6,10 +6,12 @@ const react_1 = require("react");
6
6
  const Sequence_1 = require("../Sequence");
7
7
  const validate_duration_in_frames_1 = require("../validation/validate-duration-in-frames");
8
8
  const flatten_children_1 = require("./flatten-children");
9
- const SeriesSequence = ({ children }) => {
9
+ const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
10
+ // Discard ref
10
11
  // eslint-disable-next-line react/jsx-no-useless-fragment
11
12
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
12
13
  };
14
+ const SeriesSequence = (0, react_1.forwardRef)(SeriesSequenceRefForwardingFunction);
13
15
  const Series = ({ children }) => {
14
16
  const childrenValue = (0, react_1.useMemo)(() => {
15
17
  let startFrame = 0;
@@ -45,7 +47,7 @@ const Series = ({ children }) => {
45
47
  }
46
48
  const currentStartFrame = startFrame + offset;
47
49
  startFrame += durationInFramesProp + offset;
48
- return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: child }));
50
+ return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
49
51
  });
50
52
  }, [children]);
51
53
  /* eslint-disable react/jsx-no-useless-fragment */
File without changes
File without changes
@@ -1,4 +1,4 @@
1
- import { SpringConfig } from './spring-utils';
1
+ import type { SpringConfig } from './spring-utils';
2
2
  /**
3
3
  * Calculates a position based on physical parameters, start and end value, and time.
4
4
  * @link https://www.remotion.dev/docs/spring
@@ -9,15 +9,19 @@ import { SpringConfig } from './spring-utils';
9
9
  * @param {number} [config.damping=10] How hard the animation decelerates.
10
10
  * @param {number} [config.stiffness=100] Affects bounciness of the animation.
11
11
  * @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
12
- * @param {?number} from The initial value of the animation. Default `0`
13
- * @param {?number} to The end value of the animation. Default `1`
12
+ * @param {?number} [config.from] The initial value of the animation. Default `0`
13
+ * @param {?number} [config.to] The end value of the animation. Default `1`
14
+ * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
15
+ * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
14
16
  */
15
- export declare function spring({ frame, fps, config, from, to, }: {
17
+ export declare function spring({ frame, fps, config, from, to, durationInFrames, durationRestThreshold, }: {
16
18
  frame: number;
17
19
  fps: number;
18
20
  config?: Partial<SpringConfig>;
19
21
  from?: number;
20
22
  to?: number;
23
+ durationInFrames?: number;
24
+ durationRestThreshold?: number;
21
25
  }): number;
22
26
  export { measureSpring } from './measure-spring';
23
27
  export { SpringConfig } from './spring-utils';
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.measureSpring = exports.spring = void 0;
4
+ const validation_spring_duration_1 = require("../validation/validation-spring-duration");
5
+ const measure_spring_1 = require("./measure-spring");
4
6
  const spring_utils_1 = require("./spring-utils");
5
7
  /**
6
8
  * Calculates a position based on physical parameters, start and end value, and time.
@@ -12,13 +14,26 @@ const spring_utils_1 = require("./spring-utils");
12
14
  * @param {number} [config.damping=10] How hard the animation decelerates.
13
15
  * @param {number} [config.stiffness=100] Affects bounciness of the animation.
14
16
  * @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
15
- * @param {?number} from The initial value of the animation. Default `0`
16
- * @param {?number} to The end value of the animation. Default `1`
17
+ * @param {?number} [config.from] The initial value of the animation. Default `0`
18
+ * @param {?number} [config.to] The end value of the animation. Default `1`
19
+ * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
20
+ * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
17
21
  */
18
- function spring({ frame, fps, config = {}, from = 0, to = 1, }) {
22
+ function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, }) {
23
+ (0, validation_spring_duration_1.validateSpringDuration)(durationInFrames);
24
+ const durationRatio = durationInFrames === undefined
25
+ ? 1
26
+ : durationInFrames /
27
+ (0, measure_spring_1.measureSpring)({
28
+ fps,
29
+ config,
30
+ from,
31
+ to,
32
+ threshold: durationRestThreshold,
33
+ });
19
34
  const spr = (0, spring_utils_1.springCalculation)({
20
35
  fps,
21
- frame,
36
+ frame: frame / durationRatio,
22
37
  config,
23
38
  from,
24
39
  to,
@@ -32,5 +47,5 @@ function spring({ frame, fps, config = {}, from = 0, to = 1, }) {
32
47
  return Math.max(spr.current, to);
33
48
  }
34
49
  exports.spring = spring;
35
- var measure_spring_1 = require("./measure-spring");
36
- Object.defineProperty(exports, "measureSpring", { enumerable: true, get: function () { return measure_spring_1.measureSpring; } });
50
+ var measure_spring_2 = require("./measure-spring");
51
+ Object.defineProperty(exports, "measureSpring", { enumerable: true, get: function () { return measure_spring_2.measureSpring; } });
@@ -1,4 +1,4 @@
1
- import { SpringConfig } from './spring-utils';
1
+ import type { SpringConfig } from './spring-utils';
2
2
  export declare function measureSpring({ fps, config, threshold, from, to, }: {
3
3
  fps: number;
4
4
  config?: Partial<SpringConfig>;
@@ -22,7 +22,7 @@ function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1,
22
22
  if (threshold < 0) {
23
23
  throw new TypeError('Threshold is below 0');
24
24
  }
25
- (0, validate_fps_1.validateFps)(fps, 'to the measureSpring() function');
25
+ (0, validate_fps_1.validateFps)(fps, 'to the measureSpring() function', false);
26
26
  const range = Math.abs(from - to);
27
27
  let frame = 0;
28
28
  let finishedFrame = 0;
File without changes
File without changes
@@ -1 +1,5 @@
1
+ /**
2
+ * Reference a file from the public/ folder.
3
+ * If the file does not appear in the autocomplete, type the path manually.
4
+ */
1
5
  export declare const staticFile: (path: string) => string;
@@ -13,7 +13,17 @@ const inner = (path) => {
13
13
  }
14
14
  return `/${trimLeadingSlash(path)}`;
15
15
  };
16
+ /**
17
+ * Reference a file from the public/ folder.
18
+ * If the file does not appear in the autocomplete, type the path manually.
19
+ */
16
20
  const staticFile = (path) => {
21
+ if (path.startsWith('http://') || path.startsWith('https://')) {
22
+ throw new TypeError(`staticFile() does not support remote URLs - got "${path}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);
23
+ }
24
+ if (path.startsWith('..') || path.startsWith('./')) {
25
+ throw new TypeError(`staticFile() does not support relative paths - got "${path}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);
26
+ }
17
27
  const preparsed = inner(path);
18
28
  if (!preparsed.startsWith('/')) {
19
29
  return `/${preparsed}`;
@@ -1,4 +1,4 @@
1
- import { MutableRefObject } from 'react';
1
+ import type { MutableRefObject } from 'react';
2
2
  export declare type PlayableMediaTag = {
3
3
  play: () => void;
4
4
  id: string;
File without changes
package/dist/truthy.d.ts CHANGED
File without changes
package/dist/truthy.js CHANGED
File without changes
@@ -1,4 +1,3 @@
1
- export declare const useAbsoluteCurrentFrame: () => number;
2
1
  /**
3
2
  * Get the current frame of the video.
4
3
  * Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
@@ -1,21 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCurrentFrame = exports.useAbsoluteCurrentFrame = void 0;
3
+ exports.useCurrentFrame = void 0;
4
4
  const react_1 = require("react");
5
+ const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
5
6
  const Sequence_1 = require("./Sequence");
6
7
  const timeline_position_state_1 = require("./timeline-position-state");
7
- const useAbsoluteCurrentFrame = () => {
8
- const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
9
- return timelinePosition;
10
- };
11
- exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
12
8
  /**
13
9
  * Get the current frame of the video.
14
10
  * Frames are 0-indexed, meaning the first frame is 0, the last frame is the duration of the composition in frames minus one.
15
11
  * @link https://www.remotion.dev/docs/use-current-frame
16
12
  */
17
13
  const useCurrentFrame = () => {
18
- const frame = (0, exports.useAbsoluteCurrentFrame)();
14
+ const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
15
+ if (!canUseRemotionHooks) {
16
+ if (typeof window !== 'undefined' && window.remotion_isPlayer) {
17
+ throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
18
+ }
19
+ throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
20
+ }
21
+ const frame = (0, timeline_position_state_1.useTimelinePosition)();
19
22
  const context = (0, react_1.useContext)(Sequence_1.SequenceContext);
20
23
  const contextOffset = context
21
24
  ? context.cumulatedFrom + context.relativeFrom
@@ -1,7 +1,7 @@
1
- import React, { ComponentPropsWithRef, ComponentType, ExoticComponent } from 'react';
2
- import { CompProps } from './internals';
1
+ import type { ComponentPropsWithRef, ComponentType, ExoticComponent } from 'react';
2
+ import type { CompProps } from './internals';
3
3
  declare type LazyExoticComponent<T extends ComponentType<any>> = ExoticComponent<ComponentPropsWithRef<T>> & {
4
4
  readonly _result: T;
5
5
  };
6
- export declare const useLazyComponent: <T>(compProps: CompProps<T>) => LazyExoticComponent<React.ComponentType<T>>;
6
+ export declare const useLazyComponent: <T>(compProps: CompProps<T>) => LazyExoticComponent<ComponentType<T>>;
7
7
  export {};
File without changes
@@ -1,9 +1,10 @@
1
- import { RefObject } from 'react';
2
- import { VolumeProp } from './volume-prop';
3
- export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, }: {
1
+ import type { RefObject } from 'react';
2
+ import type { VolumeProp } from './volume-prop';
3
+ export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }: {
4
4
  volume: VolumeProp | undefined;
5
5
  mediaVolume: number;
6
6
  mediaRef: RefObject<HTMLAudioElement | HTMLVideoElement>;
7
7
  src: string | undefined;
8
8
  mediaType: 'audio' | 'video';
9
+ playbackRate: number;
9
10
  }) => void;
@@ -5,6 +5,7 @@ const react_1 = require("react");
5
5
  const use_audio_frame_1 = require("./audio/use-audio-frame");
6
6
  const CompositionManager_1 = require("./CompositionManager");
7
7
  const get_asset_file_name_1 = require("./get-asset-file-name");
8
+ const get_environment_1 = require("./get-environment");
8
9
  const nonce_1 = require("./nonce");
9
10
  const play_and_handle_not_allowed_error_1 = require("./play-and-handle-not-allowed-error");
10
11
  const Sequence_1 = require("./Sequence");
@@ -19,7 +20,7 @@ const warnOnce = (message) => {
19
20
  console.warn(message);
20
21
  didWarn[message] = true;
21
22
  };
22
- const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, }) => {
23
+ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }) => {
23
24
  const videoConfig = (0, use_video_config_1.useVideoConfig)();
24
25
  const { rootId, audioAndVideoTags } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
25
26
  const parentSequence = (0, react_1.useContext)(Sequence_1.SequenceContext);
@@ -32,12 +33,11 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
32
33
  const [id] = (0, react_1.useState)(() => String(Math.random()));
33
34
  const [initialVolume] = (0, react_1.useState)(() => volume);
34
35
  const nonce = (0, nonce_1.useNonce)();
35
- const duration = (() => {
36
- return parentSequence
37
- ? Math.min(parentSequence.durationInFrames, videoConfig.durationInFrames)
38
- : videoConfig.durationInFrames;
39
- })();
36
+ const duration = parentSequence
37
+ ? Math.min(parentSequence.durationInFrames, videoConfig.durationInFrames)
38
+ : videoConfig.durationInFrames;
40
39
  const doesVolumeChange = typeof volume === 'function';
40
+ const environment = (0, get_environment_1.useRemotionEnvironment)();
41
41
  const volumes = (0, react_1.useMemo)(() => {
42
42
  if (typeof volume === 'number') {
43
43
  return volume;
@@ -49,6 +49,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
49
49
  frame: i + startsAt,
50
50
  volume,
51
51
  mediaVolume,
52
+ allowAmplificationDuringRender: false,
52
53
  });
53
54
  })
54
55
  .join(',');
@@ -66,6 +67,9 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
66
67
  if (!src) {
67
68
  throw new Error('No src passed');
68
69
  }
70
+ if (environment !== 'preview' && process.env.NODE_ENV !== 'test') {
71
+ return;
72
+ }
69
73
  registerSequence({
70
74
  type: mediaType,
71
75
  src,
@@ -81,6 +85,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
81
85
  startMediaFrom: 0 - startsAt,
82
86
  doesVolumeChange,
83
87
  showLoopTimesInTimeline: undefined,
88
+ playbackRate,
84
89
  });
85
90
  return () => {
86
91
  unregisterSequence(id);
@@ -101,6 +106,8 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
101
106
  mediaRef,
102
107
  mediaType,
103
108
  startsAt,
109
+ playbackRate,
110
+ environment,
104
111
  ]);
105
112
  (0, react_1.useEffect)(() => {
106
113
  const tag = {
@@ -1,7 +1,10 @@
1
- import { RefObject } from 'react';
2
- export declare const useMediaPlayback: ({ mediaRef, src, mediaType, playbackRate: localPlaybackRate, }: {
1
+ import type { RefObject } from 'react';
2
+ export declare const DEFAULT_ACCEPTABLE_TIMESHIFT = 0.45;
3
+ export declare const useMediaPlayback: ({ mediaRef, src, mediaType, playbackRate: localPlaybackRate, onlyWarnForMediaSeekingError, acceptableTimeshift, }: {
3
4
  mediaRef: RefObject<HTMLVideoElement | HTMLAudioElement>;
4
5
  src: string | undefined;
5
6
  mediaType: 'audio' | 'video';
6
7
  playbackRate: number;
8
+ onlyWarnForMediaSeekingError: boolean;
9
+ acceptableTimeshift: number;
7
10
  }) => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMediaPlayback = void 0;
3
+ exports.useMediaPlayback = exports.DEFAULT_ACCEPTABLE_TIMESHIFT = void 0;
4
4
  const react_1 = require("react");
5
5
  const use_audio_frame_1 = require("./audio/use-audio-frame");
6
6
  const play_and_handle_not_allowed_error_1 = require("./play-and-handle-not-allowed-error");
@@ -9,10 +9,11 @@ const use_current_frame_1 = require("./use-current-frame");
9
9
  const use_video_config_1 = require("./use-video-config");
10
10
  const get_current_time_1 = require("./video/get-current-time");
11
11
  const warn_about_non_seekable_media_1 = require("./warn-about-non-seekable-media");
12
- const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybackRate, }) => {
12
+ exports.DEFAULT_ACCEPTABLE_TIMESHIFT = 0.45;
13
+ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybackRate, onlyWarnForMediaSeekingError, acceptableTimeshift, }) => {
13
14
  const { playbackRate: globalPlaybackRate } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
14
15
  const frame = (0, use_current_frame_1.useCurrentFrame)();
15
- const absoluteFrame = (0, use_current_frame_1.useAbsoluteCurrentFrame)();
16
+ const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
16
17
  const [playing] = (0, timeline_position_state_1.usePlayingState)();
17
18
  const { fps } = (0, use_video_config_1.useVideoConfig)();
18
19
  const mediaStartsAt = (0, use_audio_frame_1.useMediaStartsAt)();
@@ -38,15 +39,17 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
38
39
  src,
39
40
  playbackRate: localPlaybackRate,
40
41
  startFrom: -mediaStartsAt,
42
+ mediaType,
41
43
  });
42
44
  const isTime = mediaRef.current.currentTime;
43
45
  const timeShift = Math.abs(shouldBeTime - isTime);
44
- if (timeShift > 0.45 && !mediaRef.current.ended) {
45
- console.log('Time has shifted by', timeShift, 'sec. Fixing...', `(isTime=${isTime},shouldBeTime=${shouldBeTime})`);
46
+ if (timeShift > acceptableTimeshift && !mediaRef.current.ended) {
46
47
  // If scrubbing around, adjust timing
47
48
  // or if time shift is bigger than 0.2sec
48
49
  mediaRef.current.currentTime = shouldBeTime;
49
- (0, warn_about_non_seekable_media_1.warnAboutNonSeekableMedia)(mediaRef.current);
50
+ if (!onlyWarnForMediaSeekingError) {
51
+ (0, warn_about_non_seekable_media_1.warnAboutNonSeekableMedia)(mediaRef.current, onlyWarnForMediaSeekingError ? 'console-warning' : 'console-error');
52
+ }
50
53
  }
51
54
  if (!playing || absoluteFrame === 0) {
52
55
  mediaRef.current.currentTime = shouldBeTime;
@@ -67,6 +70,8 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
67
70
  src,
68
71
  mediaStartsAt,
69
72
  localPlaybackRate,
73
+ onlyWarnForMediaSeekingError,
74
+ acceptableTimeshift,
70
75
  ]);
71
76
  };
72
77
  exports.useMediaPlayback = useMediaPlayback;
@@ -1,2 +1,2 @@
1
- import { RefObject } from 'react';
1
+ import type { RefObject } from 'react';
2
2
  export declare const useMediaTagVolume: (mediaRef: RefObject<HTMLVideoElement | HTMLAudioElement>) => number;
File without changes
@@ -1,5 +1,5 @@
1
- import { RefObject } from 'react';
2
- import { VolumeProp } from './volume-prop';
1
+ import type { RefObject } from 'react';
2
+ import type { VolumeProp } from './volume-prop';
3
3
  export declare type UseSyncVolumeWithMediaTagOptions = {
4
4
  volumePropFrame: number;
5
5
  actualVolume: number;
@@ -10,6 +10,7 @@ const useSyncVolumeWithMediaTag = ({ volumePropFrame, actualVolume, volume, medi
10
10
  frame: volumePropFrame,
11
11
  volume,
12
12
  mediaVolume,
13
+ allowAmplificationDuringRender: false,
13
14
  });
14
15
  if (!(0, is_approximately_the_same_1.isApproximatelyTheSame)(userPreferredVolume, actualVolume) &&
15
16
  mediaRef.current) {
@@ -1,2 +1,2 @@
1
- import { VideoConfig } from './video-config';
1
+ import type { VideoConfig } from './video-config';
2
2
  export declare const useUnsafeVideoConfig: () => VideoConfig | null;
File without changes
@@ -1,4 +1,4 @@
1
- import { VideoConfig } from './video-config';
1
+ import type { VideoConfig } from './video-config';
2
2
  /**
3
3
  * Get some info about the context of the video that you are making.
4
4
  * Returns an object containing `fps`, `width`, `height` and `durationInFrames`, all of type `number`.
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useVideoConfig = void 0;
4
+ const react_1 = require("react");
5
+ const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
6
+ const is_player_1 = require("./is-player");
4
7
  const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
5
8
  /**
6
9
  * Get some info about the context of the video that you are making.
@@ -9,12 +12,18 @@ const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
9
12
  */
10
13
  const useVideoConfig = () => {
11
14
  const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
15
+ const context = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
16
+ const isPlayer = (0, is_player_1.useIsPlayer)();
12
17
  if (!videoConfig) {
13
- if (typeof window !== 'undefined' && window.remotion_isPlayer) {
18
+ if ((typeof window !== 'undefined' && window.remotion_isPlayer) ||
19
+ isPlayer) {
14
20
  throw new Error('No video config found. You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.');
15
21
  }
16
22
  throw new Error('No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.');
17
23
  }
24
+ if (!context) {
25
+ throw new Error('Called useVideoConfig() outside a Remotion composition.');
26
+ }
18
27
  return videoConfig;
19
28
  };
20
29
  exports.useVideoConfig = useVideoConfig;
@@ -1 +1,13 @@
1
- export declare const useVideo: () => import("./CompositionManager").TComposition<unknown> | null;
1
+ /// <reference types="react" />
2
+ export declare const useVideo: () => {
3
+ height: number;
4
+ width: number;
5
+ fps: number;
6
+ durationInFrames: number;
7
+ defaultProps: unknown;
8
+ id: string;
9
+ folderName: string | null;
10
+ parentFolderName: string | null;
11
+ component: import("react").LazyExoticComponent<import("react").ComponentType<unknown>>;
12
+ nonce: number;
13
+ } | null;
package/dist/use-video.js CHANGED
@@ -7,9 +7,22 @@ const useVideo = () => {
7
7
  const context = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
8
8
  return (0, react_1.useMemo)(() => {
9
9
  var _a;
10
- return (_a = context.compositions.find((c) => {
10
+ const selected = context.compositions.find((c) => {
11
11
  return c.id === context.currentComposition;
12
- })) !== null && _a !== void 0 ? _a : null;
13
- }, [context.compositions, context.currentComposition]);
12
+ });
13
+ if (selected) {
14
+ return {
15
+ ...selected,
16
+ // We override the selected metadata with the metadata that was passed to renderMedia(),
17
+ // and don't allow it to be changed during render anymore
18
+ ...((_a = context.currentCompositionMetadata) !== null && _a !== void 0 ? _a : {}),
19
+ };
20
+ }
21
+ return null;
22
+ }, [
23
+ context.compositions,
24
+ context.currentComposition,
25
+ context.currentCompositionMetadata,
26
+ ]);
14
27
  };
15
28
  exports.useVideo = useVideo;
@@ -1,4 +1,4 @@
1
- import { RemotionAudioProps } from './audio';
2
- import { RemotionVideoProps } from './video';
3
- import { OffthreadVideoProps } from './video/props';
1
+ import type { RemotionAudioProps } from './audio';
2
+ import type { RemotionVideoProps } from './video';
3
+ import type { OffthreadVideoProps } from './video/props';
4
4
  export declare const validateMediaProps: (props: RemotionVideoProps | RemotionAudioProps | OffthreadVideoProps, component: 'Video' | 'Audio') => void;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1 +1 @@
1
- export declare const validateFps: (fps: number, location: string) => void;
1
+ export declare const validateFps: (fps: number, location: string, isGif: boolean) => void;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateFps = void 0;
4
- const validateFps = (fps, location) => {
4
+ const validateFps = (fps, location, isGif) => {
5
5
  if (typeof fps !== 'number') {
6
6
  throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
7
7
  }
@@ -14,5 +14,8 @@ const validateFps = (fps, location) => {
14
14
  if (fps <= 0) {
15
15
  throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
16
16
  }
17
+ if (isGif && fps > 50) {
18
+ 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`);
19
+ }
17
20
  };
18
21
  exports.validateFps = validateFps;
@@ -0,0 +1 @@
1
+ export declare const validateOffthreadVideoImageFormat: (input: unknown) => void;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateOffthreadVideoImageFormat = void 0;
4
+ const validateOffthreadVideoImageFormat = (input) => {
5
+ if (typeof input === 'undefined') {
6
+ return;
7
+ }
8
+ if (typeof input !== 'string') {
9
+ throw new TypeError(`<OffthreadVideo imageFormat=""> must be a string, but got ${JSON.stringify(input)} instead.`);
10
+ }
11
+ if (input !== 'png' && input !== 'jpeg') {
12
+ throw new TypeError(`<OffthreadVideo imageFormat=""> must be either "png" or "jpeg", but got ${input}`);
13
+ }
14
+ };
15
+ exports.validateOffthreadVideoImageFormat = validateOffthreadVideoImageFormat;
@@ -0,0 +1 @@
1
+ export declare const validateSpringDuration: (dur: unknown) => void;