You can get the dimensions of videos from expo-image-picker of videos on MediaLibrary.
let result = await ImagePicker.launchImageLibraryAsync({
mediaTypes: ImagePicker.MediaTypeOptions.Videos,
allowsEditing: true, // works on iOS
quality: 1,
base64: true,
});
let videoHeight = result.height;
let videoWidth = result.width;
But since you are using asset files and ImagePicker doesn’t have access to assets, you can hardcode the dimensions beforehand in the code itself, because the asset files are static and don’t change.
This is probably overkill and I have not tried this myself, but you could possibly use FFmpegKit to get the dimensions.
Here’s how you could install it along with the config plugin:
There are some examples here, including some FFprobe ones:
The following Stack overflow answer shows how you can do this on the command line, which I think should give you an idea of how to do it using FFmpegKit: