remotion 4.0.0-fastlambda.8 → 4.0.0-forcepublish.7

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 (399) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/README.md +1 -1
  3. package/dist/AbsoluteFill.d.ts +6 -1
  4. package/dist/AbsoluteFill.js +5 -1
  5. package/dist/CanUseRemotionHooks.d.ts +5 -0
  6. package/dist/CanUseRemotionHooks.js +10 -0
  7. package/dist/Composition.d.ts +3 -6
  8. package/dist/Composition.js +40 -28
  9. package/dist/CompositionManager.d.ts +4 -12
  10. package/dist/CompositionManager.js +6 -2
  11. package/dist/Folder.d.ts +15 -0
  12. package/dist/Folder.js +33 -0
  13. package/dist/IFrame.js +1 -1
  14. package/dist/Img.js +29 -21
  15. package/dist/RemotionRoot.js +1 -1
  16. package/dist/{sequencing/index.d.ts → Sequence.d.ts} +8 -2
  17. package/dist/{sequencing/index.js → Sequence.js} +22 -18
  18. package/dist/Still.d.ts +1 -2
  19. package/dist/Still.js +1 -1
  20. package/dist/asset-types.d.ts +1 -4
  21. package/dist/audio/Audio.d.ts +2 -2
  22. package/dist/audio/Audio.js +5 -5
  23. package/dist/audio/AudioForDevelopment.d.ts +1 -1
  24. package/dist/audio/AudioForDevelopment.js +12 -2
  25. package/dist/audio/AudioForRendering.d.ts +2 -2
  26. package/dist/audio/AudioForRendering.js +9 -6
  27. package/dist/audio/index.js +5 -1
  28. package/dist/audio/props.d.ts +1 -1
  29. package/dist/audio/shared-audio-tags.d.ts +4 -3
  30. package/dist/audio/shared-audio-tags.js +115 -42
  31. package/dist/audio/use-audio-frame.js +4 -4
  32. package/dist/config/bundle-out-dir.d.ts +2 -0
  33. package/dist/config/bundle-out-dir.js +12 -0
  34. package/dist/config/input-props.js +12 -14
  35. package/dist/config/public-path.d.ts +2 -0
  36. package/dist/config/public-path.js +12 -0
  37. package/dist/{config/index.d.ts → config.d.ts} +58 -22
  38. package/dist/config.js +21 -0
  39. package/dist/default-css.d.ts +1 -0
  40. package/dist/default-css.js +9 -2
  41. package/dist/delay-render.d.ts +1 -1
  42. package/dist/delay-render.js +4 -4
  43. package/dist/freeze.d.ts +2 -2
  44. package/dist/freeze.js +2 -2
  45. package/dist/get-timeline-clip-name.js +2 -1
  46. package/dist/index.d.ts +14 -7
  47. package/dist/index.js +15 -8
  48. package/dist/internals.d.ts +24 -101
  49. package/dist/internals.js +20 -94
  50. package/dist/{interpolateColors.d.ts → interpolate-colors.d.ts} +0 -0
  51. package/dist/{interpolateColors.js → interpolate-colors.js} +0 -0
  52. package/dist/loading-indicator.d.ts +2 -0
  53. package/dist/loading-indicator.js +35 -0
  54. package/dist/loop/index.js +1 -1
  55. package/dist/multiple-versions-warning.js +3 -3
  56. package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
  57. package/dist/portal-node.d.ts +1 -0
  58. package/dist/portal-node.js +23 -0
  59. package/dist/register-root.d.ts +2 -1
  60. package/dist/register-root.js +20 -5
  61. package/dist/series/index.d.ts +2 -2
  62. package/dist/series/index.js +4 -4
  63. package/dist/spring/index.d.ts +8 -4
  64. package/dist/spring/index.js +21 -6
  65. package/dist/spring/measure-spring.d.ts +1 -1
  66. package/dist/spring/measure-spring.js +1 -1
  67. package/dist/static-file.js +6 -0
  68. package/dist/timeline-position-state.d.ts +1 -1
  69. package/dist/{use-frame.d.ts → use-current-frame.d.ts} +0 -0
  70. package/dist/{use-frame.js → use-current-frame.js} +10 -2
  71. package/dist/use-lazy-component.d.ts +3 -3
  72. package/dist/use-lazy-component.js +5 -1
  73. package/dist/use-media-in-timeline.d.ts +2 -2
  74. package/dist/use-media-in-timeline.js +2 -2
  75. package/dist/use-media-playback.d.ts +3 -2
  76. package/dist/use-media-playback.js +9 -6
  77. package/dist/use-media-tag-volume.d.ts +1 -1
  78. package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
  79. package/dist/use-unsafe-video-config.d.ts +1 -1
  80. package/dist/use-unsafe-video-config.js +2 -2
  81. package/dist/use-video-config.d.ts +1 -1
  82. package/dist/use-video-config.js +6 -0
  83. package/dist/validate-media-props.d.ts +4 -3
  84. package/dist/validation/validate-fps.d.ts +1 -1
  85. package/dist/validation/validate-fps.js +4 -1
  86. package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
  87. package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
  88. package/dist/validation/validation-spring-duration.d.ts +1 -0
  89. package/dist/validation/validation-spring-duration.js +21 -0
  90. package/dist/video/OffthreadVideo.d.ts +3 -0
  91. package/dist/video/OffthreadVideo.js +27 -0
  92. package/dist/video/OffthreadVideoForRendering.d.ts +3 -0
  93. package/dist/video/OffthreadVideoForRendering.js +98 -0
  94. package/dist/video/Video.d.ts +2 -2
  95. package/dist/video/Video.js +4 -4
  96. package/dist/video/VideoForDevelopment.d.ts +6 -2
  97. package/dist/video/VideoForDevelopment.js +23 -2
  98. package/dist/video/VideoForRendering.d.ts +2 -2
  99. package/dist/video/VideoForRendering.js +47 -24
  100. package/dist/video/get-current-time.d.ts +7 -1
  101. package/dist/video/get-current-time.js +17 -9
  102. package/dist/video/index.d.ts +3 -2
  103. package/dist/video/index.js +5 -12
  104. package/dist/video/props.d.ts +13 -2
  105. package/dist/volume-prop.js +1 -1
  106. package/dist/warn-about-non-seekable-media.d.ts +1 -1
  107. package/dist/warn-about-non-seekable-media.js +14 -2
  108. package/dist/wrap-remotion-context.d.ts +2 -1
  109. package/dist/wrap-remotion-context.js +12 -4
  110. package/package.json +8 -9
  111. package/.turbo/turbo-lint.log +0 -11
  112. package/.turbo/turbo-test.log +0 -78
  113. package/dist/AbsoluteFill.d.ts.map +0 -1
  114. package/dist/AbsoluteFill.js.map +0 -1
  115. package/dist/Composition.d.ts.map +0 -1
  116. package/dist/Composition.js.map +0 -1
  117. package/dist/CompositionManager.d.ts.map +0 -1
  118. package/dist/CompositionManager.js.map +0 -1
  119. package/dist/IFrame.d.ts.map +0 -1
  120. package/dist/IFrame.js.map +0 -1
  121. package/dist/Img.d.ts.map +0 -1
  122. package/dist/Img.js.map +0 -1
  123. package/dist/RemotionRoot.d.ts.map +0 -1
  124. package/dist/RemotionRoot.js.map +0 -1
  125. package/dist/Still.d.ts.map +0 -1
  126. package/dist/Still.js.map +0 -1
  127. package/dist/absolute-src.d.ts.map +0 -1
  128. package/dist/absolute-src.js.map +0 -1
  129. package/dist/asset-types.d.ts.map +0 -1
  130. package/dist/asset-types.js.map +0 -1
  131. package/dist/audio/Audio.d.ts.map +0 -1
  132. package/dist/audio/Audio.js.map +0 -1
  133. package/dist/audio/AudioForDevelopment.d.ts.map +0 -1
  134. package/dist/audio/AudioForDevelopment.js.map +0 -1
  135. package/dist/audio/AudioForRendering.d.ts.map +0 -1
  136. package/dist/audio/AudioForRendering.js.map +0 -1
  137. package/dist/audio/index.d.ts.map +0 -1
  138. package/dist/audio/index.js.map +0 -1
  139. package/dist/audio/props.d.ts.map +0 -1
  140. package/dist/audio/props.js.map +0 -1
  141. package/dist/audio/shared-audio-tags.d.ts.map +0 -1
  142. package/dist/audio/shared-audio-tags.js.map +0 -1
  143. package/dist/audio/use-audio-frame.d.ts.map +0 -1
  144. package/dist/audio/use-audio-frame.js.map +0 -1
  145. package/dist/bezier.d.ts.map +0 -1
  146. package/dist/bezier.js.map +0 -1
  147. package/dist/compress-assets.d.ts +0 -7
  148. package/dist/compress-assets.d.ts.map +0 -1
  149. package/dist/compress-assets.js +0 -25
  150. package/dist/compress-assets.js.map +0 -1
  151. package/dist/config/browser-executable.d.ts +0 -3
  152. package/dist/config/browser-executable.d.ts.map +0 -1
  153. package/dist/config/browser-executable.js +0 -12
  154. package/dist/config/browser-executable.js.map +0 -1
  155. package/dist/config/browser.d.ts +0 -4
  156. package/dist/config/browser.d.ts.map +0 -1
  157. package/dist/config/browser.js +0 -19
  158. package/dist/config/browser.js.map +0 -1
  159. package/dist/config/chromium-flags.d.ts +0 -10
  160. package/dist/config/chromium-flags.d.ts.map +0 -1
  161. package/dist/config/chromium-flags.js +0 -34
  162. package/dist/config/chromium-flags.js.map +0 -1
  163. package/dist/config/codec.d.ts +0 -17
  164. package/dist/config/codec.d.ts.map +0 -1
  165. package/dist/config/codec.js +0 -103
  166. package/dist/config/codec.js.map +0 -1
  167. package/dist/config/concurrency.d.ts +0 -3
  168. package/dist/config/concurrency.d.ts.map +0 -1
  169. package/dist/config/concurrency.js +0 -15
  170. package/dist/config/concurrency.js.map +0 -1
  171. package/dist/config/crf.d.ts +0 -9
  172. package/dist/config/crf.d.ts.map +0 -1
  173. package/dist/config/crf.js +0 -83
  174. package/dist/config/crf.js.map +0 -1
  175. package/dist/config/env-file.d.ts +0 -2
  176. package/dist/config/env-file.d.ts.map +0 -1
  177. package/dist/config/env-file.js +0 -10
  178. package/dist/config/env-file.js.map +0 -1
  179. package/dist/config/ffmpeg-executable.d.ts +0 -3
  180. package/dist/config/ffmpeg-executable.d.ts.map +0 -1
  181. package/dist/config/ffmpeg-executable.js +0 -12
  182. package/dist/config/ffmpeg-executable.js.map +0 -1
  183. package/dist/config/frame-range.d.ts +0 -5
  184. package/dist/config/frame-range.d.ts.map +0 -1
  185. package/dist/config/frame-range.js +0 -80
  186. package/dist/config/frame-range.js.map +0 -1
  187. package/dist/config/image-format.d.ts +0 -8
  188. package/dist/config/image-format.d.ts.map +0 -1
  189. package/dist/config/image-format.js +0 -37
  190. package/dist/config/image-format.js.map +0 -1
  191. package/dist/config/image-sequence.d.ts +0 -3
  192. package/dist/config/image-sequence.d.ts.map +0 -1
  193. package/dist/config/image-sequence.js +0 -15
  194. package/dist/config/image-sequence.js.map +0 -1
  195. package/dist/config/index.d.ts.map +0 -1
  196. package/dist/config/index.js +0 -175
  197. package/dist/config/index.js.map +0 -1
  198. package/dist/config/input-props.d.ts.map +0 -1
  199. package/dist/config/input-props.js.map +0 -1
  200. package/dist/config/log.d.ts +0 -7
  201. package/dist/config/log.d.ts.map +0 -1
  202. package/dist/config/log.js +0 -25
  203. package/dist/config/log.js.map +0 -1
  204. package/dist/config/max-timeline-tracks.d.ts +0 -2
  205. package/dist/config/max-timeline-tracks.d.ts.map +0 -1
  206. package/dist/config/max-timeline-tracks.js +0 -24
  207. package/dist/config/max-timeline-tracks.js.map +0 -1
  208. package/dist/config/override-webpack.d.ts +0 -12
  209. package/dist/config/override-webpack.d.ts.map +0 -1
  210. package/dist/config/override-webpack.js +0 -14
  211. package/dist/config/override-webpack.js.map +0 -1
  212. package/dist/config/overwrite.d.ts +0 -3
  213. package/dist/config/overwrite.d.ts.map +0 -1
  214. package/dist/config/overwrite.js +0 -14
  215. package/dist/config/overwrite.js.map +0 -1
  216. package/dist/config/pixel-format.d.ts +0 -8
  217. package/dist/config/pixel-format.d.ts.map +0 -1
  218. package/dist/config/pixel-format.js +0 -38
  219. package/dist/config/pixel-format.js.map +0 -1
  220. package/dist/config/preview-server.d.ts +0 -2
  221. package/dist/config/preview-server.d.ts.map +0 -1
  222. package/dist/config/preview-server.js +0 -20
  223. package/dist/config/preview-server.js.map +0 -1
  224. package/dist/config/prores-profile.d.ts +0 -7
  225. package/dist/config/prores-profile.d.ts.map +0 -1
  226. package/dist/config/prores-profile.js +0 -32
  227. package/dist/config/prores-profile.js.map +0 -1
  228. package/dist/config/quality.d.ts +0 -2
  229. package/dist/config/quality.d.ts.map +0 -1
  230. package/dist/config/quality.js +0 -17
  231. package/dist/config/quality.js.map +0 -1
  232. package/dist/config/scale.d.ts +0 -3
  233. package/dist/config/scale.d.ts.map +0 -1
  234. package/dist/config/scale.js +0 -15
  235. package/dist/config/scale.js.map +0 -1
  236. package/dist/config/still-frame.d.ts +0 -2
  237. package/dist/config/still-frame.d.ts.map +0 -1
  238. package/dist/config/still-frame.js +0 -12
  239. package/dist/config/still-frame.js.map +0 -1
  240. package/dist/config/timeout.d.ts +0 -2
  241. package/dist/config/timeout.d.ts.map +0 -1
  242. package/dist/config/timeout.js +0 -17
  243. package/dist/config/timeout.js.map +0 -1
  244. package/dist/config/webpack-caching.d.ts +0 -3
  245. package/dist/config/webpack-caching.d.ts.map +0 -1
  246. package/dist/config/webpack-caching.js +0 -16
  247. package/dist/config/webpack-caching.js.map +0 -1
  248. package/dist/default-css.d.ts.map +0 -1
  249. package/dist/default-css.js.map +0 -1
  250. package/dist/delay-render.d.ts.map +0 -1
  251. package/dist/delay-render.js.map +0 -1
  252. package/dist/easing.d.ts.map +0 -1
  253. package/dist/easing.js.map +0 -1
  254. package/dist/feature-flags.d.ts +0 -1
  255. package/dist/feature-flags.d.ts.map +0 -1
  256. package/dist/feature-flags.js +0 -7
  257. package/dist/feature-flags.js.map +0 -1
  258. package/dist/freeze.d.ts.map +0 -1
  259. package/dist/freeze.js.map +0 -1
  260. package/dist/get-asset-file-name.d.ts.map +0 -1
  261. package/dist/get-asset-file-name.js.map +0 -1
  262. package/dist/get-environment.d.ts.map +0 -1
  263. package/dist/get-environment.js.map +0 -1
  264. package/dist/get-preview-dom-element.d.ts.map +0 -1
  265. package/dist/get-preview-dom-element.js.map +0 -1
  266. package/dist/get-timeline-clip-name.d.ts.map +0 -1
  267. package/dist/get-timeline-clip-name.js.map +0 -1
  268. package/dist/index.d.ts.map +0 -1
  269. package/dist/index.js.map +0 -1
  270. package/dist/initial-frame.d.ts +0 -2
  271. package/dist/initial-frame.d.ts.map +0 -1
  272. package/dist/initial-frame.js +0 -12
  273. package/dist/initial-frame.js.map +0 -1
  274. package/dist/internals.d.ts.map +0 -1
  275. package/dist/internals.js.map +0 -1
  276. package/dist/interpolate.d.ts.map +0 -1
  277. package/dist/interpolate.js.map +0 -1
  278. package/dist/interpolateColors.d.ts.map +0 -1
  279. package/dist/interpolateColors.js.map +0 -1
  280. package/dist/is-approximately-the-same.d.ts.map +0 -1
  281. package/dist/is-approximately-the-same.js.map +0 -1
  282. package/dist/is-audio-codec.d.ts +0 -2
  283. package/dist/is-audio-codec.d.ts.map +0 -1
  284. package/dist/is-audio-codec.js +0 -7
  285. package/dist/is-audio-codec.js.map +0 -1
  286. package/dist/loop/index.d.ts.map +0 -1
  287. package/dist/loop/index.js.map +0 -1
  288. package/dist/multiple-versions-warning.d.ts.map +0 -1
  289. package/dist/multiple-versions-warning.js.map +0 -1
  290. package/dist/nonce.d.ts.map +0 -1
  291. package/dist/nonce.js.map +0 -1
  292. package/dist/perf/index.d.ts +0 -5
  293. package/dist/perf/index.d.ts.map +0 -1
  294. package/dist/perf/index.js +0 -33
  295. package/dist/perf/index.js.map +0 -1
  296. package/dist/play-and-handle-not-allowed-error.d.ts.map +0 -1
  297. package/dist/play-and-handle-not-allowed-error.js.map +0 -1
  298. package/dist/random.d.ts.map +0 -1
  299. package/dist/random.js.map +0 -1
  300. package/dist/register-root.d.ts.map +0 -1
  301. package/dist/register-root.js.map +0 -1
  302. package/dist/sequencing/index.d.ts.map +0 -1
  303. package/dist/sequencing/index.js.map +0 -1
  304. package/dist/series/flatten-children.d.ts.map +0 -1
  305. package/dist/series/flatten-children.js.map +0 -1
  306. package/dist/series/index.d.ts.map +0 -1
  307. package/dist/series/index.js.map +0 -1
  308. package/dist/setup-env-variables.d.ts.map +0 -1
  309. package/dist/setup-env-variables.js.map +0 -1
  310. package/dist/spring/index.d.ts.map +0 -1
  311. package/dist/spring/index.js.map +0 -1
  312. package/dist/spring/measure-spring.d.ts.map +0 -1
  313. package/dist/spring/measure-spring.js.map +0 -1
  314. package/dist/spring/spring-utils.d.ts.map +0 -1
  315. package/dist/spring/spring-utils.js.map +0 -1
  316. package/dist/static-file.d.ts.map +0 -1
  317. package/dist/static-file.js.map +0 -1
  318. package/dist/timeline-inout-position-state.d.ts +0 -12
  319. package/dist/timeline-inout-position-state.d.ts.map +0 -1
  320. package/dist/timeline-inout-position-state.js +0 -23
  321. package/dist/timeline-inout-position-state.js.map +0 -1
  322. package/dist/timeline-position-state.d.ts.map +0 -1
  323. package/dist/timeline-position-state.js.map +0 -1
  324. package/dist/timeout.d.ts +0 -2
  325. package/dist/timeout.d.ts.map +0 -1
  326. package/dist/timeout.js +0 -12
  327. package/dist/timeout.js.map +0 -1
  328. package/dist/truthy.d.ts.map +0 -1
  329. package/dist/truthy.js.map +0 -1
  330. package/dist/use-frame.d.ts.map +0 -1
  331. package/dist/use-frame.js.map +0 -1
  332. package/dist/use-lazy-component.d.ts.map +0 -1
  333. package/dist/use-lazy-component.js.map +0 -1
  334. package/dist/use-media-in-timeline.d.ts.map +0 -1
  335. package/dist/use-media-in-timeline.js.map +0 -1
  336. package/dist/use-media-playback.d.ts.map +0 -1
  337. package/dist/use-media-playback.js.map +0 -1
  338. package/dist/use-media-tag-volume.d.ts.map +0 -1
  339. package/dist/use-media-tag-volume.js.map +0 -1
  340. package/dist/use-sync-volume-with-media-tag.d.ts.map +0 -1
  341. package/dist/use-sync-volume-with-media-tag.js.map +0 -1
  342. package/dist/use-unsafe-video-config.d.ts.map +0 -1
  343. package/dist/use-unsafe-video-config.js.map +0 -1
  344. package/dist/use-video-config.d.ts.map +0 -1
  345. package/dist/use-video-config.js.map +0 -1
  346. package/dist/use-video.d.ts.map +0 -1
  347. package/dist/use-video.js.map +0 -1
  348. package/dist/validate-media-props.d.ts.map +0 -1
  349. package/dist/validate-media-props.js.map +0 -1
  350. package/dist/validate-start-from-props.d.ts.map +0 -1
  351. package/dist/validate-start-from-props.js.map +0 -1
  352. package/dist/validation/validate-composition-id.d.ts.map +0 -1
  353. package/dist/validation/validate-composition-id.js.map +0 -1
  354. package/dist/validation/validate-dimensions.d.ts.map +0 -1
  355. package/dist/validation/validate-dimensions.js.map +0 -1
  356. package/dist/validation/validate-duration-in-frames.d.ts.map +0 -1
  357. package/dist/validation/validate-duration-in-frames.js.map +0 -1
  358. package/dist/validation/validate-folder-name.d.ts.map +0 -1
  359. package/dist/validation/validate-folder-name.js.map +0 -1
  360. package/dist/validation/validate-fps.d.ts.map +0 -1
  361. package/dist/validation/validate-fps.js.map +0 -1
  362. package/dist/validation/validate-frame.d.ts +0 -1
  363. package/dist/validation/validate-frame.d.ts.map +0 -1
  364. package/dist/validation/validate-frame.js +0 -24
  365. package/dist/validation/validate-frame.js.map +0 -1
  366. package/dist/validation/validate-image-format.d.ts +0 -2
  367. package/dist/validation/validate-image-format.d.ts.map +0 -1
  368. package/dist/validation/validate-image-format.js +0 -9
  369. package/dist/validation/validate-image-format.js.map +0 -1
  370. package/dist/validation/validate-opengl-renderer.d.ts +0 -4
  371. package/dist/validation/validate-opengl-renderer.d.ts.map +0 -1
  372. package/dist/validation/validate-opengl-renderer.js +0 -14
  373. package/dist/validation/validate-opengl-renderer.js.map +0 -1
  374. package/dist/validation/validate-quality.d.ts +0 -1
  375. package/dist/validation/validate-quality.d.ts.map +0 -1
  376. package/dist/validation/validate-quality.js +0 -21
  377. package/dist/validation/validate-quality.js.map +0 -1
  378. package/dist/video/Video.d.ts.map +0 -1
  379. package/dist/video/Video.js.map +0 -1
  380. package/dist/video/VideoForDevelopment.d.ts.map +0 -1
  381. package/dist/video/VideoForDevelopment.js.map +0 -1
  382. package/dist/video/VideoForRendering.d.ts.map +0 -1
  383. package/dist/video/VideoForRendering.js.map +0 -1
  384. package/dist/video/get-current-time.d.ts.map +0 -1
  385. package/dist/video/get-current-time.js.map +0 -1
  386. package/dist/video/index.d.ts.map +0 -1
  387. package/dist/video/index.js.map +0 -1
  388. package/dist/video/props.d.ts.map +0 -1
  389. package/dist/video/props.js.map +0 -1
  390. package/dist/video-config.d.ts.map +0 -1
  391. package/dist/video-config.js.map +0 -1
  392. package/dist/volume-position-state.d.ts.map +0 -1
  393. package/dist/volume-position-state.js.map +0 -1
  394. package/dist/volume-prop.d.ts.map +0 -1
  395. package/dist/volume-prop.js.map +0 -1
  396. package/dist/warn-about-non-seekable-media.d.ts.map +0 -1
  397. package/dist/warn-about-non-seekable-media.js.map +0 -1
  398. package/dist/wrap-remotion-context.d.ts.map +0 -1
  399. package/dist/wrap-remotion-context.js.map +0 -1
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AudioForDevelopment = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const random_1 = require("../random");
7
+ const Sequence_1 = require("../Sequence");
6
8
  const use_media_in_timeline_1 = require("../use-media-in-timeline");
