@remotion/media 4.0.436 → 4.0.438
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/audio/audio-for-preview.d.ts +1 -0
- package/dist/audio/props.d.ts +1 -0
- package/dist/audio-extraction/extract-audio.d.ts +1 -0
- package/dist/esm/index.mjs +64 -31
- package/dist/extract-frame-and-audio.d.ts +2 -1
- package/dist/get-sink.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/media-player.d.ts +2 -1
- package/dist/video/props.d.ts +1 -0
- package/dist/video/video-for-preview.d.ts +1 -0
- package/dist/video/video-for-rendering.d.ts +1 -0
- package/dist/video/video.d.ts +1 -0
- package/dist/video-extraction/add-broadcast-channel-listener.d.ts +1 -0
- package/dist/video-extraction/extract-frame-via-broadcast-channel.d.ts +2 -1
- package/dist/video-extraction/extract-frame.d.ts +1 -0
- package/dist/video-extraction/get-frames-since-keyframe.d.ts +1 -1
- package/package.json +4 -4
|
@@ -27,6 +27,7 @@ type InnerAudioProps = {
|
|
|
27
27
|
readonly fallbackHtml5AudioProps?: FallbackHtml5AudioProps;
|
|
28
28
|
readonly debugAudioScheduling?: boolean;
|
|
29
29
|
readonly onError?: MediaOnError;
|
|
30
|
+
readonly credentials?: RequestCredentials;
|
|
30
31
|
};
|
|
31
32
|
export declare const AudioForPreview: React.FC<InnerAudioProps & {
|
|
32
33
|
readonly controls: SequenceControls | undefined;
|
package/dist/audio/props.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ type ExtractAudioParams = {
|
|
|
12
12
|
trimAfter: number | undefined;
|
|
13
13
|
fps: number;
|
|
14
14
|
maxCacheSize: number;
|
|
15
|
+
credentials: RequestCredentials | undefined;
|
|
15
16
|
};
|
|
16
17
|
export declare const extractAudio: (params: ExtractAudioParams) => Promise<"cannot-decode" | "network-error" | "unknown-container-format" | {
|
|
17
18
|
data: PcmS16AudioData | null;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1235,7 +1235,8 @@ class MediaPlayer {
|
|
|
1235
1235
|
durationInFrames,
|
|
1236
1236
|
onVideoFrameCallback,
|
|
1237
1237
|
playing,
|
|
1238
|
-
sequenceOffset
|
|
1238
|
+
sequenceOffset,
|
|
1239
|
+
credentials
|
|
1239
1240
|
}) {
|
|
1240
1241
|
this.canvas = canvas ?? null;
|
|
1241
1242
|
this.src = src;
|
|
@@ -1259,7 +1260,9 @@ class MediaPlayer {
|
|
|
1259
1260
|
this.playing = playing;
|
|
1260
1261
|
this.sequenceOffset = sequenceOffset;
|
|
1261
1262
|
this.input = new Input({
|
|
1262
|
-
source: new UrlSource(this.src
|
|
1263
|
+
source: new UrlSource(this.src, credentials ? {
|
|
1264
|
+
requestInit: { credentials }
|
|
1265
|
+
} : undefined),
|
|
1263
1266
|
formats: ALL_FORMATS
|
|
1264
1267
|
});
|
|
1265
1268
|
if (canvas) {
|
|
@@ -1622,7 +1625,7 @@ class MediaPlayer {
|
|
|
1622
1625
|
const timeInSeconds = globalTime - this.sequenceOffset;
|
|
1623
1626
|
const localTime = this.getTrimmedTime(timeInSeconds);
|
|
1624
1627
|
if (localTime === null) {
|
|
1625
|
-
|
|
1628
|
+
return { type: "not-started" };
|
|
1626
1629
|
}
|
|
1627
1630
|
const targetTime = (mediaTimestamp - localTime) / (this.playbackRate * this.globalPlaybackRate);
|
|
1628
1631
|
return this.sharedAudioContext.scheduleAudioNode({
|
|
@@ -2059,6 +2062,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
2059
2062
|
fallbackHtml5AudioProps,
|
|
2060
2063
|
debugAudioScheduling,
|
|
2061
2064
|
onError,
|
|
2065
|
+
credentials,
|
|
2062
2066
|
controls
|
|
2063
2067
|
}) => {
|
|
2064
2068
|
const videoConfig = useUnsafeVideoConfig();
|
|
@@ -2185,7 +2189,8 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
2185
2189
|
durationInFrames: videoConfig.durationInFrames,
|
|
2186
2190
|
onVideoFrameCallback: null,
|
|
2187
2191
|
playing: initialPlaying.current,
|
|
2188
|
-
sequenceOffset: initialSequenceOffset.current
|
|
2192
|
+
sequenceOffset: initialSequenceOffset.current,
|
|
2193
|
+
credentials
|
|
2189
2194
|
});
|
|
2190
2195
|
mediaPlayerRef.current = player;
|
|
2191
2196
|
player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
|
|
@@ -2277,7 +2282,8 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
2277
2282
|
debugAudioScheduling,
|
|
2278
2283
|
buffer,
|
|
2279
2284
|
onError,
|
|
2280
|
-
videoConfig.durationInFrames
|
|
2285
|
+
videoConfig.durationInFrames,
|
|
2286
|
+
credentials
|
|
2281
2287
|
]);
|
|
2282
2288
|
if (shouldFallbackToNativeAudio && !disallowFallbackToHtml5Audio) {
|
|
2283
2289
|
return /* @__PURE__ */ jsx(RemotionAudio, {
|
|
@@ -2320,6 +2326,7 @@ var AudioForPreview = ({
|
|
|
2320
2326
|
fallbackHtml5AudioProps,
|
|
2321
2327
|
debugAudioScheduling,
|
|
2322
2328
|
onError,
|
|
2329
|
+
credentials,
|
|
2323
2330
|
controls
|
|
2324
2331
|
}) => {
|
|
2325
2332
|
const preloadedSrc = usePreload(src);
|
|
@@ -2369,6 +2376,7 @@ var AudioForPreview = ({
|
|
|
2369
2376
|
toneFrequency,
|
|
2370
2377
|
debugAudioScheduling: debugAudioScheduling ?? false,
|
|
2371
2378
|
onError,
|
|
2379
|
+
credentials,
|
|
2372
2380
|
fallbackHtml5AudioProps,
|
|
2373
2381
|
controls
|
|
2374
2382
|
});
|
|
@@ -3538,11 +3546,12 @@ var getFormatOrNullOrNetworkError = async (input) => {
|
|
|
3538
3546
|
return null;
|
|
3539
3547
|
}
|
|
3540
3548
|
};
|
|
3541
|
-
var getSinks = async (src) => {
|
|
3549
|
+
var getSinks = async (src, credentials) => {
|
|
3542
3550
|
const input = new Input2({
|
|
3543
3551
|
formats: ALL_FORMATS2,
|
|
3544
3552
|
source: new UrlSource2(src, {
|
|
3545
|
-
getRetryDelay
|
|
3553
|
+
getRetryDelay,
|
|
3554
|
+
...credentials ? { requestInit: { credentials } } : undefined
|
|
3546
3555
|
})
|
|
3547
3556
|
});
|
|
3548
3557
|
const format = await getFormatOrNullOrNetworkError(input);
|
|
@@ -3624,15 +3633,16 @@ var getSinks = async (src) => {
|
|
|
3624
3633
|
|
|
3625
3634
|
// src/get-sink.ts
|
|
3626
3635
|
var sinkPromises = {};
|
|
3627
|
-
var getSink = (src, logLevel) => {
|
|
3628
|
-
|
|
3636
|
+
var getSink = (src, logLevel, credentials) => {
|
|
3637
|
+
const cacheKey = credentials ? `${src}::${credentials}` : src;
|
|
3638
|
+
let promise = sinkPromises[cacheKey];
|
|
3629
3639
|
if (!promise) {
|
|
3630
3640
|
Internals16.Log.verbose({
|
|
3631
3641
|
logLevel,
|
|
3632
3642
|
tag: "@remotion/media"
|
|
3633
3643
|
}, `Sink for ${src} was not found, creating new sink`);
|
|
3634
|
-
promise = getSinks(src);
|
|
3635
|
-
sinkPromises[
|
|
3644
|
+
promise = getSinks(src, credentials);
|
|
3645
|
+
sinkPromises[cacheKey] = promise;
|
|
3636
3646
|
}
|
|
3637
3647
|
return promise;
|
|
3638
3648
|
};
|
|
@@ -3649,9 +3659,10 @@ var extractAudioInternal = async ({
|
|
|
3649
3659
|
trimBefore,
|
|
3650
3660
|
trimAfter,
|
|
3651
3661
|
fps,
|
|
3652
|
-
maxCacheSize
|
|
3662
|
+
maxCacheSize,
|
|
3663
|
+
credentials
|
|
3653
3664
|
}) => {
|
|
3654
|
-
const { getAudio, actualMatroskaTimestamps, isMatroska, getDuration } = await getSink(src, logLevel);
|
|
3665
|
+
const { getAudio, actualMatroskaTimestamps, isMatroska, getDuration } = await getSink(src, logLevel, credentials);
|
|
3655
3666
|
let mediaDurationInSeconds = null;
|
|
3656
3667
|
if (loop) {
|
|
3657
3668
|
mediaDurationInSeconds = await getDuration();
|
|
@@ -3777,9 +3788,10 @@ var extractFrameInternal = async ({
|
|
|
3777
3788
|
trimBefore,
|
|
3778
3789
|
playbackRate,
|
|
3779
3790
|
fps,
|
|
3780
|
-
maxCacheSize
|
|
3791
|
+
maxCacheSize,
|
|
3792
|
+
credentials
|
|
3781
3793
|
}) => {
|
|
3782
|
-
const sink = await getSink(src, logLevel);
|
|
3794
|
+
const sink = await getSink(src, logLevel, credentials);
|
|
3783
3795
|
const [video, mediaDurationInSecondsRaw] = await Promise.all([
|
|
3784
3796
|
sink.getVideo(),
|
|
3785
3797
|
loop ? sink.getDuration() : Promise.resolve(null)
|
|
@@ -3905,7 +3917,8 @@ var extractFrameAndAudio = async ({
|
|
|
3905
3917
|
trimAfter,
|
|
3906
3918
|
trimBefore,
|
|
3907
3919
|
fps,
|
|
3908
|
-
maxCacheSize
|
|
3920
|
+
maxCacheSize,
|
|
3921
|
+
credentials
|
|
3909
3922
|
}) => {
|
|
3910
3923
|
try {
|
|
3911
3924
|
const [video, audio] = await Promise.all([
|
|
@@ -3918,7 +3931,8 @@ var extractFrameAndAudio = async ({
|
|
|
3918
3931
|
playbackRate,
|
|
3919
3932
|
trimBefore,
|
|
3920
3933
|
fps,
|
|
3921
|
-
maxCacheSize
|
|
3934
|
+
maxCacheSize,
|
|
3935
|
+
credentials
|
|
3922
3936
|
}) : null,
|
|
3923
3937
|
includeAudio ? extractAudio({
|
|
3924
3938
|
src,
|
|
@@ -3931,7 +3945,8 @@ var extractFrameAndAudio = async ({
|
|
|
3931
3945
|
trimAfter,
|
|
3932
3946
|
fps,
|
|
3933
3947
|
trimBefore,
|
|
3934
|
-
maxCacheSize
|
|
3948
|
+
maxCacheSize,
|
|
3949
|
+
credentials
|
|
3935
3950
|
}) : null
|
|
3936
3951
|
]);
|
|
3937
3952
|
if (video?.type === "cannot-decode") {
|
|
@@ -4014,7 +4029,8 @@ var addBroadcastChannelListener = () => {
|
|
|
4014
4029
|
trimAfter: data.trimAfter,
|
|
4015
4030
|
trimBefore: data.trimBefore,
|
|
4016
4031
|
fps: data.fps,
|
|
4017
|
-
maxCacheSize: data.maxCacheSize
|
|
4032
|
+
maxCacheSize: data.maxCacheSize,
|
|
4033
|
+
credentials: data.credentials
|
|
4018
4034
|
});
|
|
4019
4035
|
if (result.type === "cannot-decode") {
|
|
4020
4036
|
const cannotDecodeResponse = {
|
|
@@ -4111,7 +4127,8 @@ var extractFrameViaBroadcastChannel = async ({
|
|
|
4111
4127
|
trimAfter,
|
|
4112
4128
|
trimBefore,
|
|
4113
4129
|
fps,
|
|
4114
|
-
maxCacheSize
|
|
4130
|
+
maxCacheSize,
|
|
4131
|
+
credentials
|
|
4115
4132
|
}) => {
|
|
4116
4133
|
if (isClientSideRendering || window.remotion_isMainTab) {
|
|
4117
4134
|
return extractFrameAndAudio({
|
|
@@ -4127,7 +4144,8 @@ var extractFrameViaBroadcastChannel = async ({
|
|
|
4127
4144
|
trimAfter,
|
|
4128
4145
|
trimBefore,
|
|
4129
4146
|
fps,
|
|
4130
|
-
maxCacheSize
|
|
4147
|
+
maxCacheSize,
|
|
4148
|
+
credentials
|
|
4131
4149
|
});
|
|
4132
4150
|
}
|
|
4133
4151
|
await waitForMainTabToBeReady(window.remotion_broadcastChannel);
|
|
@@ -4204,7 +4222,8 @@ var extractFrameViaBroadcastChannel = async ({
|
|
|
4204
4222
|
trimAfter,
|
|
4205
4223
|
trimBefore,
|
|
4206
4224
|
fps,
|
|
4207
|
-
maxCacheSize
|
|
4225
|
+
maxCacheSize,
|
|
4226
|
+
credentials
|
|
4208
4227
|
};
|
|
4209
4228
|
window.remotion_broadcastChannel.postMessage(request);
|
|
4210
4229
|
let timeoutId;
|
|
@@ -4242,7 +4261,8 @@ var AudioForRendering = ({
|
|
|
4242
4261
|
toneFrequency,
|
|
4243
4262
|
trimAfter,
|
|
4244
4263
|
trimBefore,
|
|
4245
|
-
onError
|
|
4264
|
+
onError,
|
|
4265
|
+
credentials
|
|
4246
4266
|
}) => {
|
|
4247
4267
|
const defaultLogLevel = Internals18.useLogLevel();
|
|
4248
4268
|
const logLevel = overriddenLogLevel ?? defaultLogLevel;
|
|
@@ -4306,7 +4326,8 @@ var AudioForRendering = ({
|
|
|
4306
4326
|
trimAfter,
|
|
4307
4327
|
trimBefore,
|
|
4308
4328
|
fps,
|
|
4309
|
-
maxCacheSize
|
|
4329
|
+
maxCacheSize,
|
|
4330
|
+
credentials
|
|
4310
4331
|
}).then((result) => {
|
|
4311
4332
|
const handleError = (error, clientSideError, fallbackMessage) => {
|
|
4312
4333
|
const [action, errorToUse] = callOnErrorAndResolve({
|
|
@@ -4400,7 +4421,8 @@ var AudioForRendering = ({
|
|
|
4400
4421
|
replaceWithHtml5Audio,
|
|
4401
4422
|
maxCacheSize,
|
|
4402
4423
|
audioEnabled,
|
|
4403
|
-
onError
|
|
4424
|
+
onError,
|
|
4425
|
+
credentials
|
|
4404
4426
|
]);
|
|
4405
4427
|
if (replaceWithHtml5Audio) {
|
|
4406
4428
|
return /* @__PURE__ */ jsx2(Html5Audio, {
|
|
@@ -4524,6 +4546,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
4524
4546
|
debugAudioScheduling,
|
|
4525
4547
|
headless,
|
|
4526
4548
|
onError,
|
|
4549
|
+
credentials,
|
|
4527
4550
|
controls
|
|
4528
4551
|
}) => {
|
|
4529
4552
|
const src = usePreload2(unpreloadedSrc);
|
|
@@ -4627,7 +4650,8 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
4627
4650
|
durationInFrames: videoConfig.durationInFrames,
|
|
4628
4651
|
onVideoFrameCallback: initialOnVideoFrameRef.current ?? null,
|
|
4629
4652
|
playing: initialPlaying.current,
|
|
4630
|
-
sequenceOffset: initialSequenceOffset.current
|
|
4653
|
+
sequenceOffset: initialSequenceOffset.current,
|
|
4654
|
+
credentials
|
|
4631
4655
|
});
|
|
4632
4656
|
mediaPlayerRef.current = player;
|
|
4633
4657
|
player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
|
|
@@ -4717,7 +4741,8 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
4717
4741
|
sharedAudioContext,
|
|
4718
4742
|
videoConfig.fps,
|
|
4719
4743
|
onError,
|
|
4720
|
-
videoConfig.durationInFrames
|
|
4744
|
+
videoConfig.durationInFrames,
|
|
4745
|
+
credentials
|
|
4721
4746
|
]);
|
|
4722
4747
|
const classNameValue = useMemo4(() => {
|
|
4723
4748
|
return [Internals20.OBJECTFIT_CONTAIN_CLASS_NAME, className].filter(Internals20.truthy).join(" ");
|
|
@@ -4868,7 +4893,8 @@ var VideoForRendering = ({
|
|
|
4868
4893
|
trimAfterValue,
|
|
4869
4894
|
trimBeforeValue,
|
|
4870
4895
|
headless,
|
|
4871
|
-
onError
|
|
4896
|
+
onError,
|
|
4897
|
+
credentials
|
|
4872
4898
|
}) => {
|
|
4873
4899
|
if (!src) {
|
|
4874
4900
|
throw new TypeError("No `src` was passed to <Video>.");
|
|
@@ -4935,7 +4961,8 @@ var VideoForRendering = ({
|
|
|
4935
4961
|
trimAfter: trimAfterValue,
|
|
4936
4962
|
trimBefore: trimBeforeValue,
|
|
4937
4963
|
fps,
|
|
4938
|
-
maxCacheSize
|
|
4964
|
+
maxCacheSize,
|
|
4965
|
+
credentials
|
|
4939
4966
|
}).then((result) => {
|
|
4940
4967
|
const handleError = (err, clientSideError, fallbackMessage, mediaDurationInSeconds) => {
|
|
4941
4968
|
if (environment.isClientSideRendering) {
|
|
@@ -5067,7 +5094,8 @@ var VideoForRendering = ({
|
|
|
5067
5094
|
maxCacheSize,
|
|
5068
5095
|
cancelRender3,
|
|
5069
5096
|
headless,
|
|
5070
|
-
onError
|
|
5097
|
+
onError,
|
|
5098
|
+
credentials
|
|
5071
5099
|
]);
|
|
5072
5100
|
const classNameValue = useMemo5(() => {
|
|
5073
5101
|
return [Internals21.OBJECTFIT_CONTAIN_CLASS_NAME, className].filter(Internals21.truthy).join(" ");
|
|
@@ -5209,6 +5237,7 @@ var InnerVideo = ({
|
|
|
5209
5237
|
debugAudioScheduling,
|
|
5210
5238
|
headless,
|
|
5211
5239
|
onError,
|
|
5240
|
+
credentials,
|
|
5212
5241
|
controls
|
|
5213
5242
|
}) => {
|
|
5214
5243
|
const environment = useRemotionEnvironment4();
|
|
@@ -5251,7 +5280,8 @@ var InnerVideo = ({
|
|
|
5251
5280
|
trimAfterValue,
|
|
5252
5281
|
trimBeforeValue,
|
|
5253
5282
|
headless,
|
|
5254
|
-
onError
|
|
5283
|
+
onError,
|
|
5284
|
+
credentials
|
|
5255
5285
|
});
|
|
5256
5286
|
}
|
|
5257
5287
|
return /* @__PURE__ */ jsx6(VideoForPreview, {
|
|
@@ -5277,6 +5307,7 @@ var InnerVideo = ({
|
|
|
5277
5307
|
debugAudioScheduling: debugAudioScheduling ?? false,
|
|
5278
5308
|
headless: headless ?? false,
|
|
5279
5309
|
onError,
|
|
5310
|
+
credentials,
|
|
5280
5311
|
controls
|
|
5281
5312
|
});
|
|
5282
5313
|
};
|
|
@@ -5306,6 +5337,7 @@ var VideoInner = ({
|
|
|
5306
5337
|
debugAudioScheduling,
|
|
5307
5338
|
headless,
|
|
5308
5339
|
onError,
|
|
5340
|
+
credentials,
|
|
5309
5341
|
controls
|
|
5310
5342
|
}) => {
|
|
5311
5343
|
const fallbackLogLevel = Internals22.useLogLevel();
|
|
@@ -5335,6 +5367,7 @@ var VideoInner = ({
|
|
|
5335
5367
|
debugAudioScheduling: debugAudioScheduling ?? false,
|
|
5336
5368
|
headless: headless ?? false,
|
|
5337
5369
|
onError,
|
|
5370
|
+
credentials,
|
|
5338
5371
|
controls
|
|
5339
5372
|
});
|
|
5340
5373
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtractFrameViaBroadcastChannelResult } from './video-extraction/extract-frame-via-broadcast-channel';
|
|
2
|
-
export declare const extractFrameAndAudio: ({ src, timeInSeconds, logLevel, durationInSeconds, playbackRate, includeAudio, includeVideo, loop, audioStreamIndex, trimAfter, trimBefore, fps, maxCacheSize, }: {
|
|
2
|
+
export declare const extractFrameAndAudio: ({ src, timeInSeconds, logLevel, durationInSeconds, playbackRate, includeAudio, includeVideo, loop, audioStreamIndex, trimAfter, trimBefore, fps, maxCacheSize, credentials, }: {
|
|
3
3
|
src: string;
|
|
4
4
|
timeInSeconds: number;
|
|
5
5
|
logLevel: "error" | "info" | "trace" | "verbose" | "warn";
|
|
@@ -13,4 +13,5 @@ export declare const extractFrameAndAudio: ({ src, timeInSeconds, logLevel, dura
|
|
|
13
13
|
trimBefore: number | undefined;
|
|
14
14
|
fps: number;
|
|
15
15
|
maxCacheSize: number;
|
|
16
|
+
credentials: RequestCredentials | undefined;
|
|
16
17
|
}) => Promise<ExtractFrameViaBroadcastChannelResult>;
|
package/dist/get-sink.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GetSink } from './video-extraction/get-frames-since-keyframe';
|
|
2
2
|
export declare const sinkPromises: Record<string, Promise<GetSink>>;
|
|
3
|
-
export declare const getSink: (src: string, logLevel: "error" | "info" | "trace" | "verbose" | "warn") => Promise<{
|
|
3
|
+
export declare const getSink: (src: string, logLevel: "error" | "info" | "trace" | "verbose" | "warn", credentials: RequestCredentials | undefined) => Promise<{
|
|
4
4
|
getVideo: () => Promise<import("./video-extraction/get-frames-since-keyframe").VideoSinkResult>;
|
|
5
5
|
getAudio: (index: number) => Promise<import("./video-extraction/get-frames-since-keyframe").AudioSinkResult>;
|
|
6
6
|
actualMatroskaTimestamps: {
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare const experimental_Video: import("react").ComponentType<{
|
|
|
37
37
|
debugAudioScheduling: boolean;
|
|
38
38
|
headless: boolean;
|
|
39
39
|
onError: import("./on-error").MediaOnError | undefined;
|
|
40
|
+
credentials: RequestCredentials | undefined;
|
|
40
41
|
}>>;
|
|
41
42
|
export { AudioForPreview } from './audio/audio-for-preview';
|
|
42
43
|
export { AudioProps, FallbackHtml5AudioProps } from './audio/props';
|
package/dist/media-player.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare class MediaPlayer {
|
|
|
44
44
|
private isPremounting;
|
|
45
45
|
private isPostmounting;
|
|
46
46
|
private seekPromiseChain;
|
|
47
|
-
constructor({ canvas, src, logLevel, sharedAudioContext, loop, trimBefore, trimAfter, playbackRate, globalPlaybackRate, audioStreamIndex, fps, debugOverlay, debugAudioScheduling, bufferState, isPremounting, isPostmounting, durationInFrames, onVideoFrameCallback, playing, sequenceOffset }: {
|
|
47
|
+
constructor({ canvas, src, logLevel, sharedAudioContext, loop, trimBefore, trimAfter, playbackRate, globalPlaybackRate, audioStreamIndex, fps, debugOverlay, debugAudioScheduling, bufferState, isPremounting, isPostmounting, durationInFrames, onVideoFrameCallback, playing, sequenceOffset, credentials }: {
|
|
48
48
|
canvas: HTMLCanvasElement | OffscreenCanvas | null;
|
|
49
49
|
src: string;
|
|
50
50
|
logLevel: LogLevel;
|
|
@@ -65,6 +65,7 @@ export declare class MediaPlayer {
|
|
|
65
65
|
onVideoFrameCallback: null | ((frame: CanvasImageSource) => void);
|
|
66
66
|
playing: boolean;
|
|
67
67
|
sequenceOffset: number;
|
|
68
|
+
credentials: RequestCredentials | undefined;
|
|
68
69
|
});
|
|
69
70
|
private input;
|
|
70
71
|
private isDisposalError;
|
package/dist/video/props.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ type OptionalVideoProps = {
|
|
|
48
48
|
debugAudioScheduling: boolean;
|
|
49
49
|
headless: boolean;
|
|
50
50
|
onError: MediaOnError | undefined;
|
|
51
|
+
credentials: RequestCredentials | undefined;
|
|
51
52
|
};
|
|
52
53
|
export type InnerVideoProps = MandatoryVideoProps & OuterVideoProps & OptionalVideoProps;
|
|
53
54
|
export type VideoProps = MandatoryVideoProps & Partial<OuterVideoProps> & Partial<OptionalVideoProps>;
|
|
@@ -25,6 +25,7 @@ type VideoForPreviewProps = {
|
|
|
25
25
|
readonly debugAudioScheduling: boolean;
|
|
26
26
|
readonly headless: boolean;
|
|
27
27
|
readonly onError: MediaOnError | undefined;
|
|
28
|
+
readonly credentials: RequestCredentials | undefined;
|
|
28
29
|
};
|
|
29
30
|
export declare const VideoForPreview: React.FC<VideoForPreviewProps & {
|
|
30
31
|
readonly controls: SequenceControls | undefined;
|
|
@@ -25,6 +25,7 @@ type InnerVideoProps = {
|
|
|
25
25
|
readonly trimAfterValue: number | undefined;
|
|
26
26
|
readonly headless: boolean;
|
|
27
27
|
readonly onError: MediaOnError | undefined;
|
|
28
|
+
readonly credentials: RequestCredentials | undefined;
|
|
28
29
|
};
|
|
29
30
|
export declare const VideoForRendering: React.FC<InnerVideoProps>;
|
|
30
31
|
export {};
|
package/dist/video/video.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export type ExtractFrameRequest = {
|
|
|
43
43
|
trimBefore: number | undefined;
|
|
44
44
|
fps: number;
|
|
45
45
|
maxCacheSize: number;
|
|
46
|
+
credentials: RequestCredentials | undefined;
|
|
46
47
|
};
|
|
47
48
|
export declare const addBroadcastChannelListener: () => void;
|
|
48
49
|
export declare const waitForMainTabToBeReady: (channel: BroadcastChannel) => Promise<void>;
|
|
@@ -15,7 +15,7 @@ export type ExtractFrameViaBroadcastChannelResult = {
|
|
|
15
15
|
} | {
|
|
16
16
|
type: 'unknown-container-format';
|
|
17
17
|
};
|
|
18
|
-
export declare const extractFrameViaBroadcastChannel: ({ src, timeInSeconds, logLevel, durationInSeconds, playbackRate, includeAudio, includeVideo, isClientSideRendering, loop, audioStreamIndex, trimAfter, trimBefore, fps, maxCacheSize, }: {
|
|
18
|
+
export declare const extractFrameViaBroadcastChannel: ({ src, timeInSeconds, logLevel, durationInSeconds, playbackRate, includeAudio, includeVideo, isClientSideRendering, loop, audioStreamIndex, trimAfter, trimBefore, fps, maxCacheSize, credentials, }: {
|
|
19
19
|
src: string;
|
|
20
20
|
timeInSeconds: number;
|
|
21
21
|
durationInSeconds: number;
|
|
@@ -30,4 +30,5 @@ export declare const extractFrameViaBroadcastChannel: ({ src, timeInSeconds, log
|
|
|
30
30
|
trimBefore: number | undefined;
|
|
31
31
|
fps: number;
|
|
32
32
|
maxCacheSize: number;
|
|
33
|
+
credentials: RequestCredentials | undefined;
|
|
33
34
|
}) => Promise<ExtractFrameViaBroadcastChannelResult>;
|
|
@@ -7,7 +7,7 @@ type AudioSinks = {
|
|
|
7
7
|
};
|
|
8
8
|
export type AudioSinkResult = AudioSinks | 'no-audio-track' | 'cannot-decode-audio' | 'unknown-container-format' | 'network-error';
|
|
9
9
|
export type VideoSinkResult = VideoSinks | 'no-video-track' | 'cannot-decode' | 'cannot-decode-alpha' | 'unknown-container-format' | 'network-error';
|
|
10
|
-
export declare const getSinks: (src: string) => Promise<{
|
|
10
|
+
export declare const getSinks: (src: string, credentials: RequestCredentials | undefined) => Promise<{
|
|
11
11
|
getVideo: () => Promise<VideoSinkResult>;
|
|
12
12
|
getAudio: (index: number) => Promise<AudioSinkResult>;
|
|
13
13
|
actualMatroskaTimestamps: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/media",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.438",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"make": "tsgo && bun --env-file=../.env.bundle bundle.ts"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"mediabunny": "1.
|
|
26
|
-
"remotion": "4.0.
|
|
25
|
+
"mediabunny": "1.39.2",
|
|
26
|
+
"remotion": "4.0.438",
|
|
27
27
|
"zod": "4.3.6"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-dom": ">=16.8.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
34
|
+
"@remotion/eslint-config-internal": "4.0.438",
|
|
35
35
|
"@vitest/browser-webdriverio": "4.0.9",
|
|
36
36
|
"eslint": "9.19.0",
|
|
37
37
|
"react": "19.2.3",
|