File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 7
7
- [ ffmpeg.setLogging] ( #ffmpeg-setlogging )
8
8
- [ ffmpeg.setLogger] ( #ffmpeg-setlogger )
9
9
- [ ffmpeg.setProgress] ( #ffmpeg-setProgress )
10
+ - [ fetchFile] ( #fetch-file )
10
11
11
12
---
12
13
@@ -159,3 +160,28 @@ ffmpeg.setProgress(({ ratio }) => {
159
160
*/
160
161
});
161
162
```
163
+
164
+ <a name =" fetch-file " ></a >
165
+
166
+ ### fetchFile(media): Promise
167
+
168
+ Helper function for fetching files from various resource.
169
+
170
+ Sometimes the video/audio file you want to process may located in a remote URL and somewhere in your local file system.
171
+
172
+ This helper function helps you to fetch to file and return an Uint8Array variable for ffmpeg.wasm to consume.
173
+
174
+ ** Arguments**
175
+
176
+ - ` media ` an URL string, base64 string or File, Blob, Buffer object
177
+
178
+ ** Examples:**
179
+
180
+ ``` javascript
181
+ (async () => {
182
+ const data = await fetchFile (' https://github.com/ffmpegwasm/testdata/raw/master/video-3s.avi' );
183
+ /*
184
+ * data will be in Uint8Array format
185
+ */
186
+ })();
187
+ ```
You can’t perform that action at this time.
0 commit comments