@remotion/promo-pages 4.0.486 → 4.0.487

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/templates.js CHANGED
@@ -5565,7 +5565,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
5565
5565
  var addSequenceStackTraces = (component) => {
5566
5566
  componentsToAddStacksTo.push(component);
5567
5567
  };
5568
- var VERSION = "4.0.486";
5568
+ var VERSION = "4.0.487";
5569
5569
  var checkMultipleRemotionVersions = () => {
5570
5570
  if (typeof globalThis === "undefined") {
5571
5571
  return;
@@ -11435,7 +11435,8 @@ var useBufferManager = (logLevel, mountTime) => {
11435
11435
  if (rendering) {
11436
11436
  return;
11437
11437
  }
11438
- if (blocks.length > 0) {
11438
+ if (blocks.length > 0 && !buffering.current) {
11439
+ buffering.current = true;
11439
11440
  onBufferingCallbacks.forEach((c2) => c2());
11440
11441
  playbackLogging({
11441
11442
  logLevel,
@@ -11450,7 +11451,8 @@ var useBufferManager = (logLevel, mountTime) => {
11450
11451
  if (rendering) {
11451
11452
  return;
11452
11453
  }
11453
- if (blocks.length === 0) {
11454
+ if (blocks.length === 0 && buffering.current) {
11455
+ buffering.current = false;
11454
11456
  onResumeCallbacks.forEach((c2) => c2());
11455
11457
  playbackLogging({
11456
11458
  logLevel,
@@ -11483,15 +11485,11 @@ var useIsPlayerBuffering = (bufferManager) => {
11483
11485
  const onResume = () => {
11484
11486
  setIsBuffering(false);
11485
11487
  };
11486
- bufferManager.listenForBuffering(onBuffer);
11487
- bufferManager.listenForResume(onResume);
11488
+ const buffer = bufferManager.listenForBuffering(onBuffer);
11489
+ const resume = bufferManager.listenForResume(onResume);
11488
11490
  return () => {
11489
- bufferManager.listenForBuffering(() => {
11490
- return;
11491
- });
11492
- bufferManager.listenForResume(() => {
11493
- return;
11494
- });
11491
+ buffer.remove();
11492
+ resume.remove();
11495
11493
  };
11496
11494
  }, [bufferManager]);
11497
11495
  return isBuffering;
@@ -11615,6 +11613,72 @@ var useBufferUntilFirstFrame = ({
11615
11613
  };
11616
11614
  }, [bufferUntilFirstFrame]);
11617
11615
  };
11616
+ var getMediaSyncAction = (input) => {
11617
+ const {
11618
+ duration,
11619
+ currentTime,
11620
+ paused,
11621
+ ended,
11622
+ desiredUnclampedTime,
11623
+ mediaTagTime,
11624
+ mediaTagLastUpdate,
11625
+ rvcTime,
11626
+ rvcLastUpdate,
11627
+ isVariableFpsVideo,
11628
+ acceptableTimeShift,
11629
+ lastSeekDueToShift,
11630
+ playing,
11631
+ playbackRate,
11632
+ mediaTagBufferingOrStalled,
11633
+ playerBuffering,
11634
+ absoluteFrame,
11635
+ onlyWarnForMediaSeekingError,
11636
+ isPremounting,
11637
+ isPostmounting,
11638
+ pauseWhenBuffering
11639
+ } = input;
11640
+ const shouldBeTime = !Number.isNaN(duration) && Number.isFinite(duration) ? Math.min(duration, desiredUnclampedTime) : desiredUnclampedTime;
11641
+ const timeShiftMediaTag = Math.abs(shouldBeTime - mediaTagTime);
11642
+ const timeShiftRvcTag = rvcTime ? Math.abs(shouldBeTime - rvcTime) : null;
11643
+ const mostRecentTimeshift = rvcLastUpdate && rvcTime > mediaTagLastUpdate ? timeShiftRvcTag : timeShiftMediaTag;
11644
+ const timeShift = timeShiftRvcTag && !isVariableFpsVideo ? mostRecentTimeshift : timeShiftMediaTag;
11645
+ if (timeShift > acceptableTimeShift && lastSeekDueToShift !== shouldBeTime) {
11646
+ return {
11647
+ type: "seek-due-to-shift",
11648
+ shouldBeTime,
11649
+ why: `because time shift is too big. shouldBeTime = ${shouldBeTime}, isTime = ${mediaTagTime}, requestVideoCallbackTime = ${rvcTime}, timeShift = ${timeShift}${isVariableFpsVideo ? ", isVariableFpsVideo = true" : ""}, isPremounting = ${isPremounting}, isPostmounting = ${isPostmounting}, pauseWhenBuffering = ${pauseWhenBuffering}`,
11650
+ bufferUntilFirstFrame: playing && playbackRate > 0,
11651
+ playReason: playing && paused ? "player is playing but media tag is paused, and just seeked" : null,
11652
+ warnAboutNonSeekable: !onlyWarnForMediaSeekingError
11653
+ };
11654
+ }
11655
+ const seekThreshold = playing ? 0.15 : 0.01;
11656
+ const makesSenseToSeek = Math.abs(currentTime - shouldBeTime) > seekThreshold;
11657
+ const isSomethingElseBuffering = playerBuffering && !mediaTagBufferingOrStalled;
11658
+ if (!playing || isSomethingElseBuffering) {
11659
+ return {
11660
+ type: "seek-if-not-playing",
11661
+ shouldBeTime,
11662
+ why: makesSenseToSeek ? `not playing or something else is buffering. time offset is over seek threshold (${seekThreshold})` : null
11663
+ };
11664
+ }
11665
+ if (!playing || playerBuffering) {
11666
+ return { type: "none" };
11667
+ }
11668
+ const pausedCondition = paused && !ended;
11669
+ const firstFrameCondition = absoluteFrame === 0;
11670
+ if (pausedCondition || firstFrameCondition) {
11671
+ const reason = pausedCondition ? "media tag is paused" : "absolute frame is 0";
11672
+ return {
11673
+ type: "play-and-seek",
11674
+ shouldBeTime,
11675
+ why: makesSenseToSeek ? `is over timeshift threshold (threshold = ${seekThreshold}) and ${reason}` : null,
11676
+ playReason: `player is playing and ${reason}`,
11677
+ bufferUntilFirstFrame: !isVariableFpsVideo && playbackRate > 0
11678
+ };
11679
+ }
11680
+ return { type: "none" };
11681
+ };
11618
11682
  var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
11619
11683
  const lastUpdate = React21.useRef({
11620
11684
  time: mediaRef.current?.currentTime ?? 0,
@@ -12034,89 +12098,93 @@ var useMediaPlayback = ({
12034
12098
  if (!src) {
12035
12099
  throw new Error(`No 'src' attribute was passed to the ${tagName} element.`);
12036
12100
  }
12037
- const { duration } = mediaRef.current;
12038
- const shouldBeTime = !Number.isNaN(duration) && Number.isFinite(duration) ? Math.min(duration, desiredUnclampedTime) : desiredUnclampedTime;
12039
- const mediaTagTime = mediaTagCurrentTime.current.time;
12040
- const rvcTime = rvcCurrentTime.current?.time ?? null;
12041
- const isVariableFpsVideo = isVariableFpsVideoMap.current[src];
12042
- const timeShiftMediaTag = Math.abs(shouldBeTime - mediaTagTime);
12043
- const timeShiftRvcTag = rvcTime ? Math.abs(shouldBeTime - rvcTime) : null;
12044
- const mostRecentTimeshift = rvcCurrentTime.current?.lastUpdate && rvcCurrentTime.current.time > mediaTagCurrentTime.current.lastUpdate ? timeShiftRvcTag : timeShiftMediaTag;
12045
- const timeShift = timeShiftRvcTag && !isVariableFpsVideo ? mostRecentTimeshift : timeShiftMediaTag;
12046
- if (timeShift > acceptableTimeShiftButLessThanDuration && lastSeekDueToShift.current !== shouldBeTime) {
12101
+ const { current } = mediaRef;
12102
+ const action = getMediaSyncAction({
12103
+ duration: current.duration,
12104
+ currentTime: current.currentTime,
12105
+ paused: current.paused,
12106
+ ended: current.ended,
12107
+ desiredUnclampedTime,
12108
+ mediaTagTime: mediaTagCurrentTime.current.time,
12109
+ mediaTagLastUpdate: mediaTagCurrentTime.current.lastUpdate,
12110
+ rvcTime: rvcCurrentTime.current?.time ?? null,
12111
+ rvcLastUpdate: rvcCurrentTime.current?.lastUpdate ?? null,
12112
+ isVariableFpsVideo: Boolean(isVariableFpsVideoMap.current[src]),
12113
+ acceptableTimeShift: acceptableTimeShiftButLessThanDuration,
12114
+ lastSeekDueToShift: lastSeekDueToShift.current,
12115
+ playing,
12116
+ playbackRate,
12117
+ mediaTagBufferingOrStalled: isMediaTagBuffering || isBuffering(),
12118
+ playerBuffering: buffering.buffering.current,
12119
+ absoluteFrame,
12120
+ onlyWarnForMediaSeekingError,
12121
+ isPremounting,
12122
+ isPostmounting,
12123
+ pauseWhenBuffering
12124
+ });
12125
+ if (action.type === "none") {
12126
+ return;
12127
+ }
12128
+ if (action.type === "seek-due-to-shift") {
12047
12129
  lastSeek.current = seek({
12048
- mediaRef: mediaRef.current,
12049
- time: shouldBeTime,
12130
+ mediaRef: current,
12131
+ time: action.shouldBeTime,
12050
12132
  logLevel,
12051
- why: `because time shift is too big. shouldBeTime = ${shouldBeTime}, isTime = ${mediaTagTime}, requestVideoCallbackTime = ${rvcTime}, timeShift = ${timeShift}${isVariableFpsVideo ? ", isVariableFpsVideo = true" : ""}, isPremounting = ${isPremounting}, isPostmounting = ${isPostmounting}, pauseWhenBuffering = ${pauseWhenBuffering}`,
12133
+ why: action.why,
12052
12134
  mountTime
12053
12135
  });
12054
12136
  lastSeekDueToShift.current = lastSeek.current;
12055
- if (playing) {
12056
- if (playbackRate > 0) {
12057
- bufferUntilFirstFrame(shouldBeTime);
12058
- }
12059
- if (mediaRef.current.paused) {
12060
- playAndHandleNotAllowedError({
12061
- mediaRef,
12062
- mediaType,
12063
- onAutoPlayError,
12064
- logLevel,
12065
- mountTime,
12066
- reason: "player is playing but media tag is paused, and just seeked",
12067
- isPlayer: env.isPlayer
12068
- });
12069
- }
12137
+ if (action.bufferUntilFirstFrame) {
12138
+ bufferUntilFirstFrame(action.shouldBeTime);
12070
12139
  }
12071
- if (!onlyWarnForMediaSeekingError) {
12072
- warnAboutNonSeekableMedia(mediaRef.current, onlyWarnForMediaSeekingError ? "console-warning" : "console-error");
12073
- }
12074
- return;
12075
- }
12076
- const seekThreshold = playing ? 0.15 : 0.01;
12077
- const makesSenseToSeek = Math.abs(mediaRef.current.currentTime - shouldBeTime) > seekThreshold;
12078
- const isMediaTagBufferingOrStalled = isMediaTagBuffering || isBuffering();
12079
- const isSomethingElseBuffering = buffering.buffering.current && !isMediaTagBufferingOrStalled;
12080
- if (!playing || isSomethingElseBuffering) {
12081
- if (makesSenseToSeek) {
12082
- lastSeek.current = seek({
12083
- mediaRef: mediaRef.current,
12084
- time: shouldBeTime,
12140
+ if (action.playReason !== null) {
12141
+ playAndHandleNotAllowedError({
12142
+ mediaRef,
12143
+ mediaType,
12144
+ onAutoPlayError,
12085
12145
  logLevel,
12086
- why: `not playing or something else is buffering. time offset is over seek threshold (${seekThreshold})`,
12087
- mountTime
12146
+ mountTime,
12147
+ reason: action.playReason,
12148
+ isPlayer: env.isPlayer
12088
12149
  });
12089
12150
  }
12151
+ if (action.warnAboutNonSeekable) {
12152
+ warnAboutNonSeekableMedia(current, "console-error");
12153
+ }
12090
12154
  return;
12091
12155
  }
12092
- if (!playing || buffering.buffering.current) {
12093
- return;
12094
- }
12095
- const pausedCondition = mediaRef.current.paused && !mediaRef.current.ended;
12096
- const firstFrameCondition = absoluteFrame === 0;
12097
- if (pausedCondition || firstFrameCondition) {
12098
- const reason = pausedCondition ? "media tag is paused" : "absolute frame is 0";
12099
- if (makesSenseToSeek) {
12156
+ if (action.type === "seek-if-not-playing") {
12157
+ if (action.why !== null) {
12100
12158
  lastSeek.current = seek({
12101
- mediaRef: mediaRef.current,
12102
- time: shouldBeTime,
12159
+ mediaRef: current,
12160
+ time: action.shouldBeTime,
12103
12161
  logLevel,
12104
- why: `is over timeshift threshold (threshold = ${seekThreshold}) and ${reason}`,
12162
+ why: action.why,
12105
12163
  mountTime
12106
12164
  });
12107
12165
  }
12108
- playAndHandleNotAllowedError({
12109
- mediaRef,
12110
- mediaType,
12111
- onAutoPlayError,
12166
+ return;
12167
+ }
12168
+ if (action.why !== null) {
12169
+ lastSeek.current = seek({
12170
+ mediaRef: current,
12171
+ time: action.shouldBeTime,
12112
12172
  logLevel,
12113
- mountTime,
12114
- reason: `player is playing and ${reason}`,
12115
- isPlayer: env.isPlayer
12173
+ why: action.why,
12174
+ mountTime
12116
12175
  });
12117
- if (!isVariableFpsVideo && playbackRate > 0) {
12118
- bufferUntilFirstFrame(shouldBeTime);
12119
- }
12176
+ }
12177
+ playAndHandleNotAllowedError({
12178
+ mediaRef,
12179
+ mediaType,
12180
+ onAutoPlayError,
12181
+ logLevel,
12182
+ mountTime,
12183
+ reason: action.playReason,
12184
+ isPlayer: env.isPlayer
12185
+ });
12186
+ if (action.bufferUntilFirstFrame) {
12187
+ bufferUntilFirstFrame(action.shouldBeTime);
12120
12188
  }
12121
12189
  }, [
12122
12190
  absoluteFrame,
@@ -15640,6 +15708,15 @@ var staticFile = (path) => {
15640
15708
  }
15641
15709
  return preparsed;
15642
15710
  };
15711
+ var Still = (props2) => {
15712
+ const newProps = {
15713
+ ...props2,
15714
+ durationInFrames: 1,
15715
+ fps: 1
15716
+ };
15717
+ return React42.createElement(Composition, newProps);
15718
+ };
15719
+ addSequenceStackTraces(Still);
15643
15720
  var roundTo6Commas = (num) => {
15644
15721
  return Math.round(num * 1e5) / 1e5;
15645
15722
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/promo-pages",
3
- "version": "4.0.486",
3
+ "version": "4.0.487",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,30 +11,30 @@
11
11
  },
12
12
  "type": "module",
13
13
  "dependencies": {
14
- "@remotion/animated-emoji": "4.0.486",
15
- "@remotion/design": "4.0.486",
16
- "@remotion/web-renderer": "4.0.486",
17
- "@remotion/lottie": "4.0.486",
18
- "@remotion/paths": "4.0.486",
19
- "@remotion/player": "4.0.486",
20
- "@remotion/shapes": "4.0.486",
21
- "@remotion/media": "4.0.486",
22
- "@remotion/svg-3d-engine": "4.0.486",
23
- "create-video": "4.0.486",
14
+ "@remotion/animated-emoji": "4.0.487",
15
+ "@remotion/design": "4.0.487",
16
+ "@remotion/web-renderer": "4.0.487",
17
+ "@remotion/lottie": "4.0.487",
18
+ "@remotion/paths": "4.0.487",
19
+ "@remotion/player": "4.0.487",
20
+ "@remotion/shapes": "4.0.487",
21
+ "@remotion/media": "4.0.487",
22
+ "@remotion/svg-3d-engine": "4.0.487",
23
+ "create-video": "4.0.487",
24
24
  "hls.js": "1.5.19",
25
25
  "polished": "4.3.1",
26
- "remotion": "4.0.486",
26
+ "remotion": "4.0.487",
27
27
  "zod": "4.3.6",
28
28
  "@mux/upchunk": "3.5.0",
29
29
  "@vidstack/react": "1.12.13",
30
30
  "bun-plugin-tailwind": "0.1.2",
31
- "@mediabunny/ac3": "1.50.3",
32
- "@mediabunny/aac-encoder": "1.50.3",
33
- "@mediabunny/flac-encoder": "1.50.3",
34
- "@mediabunny/mp3-encoder": "1.50.3"
31
+ "@mediabunny/ac3": "1.50.7",
32
+ "@mediabunny/aac-encoder": "1.50.7",
33
+ "@mediabunny/flac-encoder": "1.50.7",
34
+ "@mediabunny/mp3-encoder": "1.50.7"
35
35
  },
36
36
  "devDependencies": {
37
- "@remotion/eslint-config-internal": "4.0.486",
37
+ "@remotion/eslint-config-internal": "4.0.487",
38
38
  "@eslint/eslintrc": "3.1.0",
39
39
  "@types/react": "19.2.7",
40
40
  "@types/react-dom": "19.2.3",
Binary file
Binary file
Binary file
Binary file