Created
August 4, 2021 18:57
-
-
Save arthurdenner/679d773c30443d62031ae385517e84dc to your computer and use it in GitHub Desktop.
Remotion - Video duration bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place the code below in the file below to reproduce it: | |
// https://github.com/remotion-dev/remotion/blob/main/packages/example/src/RemoteVideo/index.tsx | |
import {useRef} from 'react'; | |
import {interpolate, useCurrentFrame, Video} from 'remotion'; | |
const RemoteVideo: React.FC = () => { | |
const frame = useCurrentFrame(); | |
const ref = useRef<HTMLVideoElement>(null); | |
return ( | |
<Video | |
ref={ref} | |
volume={interpolate(frame, [0, 500], [1, 0], {extrapolateRight: 'clamp'})} | |
crossOrigin="anonymous" | |
src="https://iandevlin.github.io/mdn/video-player-with-captions/video/sintel-short.mp4" | |
startFrom={600} | |
/> | |
); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place the code below in the file below to reproduce it: | |
// https://github.com/remotion-dev/remotion/blob/main/packages/example/src/Video.tsx | |
import React from 'react'; | |
import {Composition} from 'remotion'; | |
import RemoteVideo from './RemoteVideo'; | |
export const Index: React.FC = () => { | |
return ( | |
<Composition | |
id="remote-video" | |
component={RemoteVideo} | |
width={1280} | |
height={720} | |
fps={30} | |
durationInFrames={600} | |
/> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment