Skip to content

Commit 03dbe26

Browse files
save file
1 parent e1cc37c commit 03dbe26

File tree

1 file changed

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

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
<input id=input type=file><br><br>
3+
<script type=module>
4+
import MP4Box from 'https://cdn.jsdelivr.net/npm/mp4box/+esm';
5+
input.onchange = async e=>{
6+
var buf = await input.files[0].arrayBuffer();
7+
buf.fileStart = 0;
8+
mp4.appendBuffer(buf);
9+
}//onchange
10+
var mp4 = MP4Box.createFile();
11+
mp4.onReady = info=>document.body.append(info.mime+' , '+MediaSource.isTypeSupported(info.mime));
12+
</script>

0 commit comments

Comments
 (0)