remotion 4.0.395 → 4.0.397
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/cjs/calculate-loop.d.ts +6 -0
- package/dist/cjs/calculate-loop.js +17 -0
- package/dist/cjs/default-css.d.ts +1 -1
- package/dist/cjs/default-css.js +12 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/use-audio-channel-index.d.ts +4 -0
- package/dist/cjs/video/use-audio-channel-index.js +13 -0
- package/dist/esm/index.mjs +13 -4
- package/dist/esm/index.mjs.map +137 -0
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateLoopDuration = void 0;
|
|
4
|
+
const calculateLoopDuration = ({ endAt, mediaDuration, playbackRate, startFrom, }) => {
|
|
5
|
+
let duration = mediaDuration;
|
|
6
|
+
// Account for endAt
|
|
7
|
+
if (typeof endAt !== 'undefined') {
|
|
8
|
+
duration = endAt;
|
|
9
|
+
}
|
|
10
|
+
// Account for startFrom
|
|
11
|
+
if (typeof startFrom !== 'undefined') {
|
|
12
|
+
duration -= startFrom;
|
|
13
|
+
}
|
|
14
|
+
const actualDuration = duration / playbackRate;
|
|
15
|
+
return Math.floor(actualDuration);
|
|
16
|
+
};
|
|
17
|
+
exports.calculateLoopDuration = calculateLoopDuration;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const injectCSS: (css: string) => void;
|
|
1
|
+
export declare const injectCSS: (css: string) => (() => void);
|
|
2
2
|
export declare const OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
|
|
3
3
|
export declare const makeDefaultPreviewCSS: (scope: string | null, backgroundColor: string) => string;
|
package/dist/cjs/default-css.js
CHANGED
|
@@ -5,16 +5,25 @@ const injected = {};
|
|
|
5
5
|
const injectCSS = (css) => {
|
|
6
6
|
// Skip in node
|
|
7
7
|
if (typeof document === 'undefined') {
|
|
8
|
-
return;
|
|
8
|
+
return () => { };
|
|
9
9
|
}
|
|
10
10
|
if (injected[css]) {
|
|
11
|
-
return;
|
|
11
|
+
return () => { };
|
|
12
12
|
}
|
|
13
13
|
const head = document.head || document.getElementsByTagName('head')[0];
|
|
14
14
|
const style = document.createElement('style');
|
|
15
15
|
style.appendChild(document.createTextNode(css));
|
|
16
16
|
head.prepend(style);
|
|
17
|
-
injected[css] =
|
|
17
|
+
injected[css] = style;
|
|
18
|
+
return () => {
|
|
19
|
+
const styleElement = injected[css];
|
|
20
|
+
if (styleElement) {
|
|
21
|
+
if (styleElement.parentNode) {
|
|
22
|
+
styleElement.parentNode.removeChild(styleElement);
|
|
23
|
+
}
|
|
24
|
+
delete injected[css];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
18
27
|
};
|
|
19
28
|
exports.injectCSS = injectCSS;
|
|
20
29
|
// make object-fit: contain low priority, so it can be overridden by another class name
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAudioChannelIndex = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useAudioChannelIndex = ({ ref, audioChannelIndex, }) => {
|
|
6
|
+
(0, react_1.useEffect)(() => {
|
|
7
|
+
var _a;
|
|
8
|
+
// @ts-expect-error
|
|
9
|
+
const audioChannels = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.audioTracks;
|
|
10
|
+
console.log({ audioChannels, audioChannelIndex });
|
|
11
|
+
}, [ref, audioChannelIndex]);
|
|
12
|
+
};
|
|
13
|
+
exports.useAudioChannelIndex = useAudioChannelIndex;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -110,7 +110,7 @@ function truthy(value) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// src/version.ts
|
|
113
|
-
var VERSION = "4.0.
|
|
113
|
+
var VERSION = "4.0.397";
|
|
114
114
|
|
|
115
115
|
// src/multiple-versions-warning.ts
|
|
116
116
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -6043,16 +6043,25 @@ __export(exports_default_css, {
|
|
|
6043
6043
|
var injected = {};
|
|
6044
6044
|
var injectCSS = (css) => {
|
|
6045
6045
|
if (typeof document === "undefined") {
|
|
6046
|
-
return;
|
|
6046
|
+
return () => {};
|
|
6047
6047
|
}
|
|
6048
6048
|
if (injected[css]) {
|
|
6049
|
-
return;
|
|
6049
|
+
return () => {};
|
|
6050
6050
|
}
|
|
6051
6051
|
const head = document.head || document.getElementsByTagName("head")[0];
|
|
6052
6052
|
const style = document.createElement("style");
|
|
6053
6053
|
style.appendChild(document.createTextNode(css));
|
|
6054
6054
|
head.prepend(style);
|
|
6055
|
-
injected[css] =
|
|
6055
|
+
injected[css] = style;
|
|
6056
|
+
return () => {
|
|
6057
|
+
const styleElement = injected[css];
|
|
6058
|
+
if (styleElement) {
|
|
6059
|
+
if (styleElement.parentNode) {
|
|
6060
|
+
styleElement.parentNode.removeChild(styleElement);
|
|
6061
|
+
}
|
|
6062
|
+
delete injected[css];
|
|
6063
|
+
}
|
|
6064
|
+
};
|
|
6056
6065
|
};
|
|
6057
6066
|
var OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
|
|
6058
6067
|
var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|