7
9
  const use_media_playback_1 = require("../use-media-playback");
8
10
  const use_media_tag_volume_1 = require("../use-media-tag-volume");
@@ -25,7 +27,14 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
25
27
  ...nativeProps,
26
28
  };
27
29
  }, [mediaMuted, muted, nativeProps]);
28
- const audioRef = (0, shared_audio_tags_1.useSharedAudio)(propsToPass).el;
30
+ const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
31
+ // Generate a string that's as unique as possible for this asset
32
+ // but at the same time deterministic. We use it to combat strict mode issues.
33
+ const id = (0, react_1.useMemo)(() => {
34
+ var _a;
35
+ return `audio-${(0, random_1.random)((_a = props.src) !== null && _a !== void 0 ? _a : '')}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames}-muted:${props.muted}`;
36
+ }, [props.muted, props.src, sequenceContext]);
37
+ const audioRef = (0, shared_audio_tags_1.useSharedAudio)(propsToPass, id).el;
29
38
  const actualVolume = (0, use_media_tag_volume_1.useMediaTagVolume)(audioRef);
30
39
  (0, use_sync_volume_with_media_tag_1.useSyncVolumeWithMediaTag)({
31
40
  volumePropFrame,
@@ -46,6 +55,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
46
55
  src: nativeProps.src,
47
56
  mediaType: 'audio',
48
57
  playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
58
+ onlyWarnForMediaSeekingError: false,
49
59
  });
