gpt4 book ai didi

android - 从 Android 设备库中获取视频 react-native

转载 作者:行者123 更新时间:2023-11-29 01:22:36 26 4
gpt4 key购买 nike

我需要从设备获取视频。我试过:

 const fetchParams = {
first: 25000000,
assetType:'Videos', ->not working, gets only images
};
CameraRoll.getPhotos(fetchParams, this.storeImages, this.logImageError);

但是只有图片,我也试过了:

var options = {
title: 'Select Image',
cancelButtonTitle: 'Cancel',
takePhotoButtonTitle: 'Take Photo...',
chooseFromLibraryButtonTitle: 'Choose from Library...',
mediaType: 'video', // 'photo' or 'video'
videoQuality: 'high', // 'low', 'medium', or 'high'
};
UIImagePickerManager.launchImageLibrary(options, (response) => {}

最佳答案

试试这个:

Intent openGal = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(openGal, REQUEST_CODE);

这将打开您的视频库,以便您可以从中选择一个,然后您可以在 onActivityResult

中获取选定的视频 uri
if (requestCode == 101 && resultCode == RESULT_OK) {
Uri VideoData = data.getData();
}

关于android - 从 Android 设备库中获取视频 react-native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35916275/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com