imagekit-react icon indicating copy to clipboard operation
imagekit-react copied to clipboard

Video support?

Open VityaSchel opened this issue 2 years ago • 1 comments

VityaSchel avatar Apr 16 '22 05:04 VityaSchel

I contacted them and they said it hasn't been added yet. Here's a very simple version I wrote for myself using some of their libraries:

type IKVideoProps = {
	path: string;
	t: Transformation;
};

function IKVideo({ path, t }: IKVideoProps) {
	const ikClient = useMemo(() => {
		return new ImageKit({
			urlEndpoint: ImageKitEndpoint,
			transformationPosition: "query",
		});
	}, []);
	const videoURL = ikClient.url({
		path,
		transformation: [t],
	});
	return (
		<video controls width={t.width} height={t.height}>
			<source src={videoURL} type="video/mp4" />
		</video>
	);
}

pip8786 avatar May 20 '22 20:05 pip8786

Added in version 2.0.0 - https://github.com/imagekit-developer/imagekit-react#video-resizing

imagekitio avatar Sep 29 '22 09:09 imagekitio