50
60
  (0, react_1.useImperativeHandle)(ref, () => {
51
61
  return audioRef.current;
@@ -53,6 +63,6 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
53
63
  if (initialShouldPreMountAudioElements) {
54
64
  return null;
55
65
  }
56
- return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...propsToPass }, void 0);
66
+ return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...propsToPass });
57
67
  };
58
68
  exports.AudioForDevelopment = (0, react_1.forwardRef)(AudioForDevelopmentForwardRefFunction);
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
- import { RemotionAudioProps } from './props';
3
- export declare const AudioForRendering: React.ForwardRefExoticComponent<Pick<RemotionAudioProps, "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key"> & React.RefAttributes<HTMLAudioElement>>;
2
+ import type { RemotionAudioProps } from './props';
3
+ export declare const AudioForRendering: React.ForwardRefExoticComponent<Pick<RemotionAudioProps, "children" | "style" | "id" | "hidden" | "color" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key"> & React.RefAttributes<HTMLAudioElement>>;
@@ -6,16 +6,16 @@ const react_1 = require("react");
6
6
  const absolute_src_1 = require("../absolute-src");
7
7
  const CompositionManager_1 = require("../CompositionManager");
8
8
  const random_1 = require("../random");
9
- const sequencing_1 = require("../sequencing");
10
- const use_frame_1 = require("../use-frame");
9
+ const Sequence_1 = require("../Sequence");
10
+ const use_current_frame_1 = require("../use-current-frame");
11
11
  const volume_prop_1 = require("../volume-prop");
12
12
  const use_audio_frame_1 = require("./use-audio-frame");
13
13
  const AudioForRenderingRefForwardingFunction = (props, ref) => {
14
14
  const audioRef = (0, react_1.useRef)(null);
15
- const absoluteFrame = (0, use_frame_1.useAbsoluteCurrentFrame)();
15
+ const absoluteFrame = (0, use_current_frame_1.useAbsoluteCurrentFrame)();
16
16
  const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
17
- const frame = (0, use_frame_1.useCurrentFrame)();
18
- const sequenceContext = (0, react_1.useContext)(sequencing_1.SequenceContext);
17
+ const frame = (0, use_current_frame_1.useCurrentFrame)();
18
+ const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
19
19
  const { registerAsset, unregisterAsset } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
20
20
  // Generate a string that's as unique as possible for this asset
21
21
  // but at the same time the same on all threads
@@ -37,6 +37,9 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
37
37
  if (!props.src) {
38
38
  throw new Error('No src passed');
39
39
  }
40
+ if (!window.remotion_audioEnabled) {
41
+ return;
42
+ }
40
43
  if (props.muted) {
41
44
  return;
42
45
  }
@@ -63,6 +66,6 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
63
66
  playbackRate,
64
67
  props.playbackRate,
65
68
  ]);
