Video compression in composer (#4638)

Co-authored-by: Samuel Newman <10959775+mozzius@users.noreply.github.com>
Co-authored-by: Hailey <me@haileyok.com>
This commit is contained in:
Samuel Newman 2024-07-06 01:50:03 +01:00 committed by GitHub
parent 56b688744e
commit 8f06ba70bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 483 additions and 33 deletions

View file

@ -0,0 +1,27 @@
import React from 'react'
import {View} from 'react-native'
import {CompressedVideo} from '#/lib/media/video/compress'
import {ExternalEmbedRemoveBtn} from 'view/com/composer/ExternalEmbedRemoveBtn'
import {atoms as a} from '#/alf'
export function VideoPreview({
video,
clear,
}: {
video: CompressedVideo
clear: () => void
}) {
return (
<View
style={[
a.w_full,
a.rounded_sm,
{aspectRatio: 16 / 9},
a.overflow_hidden,
]}>
<ExternalEmbedRemoveBtn onRemove={clear} />
<video src={video.uri} style={a.flex_1} autoPlay loop muted playsInline />
</View>
)
}