@remotion/player
Advanced tools
Comparing version 2.5.0-alpha.ee579a98 to 3.0.0-lambda.2
@@ -0,1 +1,2 @@ | ||
/// <reference types="react" /> | ||
import { PlayerEmitter } from './event-emitter'; | ||
@@ -2,0 +3,0 @@ export { Player } from './Player'; |
@@ -0,1 +1,2 @@ | ||
/// <reference types="react" /> | ||
export declare const PlayerSeekBar: React.FC<{ | ||
@@ -2,0 +3,0 @@ durationInFrames: number; |
@@ -1,7 +0,7 @@ | ||
import { RenderOptions } from '@testing-library/react'; | ||
import { queries, RenderOptions } from '@testing-library/react'; | ||
import { FC, ReactElement } from 'react'; | ||
declare const HelloWorld: FC; | ||
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions<typeof import("@testing-library/dom/types/queries"), HTMLElement>, "queries"> | undefined) => import("@testing-library/react").RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement>; | ||
declare const customRender: (ui: ReactElement, options?: Omit<RenderOptions<typeof queries, HTMLElement>, "queries"> | undefined) => import("@testing-library/react").RenderResult<typeof queries, HTMLElement>; | ||
export * from '@testing-library/react'; | ||
export { customRender as render, HelloWorld }; | ||
//# sourceMappingURL=test-utils.d.ts.map |
@@ -12,2 +12,3 @@ "use strict"; | ||
const setFrame = remotion_1.Internals.Timeline.useTimelineSetFrame(); | ||
const { inFrame, outFrame, } = remotion_1.Internals.Timeline.useTimelineInOutFramePosition(); | ||
const frameRef = (0, react_1.useRef)(frame); | ||
@@ -23,6 +24,28 @@ frameRef.current = frame; | ||
} | ||
const getFrameInRange = (nextFrame) => { | ||
if ((inFrame && nextFrame < inFrame) || | ||
(inFrame && outFrame && nextFrame > outFrame)) { | ||
return inFrame; | ||
} | ||
if (outFrame && nextFrame > outFrame) { | ||
return 0; | ||
} | ||
return nextFrame; | ||
}; | ||
let hasBeenStopped = false; | ||
let reqAnimFrameCall = null; | ||
const startedTime = performance.now(); | ||
const startedFrame = frameRef.current; | ||
const startedFrame = getFrameInRange(frameRef.current); | ||
const durationInFrames = (() => { | ||
if (inFrame !== null && outFrame !== null) { | ||
return outFrame - inFrame + 1; | ||
} | ||
if (inFrame !== null) { | ||
return config.durationInFrames - inFrame; | ||
} | ||
if (outFrame !== null) { | ||
return outFrame + 1; | ||
} | ||
return config.durationInFrames; | ||
})(); | ||
const stop = () => { | ||
@@ -36,3 +59,3 @@ hasBeenStopped = true; | ||
const time = performance.now() - startedTime; | ||
const nextFrame = Math.round(time / (1000 / config.fps)) + startedFrame; | ||
const nextFrame = Math.round(time / (1000 / config.fps)) + startedFrame - (inFrame !== null && inFrame !== void 0 ? inFrame : 0); | ||
if (nextFrame === config.durationInFrames && !loop) { | ||
@@ -44,3 +67,3 @@ stop(); | ||
} | ||
const actualNextFrame = nextFrame % config.durationInFrames; | ||
const actualNextFrame = (nextFrame % durationInFrames) + (inFrame !== null && inFrame !== void 0 ? inFrame : 0); | ||
if (actualNextFrame !== frameRef.current) { | ||
@@ -57,3 +80,3 @@ setFrame(actualNextFrame); | ||
}; | ||
}, [config, loop, pause, playing, setFrame, emitter]); | ||
}, [config, loop, pause, playing, setFrame, emitter, inFrame, outFrame]); | ||
(0, react_1.useEffect)(() => { | ||
@@ -60,0 +83,0 @@ const interval = setInterval(() => { |
{ | ||
"name": "@remotion/player", | ||
"version": "2.5.0-alpha.ee579a98", | ||
"version": "3.0.0-lambda.2+a97302554", | ||
"description": "Remotion Player", | ||
@@ -27,3 +27,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"remotion": "2.5.0-alpha.ee579a98" | ||
"remotion": "^3.0.0-lambda.2+a97302554" | ||
}, | ||
@@ -35,13 +35,14 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@jonny/eslint-config": "^2.1.233", | ||
"@jonny/eslint-config": "^2.1.248", | ||
"@testing-library/react": "^11.2.2", | ||
"@types/jest": "^26.0.19", | ||
"@types/jest": "^27.0.2", | ||
"@types/node": "^14.14.14", | ||
"@types/react": "17.0.19", | ||
"@types/react": "17.0.27", | ||
"@types/react-dom": "^17.0.0", | ||
"csstype": "^3.0.9", | ||
"eslint": "^7.4.0", | ||
"jest": "^26.6.3", | ||
"jest": "^27.2.4", | ||
"prettier": "^2.0.5", | ||
"prettier-plugin-organize-imports": "^1.1.1", | ||
"ts-jest": "^26.4.4", | ||
"ts-jest": "^27.0.5", | ||
"typescript": "^4.4.2", | ||
@@ -52,3 +53,4 @@ "webpack": "^5.21.2" | ||
"access": "public" | ||
} | ||
}, | ||
"gitHead": "a97302554ea1cc85a8682345f2ace2c30e4a9e8b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154423
135
1920
14
1
80
1
+ Addedremotion@3.3.103(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreact@17.0.2(transitive)
- Removedreact-dom@17.0.2(transitive)
- Removedremotion@2.5.0-alpha.ee579a98(transitive)
- Removedscheduler@0.20.2(transitive)