Skip to content

Commit 0f57925

Browse files
save file
1 parent 03dbe26 commit 0f57925

File tree

1 file changed

+7
-1
lines changed
  • blog/25-11-15/ffmpeg-in-the-browser/ex/mp4box

1 file changed

+7
-1
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11

22
<input id=input type=file><br><br>
33
<script type=module>
4-
import MP4Box from 'https://cdn.jsdelivr.net/npm/mp4box/+esm';
4+
5+
import * as MP4Box from 'https://cdn.jsdelivr.net/npm/mp4box/+esm';
6+
57
input.onchange = async e=>{
8+
69
var buf = await input.files[0].arrayBuffer();
710
buf.fileStart = 0;
811
mp4.appendBuffer(buf);
12+
913
}//onchange
14+
1015
var mp4 = MP4Box.createFile();
1116
mp4.onReady = info=>document.body.append(info.mime+' , '+MediaSource.isTypeSupported(info.mime));
17+
1218
</script>

0 commit comments

Comments
 (0)