66
- return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps }, void 0);
69
+ return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps });
67
70
  };
68
71
  exports.AudioForRendering = (0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction);
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { VolumeProp } from '../volume-prop';
2
+ import type { VolumeProp } from '../volume-prop';
3
3
  export declare type RemotionMainAudioProps = {
4
4
  startFrom?: number;
5
5
  endAt?: number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RemotionAudioProps } from './props';
2
+ import type { RemotionAudioProps } from './props';
3
3
  /**
4
4
  * This functionality of Remotion will keep a certain amount
5
5
  * of <audio> tags pre-mounted and by default filled with an empty audio track.
@@ -15,9 +15,10 @@ declare type AudioElem = {
15
15
  id: number;
16
16
  props: RemotionAudioProps;
17
17
  el: React.RefObject<HTMLAudioElement>;
18
+ audioId: string;
18
19
  };
19
20
  declare type SharedContext = {
20
- registerAudio: (aud: RemotionAudioProps) => AudioElem;
21
+ registerAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
21
22
  unregisterAudio: (id: number) => void;
22
23
  updateAudio: (id: number, aud: RemotionAudioProps) => void;
23
24
  playAllAudios: () => void;
@@ -28,5 +29,5 @@ export declare const SharedAudioContextProvider: React.FC<{
28
29
  numberOfAudioTags: number;
29
30
  children: React.ReactNode;
30
31
  }>;
31
- export declare const useSharedAudio: (aud: RemotionAudioProps) => AudioElem;
32
+ export declare const useSharedAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
32
33
  export {};
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -23,9 +27,40 @@ exports.useSharedAudio = exports.SharedAudioContextProvider = exports.SharedAudi
23
27
  const jsx_runtime_1 = require("react/jsx-runtime");
24
28
  const react_1 = __importStar(require("react"));
25
29
  const EMPTY_AUDIO = 'data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';
30
+ const compareProps = (obj1, obj2) => {
31
+ const keysA = Object.keys(obj1).sort();
32
+ const keysB = Object.keys(obj2).sort();
33
+ if (keysA.length !== keysB.length) {
34
+ return false;
35
+ }
36
+ for (let i = 0; i < keysA.length; i++) {
37
+ // Not the same keys
38
+ if (keysA[i] !== keysB[i]) {
39
+ return false;
40
+ }
41
+ // Not the same values
42
+ if (obj1[keysA[i]] !== obj2[keysB[i]]) {
43
+ return false;
44
+ }
45
+ }
46
+ return true;
47
+ };
48
+ const didPropChange = (key, newProp, prevProp) => {
49
+ // /music.mp3 and http://localhost:3000/music.mp3 are the same
50
+ if (key === 'src' &&
51
+ !prevProp.startsWith('data:') &&
52
+ !newProp.startsWith('data:')) {
53
+ return (new URL(prevProp, window.location.origin).toString() !==
54
+ new URL(newProp, window.location.origin).toString());
55
+ }
56
+ if (prevProp === newProp) {
57
+ return false;
58
+ }
59
+ return true;
60
+ };
26
61
  exports.SharedAudioContext = (0, react_1.createContext)(null);
27
62
  const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
28
- const [audios, setAudios] = (0, react_1.useState)([]);
63
+ const audios = (0, react_1.useRef)([]);
29
64
  const [initialNumberOfAudioTags] = (0, react_1.useState)(numberOfAudioTags);
30
65
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
31
66
  throw new Error('The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.');
@@ -36,7 +71,38 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
36
71
  });
37
72
  }, [numberOfAudioTags]);
38
73
  const takenAudios = (0, react_1.useRef)(new Array(numberOfAudioTags).fill(false));
39
- const registerAudio = (0, react_1.useCallback)((aud) => {
74
+ const rerenderAudios = (0, react_1.useCallback)(() => {
75
+ refs.forEach(({ ref, id }) => {
76
+ var _a;
77
+ const data = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === id);
78
+ const { current } = ref;
79
+ if (!current) {
80
+ // Whole player has been unmounted, the refs don't exist anymore.
81
+ // It is not an error anymore though
82
+ return;
83
+ }
84
+ if (data === undefined) {
85
+ current.src = EMPTY_AUDIO;
86
+ return;
87
+ }
88
+ if (!data) {
89
+ throw new TypeError('Expected audio data to be there');
90
+ }
91
+ Object.keys(data.props).forEach((key) => {
92
+ // @ts-expect-error
93
+ if (didPropChange(key, data.props[key], current[key])) {
94
+ // @ts-expect-error
95
+ current[key] = data.props[key];
96
+ }
97
+ });
98
+ });
99
+ }, [refs]);
100
+ const registerAudio = (0, react_1.useCallback)((aud, audioId) => {
101
+ var _a, _b;
102
+ const found = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.find((a) => a.audioId === audioId);
103
+ if (found) {
104
+ return found;
105
+ }
40
106
  const firstFreeAudio = takenAudios.current.findIndex((a) => a === false);
41
107
  if (firstFreeAudio === -1) {
42
108
  throw new Error(`Tried to simultaneously mount ${numberOfAudioTags + 1} <Audio /> tags at the same time. With the current settings, the maximum amount of <Audio /> tags is limited to ${numberOfAudioTags} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#use-the-numberofsharedaudiotags-property for more information on how to increase this limit.`);
@@ -49,17 +115,14 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
49
115
  props: aud,
50
116
  id,
51
117
  el: ref,
118
+ audioId,
52
119
  };
53
- // We need a timeout because this state setting is triggered by another state being set, causing React to throw an error.
54
- // By setting a timeout, we are bypassing the error and allowing the state
55
- // to be updated in the next tick.
56
- // This can lead to a tiny delay of audio playback, improvement ideas are welcome.
57
- setTimeout(() => {
58
- setAudios((prevAudios) => [...prevAudios, newElem]);
59
- }, 4);
120
+ (_b = audios.current) === null || _b === void 0 ? void 0 : _b.push(newElem);
121
+ rerenderAudios();
60
122
  return newElem;
61
- }, [numberOfAudioTags, refs]);
123
+ }, [numberOfAudioTags, refs, rerenderAudios]);
62
124
  const unregisterAudio = (0, react_1.useCallback)((id) => {
125
+ var _a;
63
126
  const cloned = [...takenAudios.current];
64
127
  const index = refs.findIndex((r) => r.id === id);
65
128
  if (index === -1) {
@@ -67,23 +130,30 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
67
130
  }
68
131
  cloned[index] = false;
69
132
  takenAudios.current = cloned;
70
- setAudios((prevAudios) => {
71
- return prevAudios.filter((a) => a.id !== id);
72
- });
73
- }, [refs]);
133
+ audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.filter((a) => a.id !== id);
134
+ rerenderAudios();
135
+ }, [refs, rerenderAudios]);
74
136
  const updateAudio = (0, react_1.useCallback)((id, aud) => {
75
- setAudios((prevAudios) => {
76
- return prevAudios.map((prevA) => {
77
- if (prevA.id === id) {
78
- return {
79
- ...prevA,
80
- props: aud,
81
- };
137
+ var _a;
138
+ let changed = false;
139
+ audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.map((prevA) => {
140
+ if (prevA.id === id) {
141
+ const isTheSame = compareProps(aud, prevA.props);
142
+ if (isTheSame) {
143
+ return prevA;
82
144
  }
83
- return prevA;
84
- });
145
+ changed = true;
146
+ return {
147
+ ...prevA,
148
+ props: aud,
149
+ };
150
+ }
151
+ return prevA;
85
152
  });
86
- }, []);
153
+ if (changed) {
154
+ rerenderAudios();
155
+ }
156
+ }, [rerenderAudios]);
87
157
  const playAllAudios = (0, react_1.useCallback)(() => {
88
158
  refs.forEach((ref) => {
89
159
  var _a;
@@ -106,41 +176,44 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
106
176
  updateAudio,
107
177
  ]);
108
178
  return ((0, jsx_runtime_1.jsxs)(exports.SharedAudioContext.Provider, { value: value, children: [refs.map(({ id, ref }) => {
109
- const data = audios.find((a) => a.id === id);
110
- if (data === undefined) {
111
- return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
112
- }
113
- if (!data) {
114
- throw new TypeError('Expected audio data to be there');
115
- }
116
- return (0, jsx_runtime_1.jsx)("audio", { ref: ref, ...data.props }, id);
117
- }), children] }, void 0));
179
+ return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
180
+ }), children] }));
118
181
  };
119
182
  exports.SharedAudioContextProvider = SharedAudioContextProvider;
120
- const useSharedAudio = (aud) => {
183
+ const useSharedAudio = (aud, audioId) => {
121
184
  const ctx = (0, react_1.useContext)(exports.SharedAudioContext);
185
+ /**
186
+ * We work around this in React 18 so an audio tag will only register itself once
187
+ */
122
188
  const [elem] = (0, react_1.useState)(() => {
123
189
  if (ctx && ctx.numberOfAudioTags > 0) {
124
- return ctx.registerAudio(aud);
190
+ return ctx.registerAudio(aud, audioId);
125
191
  }
126
192
  return {
127
193
  el: react_1.default.createRef(),
128
194
  id: Math.random(),
129
195
  props: aud,
196
+ audioId,
130
197
  };
131
198
  });
