Commit 98e93870 authored by 少言's avatar 少言

fix iOS 视频size

change 安卓包名
parent 86a93d38
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reactlibrary">
package="com.syanpicker">
<application>
</application>
......
package com.reactlibrary;
package com.syanpicker;
import android.app.Activity;
import android.content.Intent;
......
package com.reactlibrary;
package com.syanpicker;
import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
......
......@@ -95,9 +95,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
}
- (void)openTZImagePicker:(NSDictionary *)options callback:(RCTResponseSenderBlock)callback {
// 照片最大可选张数
NSInteger imageCount = [options sy_integerForKey:@"imageCount"];
// 显示内部拍照按钮
BOOL isCamera = [options sy_boolForKey:@"isCamera"];
BOOL isCrop = [options sy_boolForKey:@"isCrop"];
BOOL allowPickingGif = [options sy_boolForKey:@"allowPickingGif"];
......@@ -158,8 +156,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
NSMutableDictionary *video = [NSMutableDictionary dictionary];
video[@"uri"] = outputPath;
video[@"fileName"] = [asset valueForKey:@"filename"];
PHAssetResource *resource = [[PHAssetResource assetResourcesForAsset:asset] firstObject];
long long size = [[resource valueForKey:@"fileSize"] longLongValue];
NSInteger size = [[NSFileManager defaultManager] attributesOfItemAtPath:outputPath error:nil].fileSize;
video[@"size"] = @(size);
if (asset.mediaType == PHAssetMediaTypeVideo) {
video[@"type"] = @"video";
......@@ -194,8 +191,7 @@ RCT_EXPORT_METHOD(openVideoPicker:(NSDictionary *)options callback:(RCTResponseS
NSMutableDictionary *video = [NSMutableDictionary dictionary];
video[@"uri"] = outputPath;
video[@"fileName"] = [asset valueForKey:@"filename"];
PHAssetResource *resource = [[PHAssetResource assetResourcesForAsset:asset] firstObject];
long long size = [[resource valueForKey:@"fileSize"] longLongValue];
NSInteger size = [[NSFileManager defaultManager] attributesOfItemAtPath:outputPath error:nil].fileSize;
video[@"size"] = @(size);
if (asset.mediaType == PHAssetMediaTypeVideo) {
video[@"type"] = @"video";
......
{
"name": "react-native-syan-image-picker",
"version": "0.3.3",
"version": "0.3.4",
"description": "React-Native 多图片选择 支持裁剪 压缩",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment