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 77 - [ ffmpeg.setLogging] ( #ffmpeg-setlogging )
88 - [ ffmpeg.setLogger] ( #ffmpeg-setlogger )
99 - [ ffmpeg.setProgress] ( #ffmpeg-setProgress )
10+ - [ fetchFile] ( #fetch-file )
1011
1112---
1213
@@ -159,3 +160,28 @@ ffmpeg.setProgress(({ ratio }) => {
159160 */
160161});
161162```
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