react-native-compressor 1.5.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,18 @@
1
1
  ### Would you like to support me?
2
2
 
3
3
  <div align="center">
4
- <a href="https://github.com/nomi9995?tab=followers">
5
- <img src="https://img.shields.io/github/followers/nomi9995?label=Follow%20%40nomi9995&style=social" />
4
+ <a href="https://github.com/numandev1?tab=followers">
5
+ <img src="https://img.shields.io/github/followers/numandev1?label=Follow%20%40numandev1&style=social" height="36" />
6
6
  </a>
7
+ <a href="https://www.youtube.com/channel/UCYCUspfN7ZevgCj3W5GlFAw"><img src="https://img.shields.io/youtube/channel/subscribers/UCYCUspfN7ZevgCj3W5GlFAw?style=social" height="36" /><a/>
7
8
  </br>
8
9
  <a href="https://www.buymeacoffee.com/numan.dev" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
9
10
  </div>
10
11
 
11
12
  ---
12
13
 
13
-
14
-
15
14
  # react-native-compressor
16
15
 
17
- <!-- Title -->
18
- <p align="center">
19
- <img src="/media/icon.png" alt="alt text" width="150"/>
20
- </p>
21
-
22
16
  <!-- Header -->
23
17
 
24
18
  <p align="center">
@@ -35,32 +29,34 @@
35
29
  **If you find this package useful hit the star** 🌟
36
30
 
37
31
  # Table of Contents
32
+
38
33
  <details>
39
34
  <summary>Open Table of Contents</summary>
40
35
 
41
- * [Installation](#installation)
42
- + [For React Native](#react-native)
43
- - [For React Native<0.65](#for-react-native065)
44
- - [For React Native 0.65 or greater](#for-react-native-065-or-greater)
45
- + [Managed Expo](#managed-expo)
46
- * [Usage](#usage)
47
- + [Image](#image)
48
- * [Automatic Image Compression Like Whatsapp](#automatic-image-compression-like-whatsapp)
49
- * [Manual Image Compression](#manual-image-compression)
50
- * [ImageCompressor API Docs](#imagecompressor)
51
- + [Video](#video)
52
- * [Automatic Video Compression Like Whatsapp](#automatic-video-compression-like-whatsapp)
53
- * [Manual Video Compression](#manual-video-compression)
54
- * [Cancel Video Compression](#cancel-video-compression)
55
- * [Video Api Docs](#video-1)
56
- + [Audio](#audio)
57
- + [Background Upload](#background-upload)
58
- - [Other Utilities](#api)
59
- * [Background Upload](#background-upload-1)
60
- * [Get Metadata Of Video](#get-metadata-of-video)
61
- * [Get Real Path](#get-real-path)
62
- * [Get Temp file Path](#get-temp-file-path)
63
- </details>
36
+ - [Installation](#installation)
37
+ - [For React Native](#react-native)
38
+ - [For React Native<0.65](#for-react-native065)
39
+ - [For React Native 0.65 or greater](#for-react-native-065-or-greater)
40
+ - [Managed Expo](#managed-expo)
41
+ - [Usage](#usage)
42
+ - [Image](#image)
43
+ - [Automatic Image Compression Like Whatsapp](#automatic-image-compression-like-whatsapp)
44
+ - [Manual Image Compression](#manual-image-compression)
45
+ - [ImageCompressor API Docs](#imagecompressor)
46
+ - [Video](#video)
47
+ - [Automatic Video Compression Like Whatsapp](#automatic-video-compression-like-whatsapp)
48
+ - [Manual Video Compression](#manual-video-compression)
49
+ - [Cancel Video Compression](#cancel-video-compression)
50
+ - [Video Api Docs](#video-1)
51
+ - [Audio](#audio)
52
+ - [Background Upload](#background-upload)
53
+
54
+ * [Other Utilities](#api)
55
+ - [Background Upload](#background-upload-1)
56
+ - [Get Metadata Of Video](#get-metadata-of-video)
57
+ - [Get Real Path](#get-real-path)
58
+ - [Get Temp file Path](#get-temp-file-path)
59
+ </details>
64
60
 
65
61
  ## Installation
66
62
 
@@ -18,11 +18,11 @@ def safeExtGet(prop, fallback) {
18
18
  }
19
19
 
20
20
  android {
21
- compileSdkVersion safeExtGet('Compressor_compileSdkVersion', 29)
22
- buildToolsVersion safeExtGet('Compressor_buildToolsVersion', '29.0.2')
21
+ compileSdkVersion safeExtGet('compileSdkVersion', 29)
22
+ buildToolsVersion safeExtGet('buildToolsVersion', '29.0.2')
23
23
  defaultConfig {
24
- minSdkVersion safeExtGet('Compressor_minSdkVersion', 16)
25
- targetSdkVersion safeExtGet('Compressor_targetSdkVersion', 29)
24
+ minSdkVersion safeExtGet('minSdkVersion', 16)
25
+ targetSdkVersion safeExtGet('targetSdkVersion', 29)
26
26
  versionCode 1
27
27
  versionName "1.0"
28
28
 
@@ -57,6 +57,6 @@ dependencies {
57
57
  //noinspection GradleDynamicVersion
58
58
  implementation "com.facebook.react:react-native:+" // From node_modules
59
59
  implementation 'io.github.lizhangqu:coreprogress:1.0.2'
60
- implementation 'com.github.nomi9995:VideoCompressor:715bcc16e9'
60
+ implementation 'com.github.numandev1:VideoCompressor:715bcc16e9'
61
61
  // implementation project(path: ':videocompressor')
62
62
  }
@@ -137,6 +137,7 @@ public class CompressorModule extends ReactContextBaseJavaModule {
137
137
  int actualHeight =Integer.parseInt(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
138
138
  int actualWidth = Integer.parseInt(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
139
139
  long duration = Long.parseLong(metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION));
140
+ String creationTime = metaRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DATE)
140
141
  String extension = filePath.substring(filePath.lastIndexOf(".")+1);
141
142
 
142
143
  WritableMap params = Arguments.createMap();
@@ -145,6 +146,7 @@ public class CompressorModule extends ReactContextBaseJavaModule {
145
146
  params.putString("height", String.valueOf(actualHeight));
146
147
  params.putString("duration", String.valueOf(duration/1000));
147
148
  params.putString("extension", extension);
149
+ params.putString("creationTime", String.valueOf(creationTime));
148
150
 
149
151
  promise.resolve(params);
150
152
  } catch (Exception e) {
@@ -400,17 +400,8 @@ func makeValidUri(filePath: String) -> String {
400
400
  }
401
401
 
402
402
  func getVideoTrack(asset: AVAsset) -> AVAssetTrack {
403
- var videoTrackIndex: Int = 0;
404
- let trackLength = asset.tracks.count;
405
- if(trackLength==2)
406
- {
407
- if(asset.tracks[0].mediaType.rawValue=="soun")
408
- {
409
- videoTrackIndex=1;
410
- }
411
- }
412
- let track = asset.tracks[videoTrackIndex];
413
- return track;
403
+ let tracks = asset.tracks(withMediaType: AVMediaType.video)
404
+ return tracks[0];
414
405
  }
415
406
 
416
407
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-compressor",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "This library compress image, video and audio",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
package/android/.DS_Store DELETED
Binary file
File without changes
@@ -1,3 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
Binary file
Binary file
Binary file
Binary file
package/ios/.DS_Store DELETED
Binary file
Binary file
Binary file