rns-mediapicker 0.1.0 โ†’ 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +68 -34
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,40 +1,58 @@
1
- ### rns-mediapicker
1
+ # ๐ŸŽต / ๐Ÿ–ผ๏ธ / ๐ŸŽฅ rns-mediapicker
2
2
 
3
- A high-performance native media picker for React Native and Expo.
4
- Supports audio, image, and video selection from camera or library, automatic JPEG compression, EXIF-safe dimensions, and transparent-image flattening.
3
+ A **high-performance native media picker** for **React Native** and **Expo**.
4
+ Supports **audio, image, and video** selection from **camera or library**, automatic JPEG compression, EXIF-safe dimensions, and transparent-image flattening.
5
5
 
6
6
  ---
7
7
 
8
- ## Installation
8
+ ## ๐Ÿš€ Installation
9
9
 
10
+ Choose any method:
11
+
12
+ ```bash
10
13
  yarn add rns-mediapicker
11
- npx expo install rns-mediapicker
14
+ ```
15
+
16
+ ```bash
12
17
  npm install rns-mediapicker
18
+ ```
19
+
20
+ ```bash
21
+ npx expo install rns-mediapicker
22
+ ```
13
23
 
14
24
  ---
15
25
 
16
- ## Expo Configuration
26
+ ## โš™๏ธ Expo Configuration
17
27
 
18
- Add the plugin to your app.json or app.config.js to automatically configure permissions, intent queries, and FileProvider.
28
+ Add the plugin to your `app.json` or `app.config.js`.
29
+ This automatically configures:
19
30
 
31
+ - iOS permissions (`Info.plist`)
32
+ - Android intent queries
33
+ - Android `FileProvider`
34
+
35
+ ```json
20
36
  {
21
37
  "expo": {
22
38
  "plugins": ["rns-mediapicker"]
23
39
  }
24
40
  }
41
+ ```
25
42
 
26
43
  ---
27
44
 
28
- ## Usage
45
+ ## ๐Ÿง‘โ€๐Ÿ’ป Usage
29
46
 
47
+ ```js
30
48
  import MediaPicker from 'rns-mediapicker';
31
49
 
32
50
  const pickMedia = async () => {
33
51
  try {
34
52
  const result = await MediaPicker.pick(
35
- false,
36
- 'both',
37
- 'back'
53
+ false, // useCamera: true = camera, false = picker
54
+ 'both', // mediaType: 'audio' | 'image' | 'video' | 'both'
55
+ 'back' // env: 'front' | 'back' (camera only)
38
56
  );
39
57
 
40
58
  console.log('URI:', result.uri);
@@ -51,46 +69,62 @@ const pickMedia = async () => {
51
69
  }
52
70
  }
53
71
  };
72
+ ```
54
73
 
55
74
  ---
56
75
 
57
- ## API
76
+ ## ๐Ÿงฉ API Reference
58
77
 
59
- pick(useCamera, mediaType, env)
78
+ ### `pick(useCamera, mediaType, env)`
60
79
 
61
- useCamera (boolean): true opens camera, false opens picker
62
- mediaType (string): 'audio', 'image', 'video', 'both'
63
- env (string): 'front' or 'back' camera (camera only)
80
+ | Parameter | Type | Description |
81
+ |-----------|----------|-------------|
82
+ | useCamera | boolean | `true` opens the camera, `false` opens the media picker |
83
+ | mediaType | string | `'audio'`, `'image'`, `'video'`, or `'both'` |
84
+ | env | string | `'front'` or `'back'` camera (camera mode only) |
64
85
 
65
86
  ---
66
87
 
67
- ## Response Object
88
+ ## ๐Ÿ“ฆ Response Object
68
89
 
90
+ ```js
69
91
  {
70
- uri: string;
71
- width: number;
72
- height: number;
73
- type: string;
74
- isVideo: boolean;
75
- isAudio: boolean;
92
+ uri: string; // Local file URI
93
+ width: number; // Media width (0 for audio)
94
+ height: number; // Media height (0 for audio)
95
+ type: string; // 'image' | 'video' | 'audio'
96
+ isVideo: boolean; // Helper flag
97
+ isAudio: boolean; // Helper flag
76
98
  }
99
+ ```
100
+
101
+ ---
102
+
103
+ ## โœจ Features
104
+
105
+ - ๐ŸŽต Audio / ๐Ÿ–ผ๏ธ Image / ๐ŸŽฅ Video support
106
+ - ๐Ÿ“ท Camera and ๐Ÿ“ Library selection
107
+ - ๐ŸŽฌ Camera video capture (Android & iOS)
108
+ - ๐Ÿ—œ๏ธ Automatic JPEG compression
109
+ - โฌœ White-background flattening for transparent images
110
+ - ๐Ÿ”„ EXIF-safe rotation and accurate dimensions
111
+ - ๐Ÿ“‚ Scoped-storage safe temporary files
112
+ - ๐Ÿค– Android 11+ intent queries handled automatically
113
+ - ๐Ÿ” Android `FileProvider` preconfigured
114
+ - ๐ŸŽ iOS swipe-to-dismiss cancellation handling
115
+ - ๐Ÿงน Clean promise lifecycle (no leaks)
77
116
 
78
117
  ---
79
118
 
80
- ## Features
119
+ ## ๐Ÿ“ Notes
81
120
 
82
- - Audio / Image / Video support
83
- - Camera and Library selection
84
- - Camera video capture (Android & iOS)
85
- - Automatic JPEG compression
86
- - White-background flattening
87
- - EXIF-safe rotation and dimensions
88
- - Scoped-storage safe temp files
89
- - Android FileProvider configured
90
- - iOS swipe-to-dismiss cancellation handling
121
+ - All returned files are copied into the appโ€™s **temporary cache directory**
122
+ - Audio files preserve original encoding
123
+ - Front camera selection is **best-effort** on Android
124
+ - No external native dependencies required
91
125
 
92
126
  ---
93
127
 
94
- ## License
128
+ ## ๐Ÿ“„ License
95
129
 
96
130
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rns-mediapicker",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "High-performance React Native module for picking media on Android and iOS.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",