132
- (0, react_1.useEffect)(() => {
199
+ /**
200
+ * Effects in React 18 fire twice, and we are looking for a way to only fire it once.
201
+ * - useInsertionEffect only fires once. If it's available we are in React 18.
202
+ * - useLayoutEffect only fires once in React 17.
203
+ */
204
+ const effectToUse = react_1.useInsertionEffect !== null && react_1.useInsertionEffect !== void 0 ? react_1.useInsertionEffect : react_1.useLayoutEffect;
205
+ effectToUse(() => {
206
+ if (ctx && ctx.numberOfAudioTags > 0) {
207
+ ctx.updateAudio(elem.id, aud);
208
+ }
209
+ }, [aud, ctx, elem.id]);
210
+ effectToUse(() => {
133
211
  return () => {
134
212
  if (ctx && ctx.numberOfAudioTags > 0) {
135
213
  ctx.unregisterAudio(elem.id);
136
214
  }
137
215
  };
138
216
  }, [ctx, elem.id]);
139
- (0, react_1.useEffect)(() => {
140
- if (ctx && ctx.numberOfAudioTags > 0) {
141
- ctx.updateAudio(elem.id, aud);
142
- }
143
- }, [aud, ctx, elem.id]);
144
217
  return elem;
145
218
  };
146
219
  exports.useSharedAudio = useSharedAudio;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFrameForVolumeProp = exports.useMediaStartsAt = void 0;
4
4
  const react_1 = require("react");
5
- const sequencing_1 = require("../sequencing");
6
- const use_frame_1 = require("../use-frame");
5
+ const Sequence_1 = require("../Sequence");
6
+ const use_current_frame_1 = require("../use-current-frame");
7
7
  const useMediaStartsAt = () => {
8
8
  var _a;
9
- const parentSequence = (0, react_1.useContext)(sequencing_1.SequenceContext);
9
+ const parentSequence = (0, react_1.useContext)(Sequence_1.SequenceContext);
10
10
  const startsAt = Math.min(0, (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.relativeFrom) !== null && _a !== void 0 ? _a : 0);
11
11
  return startsAt;
12
12
  };
@@ -16,7 +16,7 @@ exports.useMediaStartsAt = useMediaStartsAt;
16
16
  * we calculate the way more intuitive value for currentFrame
17
17
  */
18
18
  const useFrameForVolumeProp = () => {
19
- const frame = (0, use_frame_1.useCurrentFrame)();
19
+ const frame = (0, use_current_frame_1.useCurrentFrame)();
20
20
  const startsAt = (0, exports.useMediaStartsAt)();
21
21
  return frame + startsAt;
22
22
  };
@@ -0,0 +1,2 @@
1
+ export declare const getBundleOutDir: () => string | null;
2
+ export declare const setBundleOutDir: (path: string) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setBundleOutDir = exports.getBundleOutDir = void 0;
4
+ let bundleOutDir = null;
5
+ const getBundleOutDir = () => {
6
+ return bundleOutDir;
7
+ };
8
+ exports.getBundleOutDir = getBundleOutDir;
9
+ const setBundleOutDir = (path) => {
10
+ bundleOutDir = path;
11
+ };
12
+ exports.setBundleOutDir = setBundleOutDir;
@@ -13,21 +13,19 @@ const warnOnceSSRImport = () => {
13
13
  console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
14
14
  };
15
15
  const getInputProps = () => {
16
- if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
17
- if (typeof window === 'undefined') {
18
- warnOnceSSRImport();
19
- return {};
20
- }
21
- const param = window.remotion_inputProps;
22
- if (!param) {
23
- return {};
24
- }
25
- const parsed = JSON.parse(param);
26
- return parsed;
16
+ if (typeof window === 'undefined') {
17
+ warnOnceSSRImport();
18
+ return {};
27
19
  }
28
- if ((0, get_environment_1.getRemotionEnvironment)() === 'preview') {
29
- return process.env.INPUT_PROPS;
20
+ if ((0, get_environment_1.getRemotionEnvironment)() === 'player-development' ||
21
+ (0, get_environment_1.getRemotionEnvironment)() === 'player-production') {
22
+ 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.');
30
23
  }
31
- 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.');
24
+ const param = window.remotion_inputProps;
25
+ if (!param) {
26
+ return {};
27
+ }
28
+ const parsed = JSON.parse(param);
29
+ return parsed;
32
30
  };
33
31
  exports.getInputProps = getInputProps;
@@ -0,0 +1,2 @@
1
+ export declare const getPublicPath: () => string | null;
2
+ export declare const setPublicPath: (path: string) => void;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setPublicPath = exports.getPublicPath = void 0;
4
+ let publicPath = null;
5
+ const getPublicPath = () => {
6
+ return publicPath;
7
+ };
8
+ exports.getPublicPath = getPublicPath;
9
+ const setPublicPath = (path) => {
10
+ publicPath = path;
11
+ };
12
+ exports.setPublicPath = setPublicPath;
@@ -1,14 +1,18 @@
1
- import { Browser } from './browser';
2
- import { BrowserExecutable } from './browser-executable';
3
- import { Codec } from './codec';
4
- import { Concurrency } from './concurrency';
5
- import { FfmpegExecutable } from './ffmpeg-executable';
6
- import { FrameRange } from './frame-range';
7
- import { ImageFormat, StillImageFormat } from './image-format';
8
- import { LogLevel } from './log';
9
- import { WebpackConfiguration, WebpackOverrideFn } from './override-webpack';
10
- import { PixelFormat } from './pixel-format';
11
- export declare const Config: {
1
+ /**
2
+ * The configuration has moved to @remotion/cli.
3
+ * For the moment the type definitions are going to stay here
4
+ */
5
+ declare type Concurrency = number | null;
6
+ import type { Configuration } from 'webpack';
7
+ declare type WebpackConfiguration = Configuration;
8
+ declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
9
+ declare type BrowserExecutable = string | null;
10
+ declare type FrameRange = number | [number, number];
11
+ declare type FfmpegExecutable = string | null;
12
+ declare type Loop = number | null;
13
+ declare type CodecOrUndefined = 'h264' | 'h265' | 'vp8' | 'vp9' | 'mp3' | 'aac' | 'wav' | 'prores' | 'h264-mkv' | 'gif' | undefined;
14
+ declare type Crf = number | undefined;
15
+ export declare type ConfigType = {
12
16
  readonly Preview: {
13
17
  /**
14
18
  * Change the maximum amount of tracks that are shown in the timeline.
@@ -44,7 +48,7 @@ export declare const Config: {
44
48
  *
45
49
  * Set this to 'verbose' to get browser logs and other IO.
46
50
  */
47
- readonly setLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
51
+ readonly setLevel: (newLogLevel: 'verbose' | 'info' | 'warn' | 'error') => void;
48
52
  };
49
53
  readonly Puppeteer: {
50
54
  /**
@@ -73,10 +77,10 @@ export declare const Config: {
73
77
  */
74
78
  readonly setChromiumHeadlessMode: (should: boolean) => void;
75
79
  /**
76
- * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle' and 'swiftshader'.
77
- * Default: 'swiftshader' in Lambda, 'angle' elsewhere.
80
+ * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
81
+ * Default: 'swangle' in Lambda, null elsewhere.
78
82
  */
79
- readonly setChromiumOpenGlRenderer: (renderer: "angle" | "egl" | "swiftshader") => void;
83
+ readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader') => void;
80
84
  };
81
85
  readonly Rendering: {
82
86
  /**
@@ -99,7 +103,7 @@ export declare const Config: {
99
103
  /** Decide in which image format to render. Can be either 'jpeg' or 'png'.
100
104
  * PNG is slower, but supports transparency.
101
105
  */
102
- readonly setImageFormat: (format: "none" | "png" | "jpeg") => void;
106
+ readonly setImageFormat: (format: 'png' | 'jpeg' | 'none') => void;
103
107
  /**
104
108
  * Render only a subset of a video.
105
109
  * Pass in a tuple [20, 30] to only render frames 20-30 into a video.
@@ -112,13 +116,43 @@ export declare const Config: {
112
116
  * Default: null, which will use ffmpeg available in PATH.
113
117
  */
114
118
  readonly setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
119
+ /**
120
+ * Specify local ffprobe executable.
121
+ * Default: null, which will use ffprobe available in PATH.
122
+ */
123
+ readonly setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
115
124
  /**
116
125
  * Scales the output dimensions by a factor.
117
126
  * Default: 1.
118
127
  */
119
128
  readonly setScale: (newScale: number) => void;
129
+ /**
130
+ * Specify which frames should be picked for rendering a GIF
131
+ * Default: 1, which means every frame
132
+ * https://remotion.dev/docs/render-as-gif
133
+ */
134
+ readonly setEveryNthFrame: (frame: number) => void;
135
+ /**
136
+ * Specify the number of Loop a GIF should have.
137
+ * Default: null (means GIF will loop infinite)
138
+ */
139
+ readonly setNumberOfGifLoops: (newLoop: Loop) => void;
140
+ /**
141
+ * Disable audio output.
142
+ * Default: false
143
+ */
144
+ readonly setMuted: (muted: boolean) => void;
145
+ /**
146
+ * Don't render an audio track if it would be silent.
147
+ * Default: true
148
+ */
149
+ readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
120
150
  };
121
151
  readonly Output: {
152
+ /**
153
+ * Set the output file location string. Default: `out/{composition}.{codec}`
154
+ */
155
+ readonly setOutputLocation: (newOutputLocation: string) => void;
122
156
  /**
123
157
  * If the video file already exists, should Remotion overwrite
124
158
  * the output? Default: true
@@ -129,23 +163,23 @@ export declare const Config: {
129
163
  * See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
130
164
  * You can override this using the `--pixel-format` Cli flag.
131
165
  */
132
- readonly setPixelFormat: (format: "yuv420p" | "yuva420p" | "yuv422p" | "yuv444p" | "yuv420p10le" | "yuv422p10le" | "yuv444p10le" | "yuva444p10le") => void;
166
+ readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
133
167
  /**
134
168
  * @deprecated Use setCodec() and setImageSequence() instead.
135
169
  * Specify what kind of output you, either `mp4` or `png-sequence`.
136
170
  */
137
- readonly setOutputFormat: (newLegacyFormat: "mp4" | "png-sequence") => void;
171
+ readonly setOutputFormat: (newLegacyFormat: 'mp4' | 'png-sequence') => void;
138
172
  /**
139
173
  * Specify the codec for stitching the frames into a video.
140
174
  * Can be `h264` (default), `h265`, `vp8` or `vp9`
141
175
  */
142
- readonly setCodec: (newCodec: import("./codec").CodecOrUndefined) => void;
176
+ readonly setCodec: (newCodec: CodecOrUndefined) => void;
143
177
  /**
144
178
  * Set the Constant Rate Factor to pass to FFMPEG.
145
179
  * Lower values mean better quality, but be aware that the ranges of
146
180
  * possible values greatly differs between codecs.
147
181
  */
148
- readonly setCrf: (newCrf: number | undefined) => void;
182
+ readonly setCrf: (newCrf: Crf) => void;
149
183
  /**
150
184
  * Set to true if don't want a video but an image sequence as the output.
151
185
  */
@@ -156,7 +190,9 @@ export declare const Config: {
156
190
  * Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
157
191
  * See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
158
192
  */
159
- readonly setProResProfile: (profile: "light" | "4444-xq" | "4444" | "hq" | "standard" | "proxy" | undefined) => void;
193
+ readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
160
194
  };
161
195
  };
162
- export type { PixelFormat, Concurrency, WebpackConfiguration, WebpackOverrideFn, BrowserExecutable, FfmpegExecutable, ImageFormat, Codec, Browser, FrameRange, LogLevel, StillImageFormat, };
196
+ export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
197
+ export declare const Config: ConfigType;
198
+ export declare const enableLegacyRemotionConfig: () => void;