Skip to content

Commit f2e5c7f

Browse files
committed
revert: remove react-native-fs for audio
1 parent 8fb777a commit f2e5c7f

File tree

4 files changed

+3
-31
lines changed

4 files changed

+3
-31
lines changed

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ PODS:
282282
- React-jsinspector (0.64.1)
283283
- react-native-background-upload (6.2.4):
284284
- React
285-
- react-native-compressor (0.3.5):
285+
- react-native-compressor (0.5.0):
286286
- NextLevelSessionExporter
287287
- React-Core
288288
- react-native-create-thumbnail (1.4.1):
@@ -591,7 +591,7 @@ SPEC CHECKSUMS:
591591
React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9
592592
React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9
593593
react-native-background-upload: b85fac36cfee561c8b3a282e5700e50dc98249c5
594-
react-native-compressor: b812fc2ca45f218c8393a2e9eb7da23f03c1c340
594+
react-native-compressor: 5ae58223e3f002e0141961698dab14741b2c95fe
595595
react-native-create-thumbnail: d31c84dd69fb4d60aec0ff2f49bc0de41ede7b2c
596596
react-native-document-picker: 1a7518132d4a06b67f459be9bb1464a567d2b3b4
597597
react-native-image-picker: 474cf2c33c2b6671da53d293a16c97995f0aec15

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@
5757
"publishConfig": {
5858
"registry": "https://registry.npmjs.org/"
5959
},
60-
"dependencies": {
61-
"react-native-fs": "^2.18.0"
62-
},
6360
"devDependencies": {
6461
"@commitlint/config-conventional": "^11.0.0",
6562
"@react-native-community/eslint-config": "^2.0.0",

src/Audio/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
import { Platform, NativeModules } from 'react-native';
2-
const RNFS = require('react-native-fs');
1+
import { NativeModules } from 'react-native';
32
import {
43
AUDIO_BITRATE,
54
AudioType,
65
DEFAULT_COMPRESS_AUDIO_OPTIONS,
76
defaultResultType,
87
checkUrlAndOptions,
98
} from '../utils';
10-
import { v4 as uuidv4 } from 'uuid';
119
const NativeAudio = NativeModules.Compressor;
1210

1311
const Audio: AudioType = {
1412
compress: async (url, options = DEFAULT_COMPRESS_AUDIO_OPTIONS) => {
15-
if (Platform.OS === 'android' && url.includes('content://')) {
16-
const destPath = `${RNFS.TemporaryDirectoryPath}/${uuidv4()}.mp3`;
17-
await RNFS.copyFile(url, destPath);
18-
url = destPath;
19-
}
2013
try {
2114
const checkUrlAndOptionsResult: defaultResultType =
2215
await checkUrlAndOptions(url, options);

yarn.lock

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,11 +2591,6 @@ balanced-match@^1.0.0:
25912591
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
25922592
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
25932593

2594-
base-64@^0.1.0:
2595-
version "0.1.0"
2596-
resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb"
2597-
integrity sha1-eAqZyE59YAJgNhURxId2E78k9rs=
2598-
25992594
base64-js@^1.1.2, base64-js@^1.3.1, base64-js@^1.5.1:
26002595
version "1.5.1"
26012596
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
@@ -7794,14 +7789,6 @@ react-native-builder-bob@^0.18.0:
77947789
optionalDependencies:
77957790
jetifier "^1.6.6"
77967791

7797-
react-native-fs@^2.18.0:
7798-
version "2.18.0"
7799-
resolved "https://registry.yarnpkg.com/react-native-fs/-/react-native-fs-2.18.0.tgz#987b99cc90518ef26663a8d60e62104694b41c21"
7800-
integrity sha512-9iQhkUNnN2JNED0in06JwZy88YEVyIGKWz4KLlQYxa5Y2U0U2AZh9FUHtA04oWj+xt2LlHh0LFPCzhmNsAsUDg==
7801-
dependencies:
7802-
base-64 "^0.1.0"
7803-
utf8 "^3.0.0"
7804-
78057792
78067793
version "0.63.4"
78077794
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.63.4.tgz#2210fdd404c94a5fa6b423c6de86f8e48810ec36"
@@ -9324,11 +9311,6 @@ use@^3.1.0:
93249311
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
93259312
integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==
93269313

9327-
utf8@^3.0.0:
9328-
version "3.0.0"
9329-
resolved "https://registry.yarnpkg.com/utf8/-/utf8-3.0.0.tgz#f052eed1364d696e769ef058b183df88c87f69d1"
9330-
integrity sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==
9331-
93329314
util-deprecate@^1.0.1, util-deprecate@~1.0.1:
93339315
version "1.0.2"
93349316
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"

0 commit comments

Comments
 (0)