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.
@@ -0,0 +1,6 @@
1
+ export declare const calculateLoopDuration: ({ endAt, mediaDuration, playbackRate, startFrom, }: {
2
+ mediaDuration: number;
3
+ playbackRate: number;
4
+ startFrom: number | undefined;
5
+ endAt: number | undefined;
6
+ }) => number;
@@ -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;
@@ -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] = true;
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
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.395";
6
+ export declare const VERSION = "4.0.397";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.395';
10
+ exports.VERSION = '4.0.397';
@@ -0,0 +1,4 @@
1
+ export declare const useAudioChannelIndex: ({ ref, audioChannelIndex, }: {
2
+ ref: React.RefObject<HTMLVideoElement | HTMLAudioElement | null>;
3
+ audioChannelIndex: number;
4
+ }) => void;
@@ -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;
@@ -110,7 +110,7 @@ function truthy(value) {
110
110
  }
111
111
 
112
112
  // src/version.ts
113
- var VERSION = "4.0.395";
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] = true;
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) => {