Skip to content

Instantly share code, notes, and snippets.

@iha2
Last active August 12, 2018 21:27
Show Gist options
  • Save iha2/72c56d5ef19eb2fb5564d0366b1d1aaa to your computer and use it in GitHub Desktop.
Save iha2/72c56d5ef19eb2fb5564d0366b1d1aaa to your computer and use it in GitHub Desktop.
A React component made to host a video element drawn on a canvas
<React.Fragment>
<video
ref={(videoElementRef: HTMLVideoElement) =>
(videoElement = videoElementRef)
}
autoPlay={true}
playsInline={true}
muted={true}
style={{ visibility: 'hidden', position: 'fixed' }}
/>
<canvas
ref={(canvasElementRef: HTMLCanvasElement) =>
(canvasElement = canvasElementRef)
}
/>
</React.Fragment>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment