@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/team.js CHANGED
@@ -5746,7 +5746,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
5746
5746
  var addSequenceStackTraces = (component) => {
5747
5747
  componentsToAddStacksTo.push(component);
5748
5748
  };
5749
- var VERSION = "4.0.486";
5749
+ var VERSION = "4.0.487";
5750
5750
  var checkMultipleRemotionVersions = () => {
5751
5751
  if (typeof globalThis === "undefined") {
5752
5752
  return;
@@ -11616,7 +11616,8 @@ var useBufferManager = (logLevel, mountTime) => {
11616
11616
  if (rendering) {
11617
11617
  return;
11618
11618
  }
11619
- if (blocks.length > 0) {
11619
+ if (blocks.length > 0 && !buffering.current) {
11620
+ buffering.current = true;
11620
11621
  onBufferingCallbacks.forEach((c2) => c2());
11621
11622
  playbackLogging({
11622
11623
  logLevel,
@@ -11631,7 +11632,8 @@ var useBufferManager = (logLevel, mountTime) => {
11631
11632
  if (rendering) {
11632
11633
  return;
11633
11634
  }
11634
- if (blocks.length === 0) {
11635
+ if (blocks.length === 0 && buffering.current) {
11636
+ buffering.current = false;
11635
11637
  onResumeCallbacks.forEach((c2) => c2());
11636
11638
  playbackLogging({
11637
11639
  logLevel,
@@ -11664,15 +11666,11 @@ var useIsPlayerBuffering = (bufferManager) => {
11664
11666
  const onResume = () => {
11665
11667
  setIsBuffering(false);
11666
11668
  };
11667
- bufferManager.listenForBuffering(onBuffer);
11668
- bufferManager.listenForResume(onResume);
11669
+ const buffer = bufferManager.listenForBuffering(onBuffer);
11670
+ const resume = bufferManager.listenForResume(onResume);
11669
11671
  return () => {
11670
- bufferManager.listenForBuffering(() => {
11671
- return;
11672
- });
11673
- bufferManager.listenForResume(() => {
11674
- return;
11675
- });
11672
+ buffer.remove();
11673
+ resume.remove();
11676
11674
  };
11677
11675
  }, [bufferManager]);
11678
11676
  return isBuffering;
@@ -11796,6 +11794,72 @@ var useBufferUntilFirstFrame = ({
11796
11794
  };
11797
11795
  }, [bufferUntilFirstFrame]);
11798
11796
  };
11797
+ var getMediaSyncAction = (input) => {
11798
+ const {
11799
+ duration,
11800
+ currentTime,
11801
+ paused,
11802
+ ended,
11803
+ desiredUnclampedTime,
11804
+ mediaTagTime,
11805
+ mediaTagLastUpdate,
11806
+ rvcTime,
11807
+ rvcLastUpdate,
11808
+ isVariableFpsVideo,
11809
+ acceptableTimeShift,
11810
+ lastSeekDueToShift,
11811
+ playing,
11812
+ playbackRate,
11813
+ mediaTagBufferingOrStalled,
11814
+ playerBuffering,
11815
+ absoluteFrame,
11816
+ onlyWarnForMediaSeekingError,
11817
+ isPremounting,
11818
+ isPostmounting,
11819
+ pauseWhenBuffering
11820
+ } = input;
11821
+ const shouldBeTime = !Number.isNaN(duration) && Number.isFinite(duration) ? Math.min(duration, desiredUnclampedTime) : desiredUnclampedTime;
11822
+ const timeShiftMediaTag = Math.abs(shouldBeTime - mediaTagTime);
11823
+ const timeShiftRvcTag = rvcTime ? Math.abs(shouldBeTime - rvcTime) : null;
11824
+ const mostRecentTimeshift = rvcLastUpdate && rvcTime > mediaTagLastUpdate ? timeShiftRvcTag : timeShiftMediaTag;
11825
+ const timeShift = timeShiftRvcTag && !isVariableFpsVideo ? mostRecentTimeshift : timeShiftMediaTag;
11826
+ if (timeShift > acceptableTimeShift && lastSeekDueToShift !== shouldBeTime) {
11827
+ return {
11828
+ type: "seek-due-to-shift",
11829
+ shouldBeTime,
11830
+ why: `because time shift is too big. shouldBeTime = ${shouldBeTime}, isTime = ${mediaTagTime}, requestVideoCallbackTime = ${rvcTime}, timeShift = ${timeShift}${isVariableFpsVideo ? ", isVariableFpsVideo = true" : ""}, isPremounting = ${isPremounting}, isPostmounting = ${isPostmounting}, pauseWhenBuffering = ${pauseWhenBuffering}`,
11831
+ bufferUntilFirstFrame: playing && playbackRate > 0,
11832
+ playReason: playing && paused ? "player is playing but media tag is paused, and just seeked" : null,
11833
+ warnAboutNonSeekable: !onlyWarnForMediaSeekingError
11834
+ };
11835
+ }
11836
+ const seekThreshold = playing ? 0.15 : 0.01;
11837
+ const makesSenseToSeek = Math.abs(currentTime - shouldBeTime) > seekThreshold;
11838
+ const isSomethingElseBuffering = playerBuffering && !mediaTagBufferingOrStalled;
11839
+ if (!playing || isSomethingElseBuffering) {
11840
+ return {
11841
+ type: "seek-if-not-playing",
11842
+ shouldBeTime,
11843
+ why: makesSenseToSeek ? `not playing or something else is buffering. time offset is over seek threshold (${seekThreshold})` : null
11844
+ };
11845
+ }
11846
+ if (!playing || playerBuffering) {
11847
+ return { type: "none" };
11848
+ }
11849
+ const pausedCondition = paused && !ended;
11850
+ const firstFrameCondition = absoluteFrame === 0;
11851
+ if (pausedCondition || firstFrameCondition) {
11852
+ const reason = pausedCondition ? "media tag is paused" : "absolute frame is 0";
11853
+ return {
11854
+ type: "play-and-seek",
11855
+ shouldBeTime,
11856
+ why: makesSenseToSeek ? `is over timeshift threshold (threshold = ${seekThreshold}) and ${reason}` : null,
11857
+ playReason: `player is playing and ${reason}`,
11858
+ bufferUntilFirstFrame: !isVariableFpsVideo && playbackRate > 0
11859
+ };
11860
+ }
11861
+ return { type: "none" };
11862
+ };
11799
11863
  var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
11800
11864
  const lastUpdate = React21.useRef({
11801
11865
  time: mediaRef.current?.currentTime ?? 0,
@@ -12215,89 +12279,93 @@ var useMediaPlayback = ({
12215
12279
  if (!src) {
12216
12280
  throw new Error(`No 'src' attribute was passed to the ${tagName} element.`);
12217
12281
  }
12218
- const { duration } = mediaRef.current;
12219
- const shouldBeTime = !Number.isNaN(duration) && Number.isFinite(duration) ? Math.min(duration, desiredUnclampedTime) : desiredUnclampedTime;
12220
- const mediaTagTime = mediaTagCurrentTime.current.time;
12221
- const rvcTime = rvcCurrentTime.current?.time ?? null;
12222
- const isVariableFpsVideo = isVariableFpsVideoMap.current[src];
12223
- const timeShiftMediaTag = Math.abs(shouldBeTime - mediaTagTime);
12224
- const timeShiftRvcTag = rvcTime ? Math.abs(shouldBeTime - rvcTime) : null;
12225
- const mostRecentTimeshift = rvcCurrentTime.current?.lastUpdate && rvcCurrentTime.current.time > mediaTagCurrentTime.current.lastUpdate ? timeShiftRvcTag : timeShiftMediaTag;
12226
- const timeShift = timeShiftRvcTag && !isVariableFpsVideo ? mostRecentTimeshift : timeShiftMediaTag;
12227
- if (timeShift > acceptableTimeShiftButLessThanDuration && lastSeekDueToShift.current !== shouldBeTime) {
12282
+ const { current } = mediaRef;
12283
+ const action = getMediaSyncAction({
12284
+ duration: current.duration,
12285
+ currentTime: current.currentTime,
12286
+ paused: current.paused,
12287
+ ended: current.ended,
12288
+ desiredUnclampedTime,
12289
+ mediaTagTime: mediaTagCurrentTime.current.time,
12290
+ mediaTagLastUpdate: mediaTagCurrentTime.current.lastUpdate,
12291
+ rvcTime: rvcCurrentTime.current?.time ?? null,
12292
+ rvcLastUpdate: rvcCurrentTime.current?.lastUpdate ?? null,
12293
+ isVariableFpsVideo: Boolean(isVariableFpsVideoMap.current[src]),
12294
+ acceptableTimeShift: acceptableTimeShiftButLessThanDuration,
12295
+ lastSeekDueToShift: lastSeekDueToShift.current,
12296
+ playing,
12297
+ playbackRate,
12298
+ mediaTagBufferingOrStalled: isMediaTagBuffering || isBuffering(),
12299
+ playerBuffering: buffering.buffering.current,
12300
+ absoluteFrame,
12301
+ onlyWarnForMediaSeekingError,
12302
+ isPremounting,
12303
+ isPostmounting,
12304
+ pauseWhenBuffering
12305
+ });
12306
+ if (action.type === "none") {
12307
+ return;
12308
+ }
12309
+ if (action.type === "seek-due-to-shift") {
12228
12310
  lastSeek.current = seek({
12229
- mediaRef: mediaRef.current,
12230
- time: shouldBeTime,
12311
+ mediaRef: current,
12312
+ time: action.shouldBeTime,
12231
12313
  logLevel,
12232
- why: `because time shift is too big. shouldBeTime = ${shouldBeTime}, isTime = ${mediaTagTime}, requestVideoCallbackTime = ${rvcTime}, timeShift = ${timeShift}${isVariableFpsVideo ? ", isVariableFpsVideo = true" : ""}, isPremounting = ${isPremounting}, isPostmounting = ${isPostmounting}, pauseWhenBuffering = ${pauseWhenBuffering}`,
12314
+ why: action.why,
12233
12315
  mountTime
12234
12316
  });
12235
12317
  lastSeekDueToShift.current = lastSeek.current;
12236
- if (playing) {
12237
- if (playbackRate > 0) {
12238
- bufferUntilFirstFrame(shouldBeTime);
12239
- }
12240
- if (mediaRef.current.paused) {
12241
- playAndHandleNotAllowedError({
12242
- mediaRef,
12243
- mediaType,
12244
- onAutoPlayError,
12245
- logLevel,
12246
- mountTime,
12247
- reason: "player is playing but media tag is paused, and just seeked",
12248
- isPlayer: env.isPlayer
12249
- });
12250
- }
12318
+ if (action.bufferUntilFirstFrame) {
12319
+ bufferUntilFirstFrame(action.shouldBeTime);
12251
12320
  }
12252
- if (!onlyWarnForMediaSeekingError) {
12253
- warnAboutNonSeekableMedia(mediaRef.current, onlyWarnForMediaSeekingError ? "console-warning" : "console-error");
12254
- }
12255
- return;
12256
- }
12257
- const seekThreshold = playing ? 0.15 : 0.01;
12258
- const makesSenseToSeek = Math.abs(mediaRef.current.currentTime - shouldBeTime) > seekThreshold;
12259
- const isMediaTagBufferingOrStalled = isMediaTagBuffering || isBuffering();
12260
- const isSomethingElseBuffering = buffering.buffering.current && !isMediaTagBufferingOrStalled;
12261
- if (!playing || isSomethingElseBuffering) {
12262
- if (makesSenseToSeek) {
12263
- lastSeek.current = seek({
12264
- mediaRef: mediaRef.current,
12265
- time: shouldBeTime,
12321
+ if (action.playReason !== null) {
12322
+ playAndHandleNotAllowedError({
12323
+ mediaRef,
12324
+ mediaType,
12325
+ onAutoPlayError,
12266
12326
  logLevel,
12267
- why: `not playing or something else is buffering. time offset is over seek threshold (${seekThreshold})`,
12268
- mountTime
12327
+ mountTime,
12328
+ reason: action.playReason,
12329
+ isPlayer: env.isPlayer
12269
12330
  });
12270
12331
  }
12332
+ if (action.warnAboutNonSeekable) {
12333
+ warnAboutNonSeekableMedia(current, "console-error");
12334
+ }
12271
12335
  return;
12272
12336
  }
12273
- if (!playing || buffering.buffering.current) {
12274
- return;
12275
- }
12276
- const pausedCondition = mediaRef.current.paused && !mediaRef.current.ended;
12277
- const firstFrameCondition = absoluteFrame === 0;
12278
- if (pausedCondition || firstFrameCondition) {
12279
- const reason = pausedCondition ? "media tag is paused" : "absolute frame is 0";
12280
- if (makesSenseToSeek) {
12337
+ if (action.type === "seek-if-not-playing") {
12338
+ if (action.why !== null) {
12281
12339
  lastSeek.current = seek({
12282
- mediaRef: mediaRef.current,
12283
- time: shouldBeTime,
12340
+ mediaRef: current,
12341
+ time: action.shouldBeTime,
12284
12342
  logLevel,
12285
- why: `is over timeshift threshold (threshold = ${seekThreshold}) and ${reason}`,
12343
+ why: action.why,
12286
12344
  mountTime
12287
12345
  });
12288
12346
  }
12289
- playAndHandleNotAllowedError({
12290
- mediaRef,
12291
- mediaType,
12292
- onAutoPlayError,
12347
+ return;
12348
+ }
12349
+ if (action.why !== null) {
12350
+ lastSeek.current = seek({
12351
+ mediaRef: current,
12352
+ time: action.shouldBeTime,
12293
12353
  logLevel,
12294
- mountTime,
12295
- reason: `player is playing and ${reason}`,
12296
- isPlayer: env.isPlayer
12354
+ why: action.why,
12355
+ mountTime
12297
12356
  });
12298
- if (!isVariableFpsVideo && playbackRate > 0) {
12299
- bufferUntilFirstFrame(shouldBeTime);
12300
- }
12357
+ }
12358
+ playAndHandleNotAllowedError({
12359
+ mediaRef,
12360
+ mediaType,
12361
+ onAutoPlayError,
12362
+ logLevel,
12363
+ mountTime,
12364
+ reason: action.playReason,
12365
+ isPlayer: env.isPlayer
12366
+ });
12367
+ if (action.bufferUntilFirstFrame) {
12368
+ bufferUntilFirstFrame(action.shouldBeTime);
12301
12369
  }
12302
12370
  }, [
12303
12371
  absoluteFrame,
@@ -15821,6 +15889,15 @@ var staticFile = (path) => {
15821
15889
  }
15822
15890
  return preparsed;
15823
15891
  };
15892
+ var Still = (props2) => {
15893
+ const newProps = {
15894
+ ...props2,
15895
+ durationInFrames: 1,
15896
+ fps: 1
15897
+ };
15898
+ return React42.createElement(Composition, newProps);
15899
+ };
15900
+ addSequenceStackTraces(Still);
15824
15901
  var roundTo6Commas = (num) => {
15825
15902
  return Math.round(num * 1e5) / 1e5;
15826
15903
  };
@@ -28,7 +28,7 @@
28
28
  height: 100%;
29
29
  }
30
30
 
31
- video {
31
+ .video-container video {
32
32
  display: block;
33
33
  cursor: pointer;
34
34
  max-width: 100%;
@@ -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
  };