xgplayer-mp4 3.0.0-next.3 → 3.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +481 -1
- package/es/error.d.ts +40 -4
- package/es/error.js +77 -8
- package/es/index.d.ts +1 -2
- package/es/index.js +0 -1
- package/es/mp4.d.ts +103 -68
- package/es/mp4.js +874 -525
- package/es/mp4Plugin.d.ts +100 -39
- package/es/mp4Plugin.js +869 -290
- package/es/util/index.d.ts +2 -43
- package/es/util/index.js +54 -166
- package/es/util/logger.d.ts +5 -0
- package/es/util/logger.js +53 -0
- package/es/util/timer.d.ts +8 -0
- package/es/util/timer.js +50 -0
- package/es/version.d.ts +2 -0
- package/es/version.js +2 -0
- package/es/worker/index.d.ts +10 -0
- package/es/worker/index.js +63 -0
- package/es/worker/transmuxerworker.js +21 -0
- package/package.json +7 -3
- package/es/fmp4/buffer.d.ts +0 -6
- package/es/fmp4/buffer.js +0 -23
- package/es/fmp4/m4a.d.ts +0 -42
- package/es/fmp4/m4a.js +0 -928
- package/es/fmp4/mp4.d.ts +0 -42
- package/es/fmp4/mp4.js +0 -948
- package/es/m4a.d.ts +0 -61
- package/es/m4a.js +0 -583
- package/es/m4aPlugin.d.ts +0 -48
- package/es/m4aPlugin.js +0 -385
- package/es/media/mse.d.ts +0 -17
- package/es/media/mse.js +0 -75
- package/es/media/task.d.ts +0 -19
- package/es/media/task.js +0 -103
- package/es/parse/box.d.ts +0 -17
- package/es/parse/box.js +0 -69
- package/es/parse/boxParse/MP4DecConfigDescrTag.d.ts +0 -2
- package/es/parse/boxParse/MP4DecConfigDescrTag.js +0 -25
- package/es/parse/boxParse/MP4DecSpecificDescrTag.d.ts +0 -2
- package/es/parse/boxParse/MP4DecSpecificDescrTag.js +0 -25
- package/es/parse/boxParse/MP4ESDescrTag.d.ts +0 -2
- package/es/parse/boxParse/MP4ESDescrTag.js +0 -23
- package/es/parse/boxParse/SLConfigDescriptor.d.ts +0 -2
- package/es/parse/boxParse/SLConfigDescriptor.js +0 -19
- package/es/parse/boxParse/avc1.d.ts +0 -10
- package/es/parse/boxParse/avc1.js +0 -30
- package/es/parse/boxParse/avcC.d.ts +0 -15
- package/es/parse/boxParse/avcC.js +0 -35
- package/es/parse/boxParse/btrt.d.ts +0 -6
- package/es/parse/boxParse/btrt.js +0 -11
- package/es/parse/boxParse/co64.d.ts +0 -7
- package/es/parse/boxParse/co64.js +0 -16
- package/es/parse/boxParse/ctts.d.ts +0 -7
- package/es/parse/boxParse/ctts.js +0 -19
- package/es/parse/boxParse/dref.d.ts +0 -6
- package/es/parse/boxParse/dref.js +0 -18
- package/es/parse/boxParse/elst.d.ts +0 -8
- package/es/parse/boxParse/elst.js +0 -35
- package/es/parse/boxParse/esds.d.ts +0 -5
- package/es/parse/boxParse/esds.js +0 -12
- package/es/parse/boxParse/ftyp.d.ts +0 -6
- package/es/parse/boxParse/ftyp.js +0 -15
- package/es/parse/boxParse/hdlr.d.ts +0 -7
- package/es/parse/boxParse/hdlr.js +0 -18
- package/es/parse/boxParse/hmhd.d.ts +0 -0
- package/es/parse/boxParse/index.d.ts +0 -32
- package/es/parse/boxParse/index.js +0 -31
- package/es/parse/boxParse/iods.d.ts +0 -6
- package/es/parse/boxParse/iods.js +0 -16
- package/es/parse/boxParse/mdat.d.ts +0 -1
- package/es/parse/boxParse/mdat.js +0 -4
- package/es/parse/boxParse/mdhd.d.ts +0 -12
- package/es/parse/boxParse/mdhd.js +0 -28
- package/es/parse/boxParse/mfhd.d.ts +0 -0
- package/es/parse/boxParse/mp4a.d.ts +0 -7
- package/es/parse/boxParse/mp4a.js +0 -19
- package/es/parse/boxParse/mvhd.d.ts +0 -15
- package/es/parse/boxParse/mvhd.js +0 -27
- package/es/parse/boxParse/nmhd.d.ts +0 -0
- package/es/parse/boxParse/pasp.d.ts +0 -4
- package/es/parse/boxParse/pasp.js +0 -9
- package/es/parse/boxParse/sbgp.d.ts +0 -0
- package/es/parse/boxParse/sdtp.d.ts +0 -0
- package/es/parse/boxParse/smhd.d.ts +0 -6
- package/es/parse/boxParse/smhd.js +0 -11
- package/es/parse/boxParse/stco.d.ts +0 -7
- package/es/parse/boxParse/stco.js +0 -16
- package/es/parse/boxParse/stsc.d.ts +0 -7
- package/es/parse/boxParse/stsc.js +0 -36
- package/es/parse/boxParse/stsd.d.ts +0 -6
- package/es/parse/boxParse/stsd.js +0 -15
- package/es/parse/boxParse/stsh.d.ts +0 -0
- package/es/parse/boxParse/stss.d.ts +0 -7
- package/es/parse/boxParse/stss.js +0 -16
- package/es/parse/boxParse/stsz.d.ts +0 -8
- package/es/parse/boxParse/stsz.js +0 -17
- package/es/parse/boxParse/stts.d.ts +0 -10
- package/es/parse/boxParse/stts.js +0 -19
- package/es/parse/boxParse/stz2.d.ts +0 -0
- package/es/parse/boxParse/tfhd.d.ts +0 -0
- package/es/parse/boxParse/tkhd.d.ts +0 -18
- package/es/parse/boxParse/tkhd.js +0 -40
- package/es/parse/boxParse/traf.d.ts +0 -0
- package/es/parse/boxParse/trun.d.ts +0 -0
- package/es/parse/boxParse/udta.d.ts +0 -1
- package/es/parse/boxParse/udta.js +0 -4
- package/es/parse/boxParse/url.d.ts +0 -6
- package/es/parse/boxParse/url.js +0 -16
- package/es/parse/boxParse/vmhd.d.ts +0 -7
- package/es/parse/boxParse/vmhd.js +0 -12
- package/es/parse/date.d.ts +0 -5
- package/es/parse/date.js +0 -17
- package/es/parse/index.d.ts +0 -8
- package/es/parse/index.js +0 -44
- package/es/parse/stream.d.ts +0 -23
- package/es/parse/stream.js +0 -106
- package/es/write/box/MP4DecConfigDescrTag.d.ts +0 -1
- package/es/write/box/MP4DecSpecificDescrTag.d.ts +0 -1
- package/es/write/box/MP4ESDescrTag.d.ts +0 -1
- package/es/write/box/SLConfigDescriptor.d.ts +0 -1
- package/es/write/box/avc1.d.ts +0 -1
- package/es/write/box/avcC.d.ts +0 -1
- package/es/write/box/btrt.d.ts +0 -1
- package/es/write/box/co64.d.ts +0 -1
- package/es/write/box/ctts.d.ts +0 -1
- package/es/write/box/dref.d.ts +0 -1
- package/es/write/box/elst.d.ts +0 -1
- package/es/write/box/esds.d.ts +0 -1
- package/es/write/box/ftyp.d.ts +0 -1
- package/es/write/box/hdlr.d.ts +0 -1
- package/es/write/box/iods.d.ts +0 -1
- package/es/write/box/mdat.d.ts +0 -1
- package/es/write/box/mdhd.d.ts +0 -1
- package/es/write/box/mehd.d.ts +0 -1
- package/es/write/box/mfhd.d.ts +0 -1
- package/es/write/box/mfro.d.ts +0 -1
- package/es/write/box/mp4a.d.ts +0 -1
- package/es/write/box/mvhd.d.ts +0 -1
- package/es/write/box/pasp.d.ts +0 -1
- package/es/write/box/smhd.d.ts +0 -1
- package/es/write/box/stco.d.ts +0 -1
- package/es/write/box/stsc.d.ts +0 -1
- package/es/write/box/stsd.d.ts +0 -1
- package/es/write/box/stss.d.ts +0 -1
- package/es/write/box/stsz.d.ts +0 -1
- package/es/write/box/stts.d.ts +0 -1
- package/es/write/box/tfdt.d.ts +0 -1
- package/es/write/box/tfhd.d.ts +0 -1
- package/es/write/box/tfra.d.ts +0 -1
- package/es/write/box/tkhd.d.ts +0 -1
- package/es/write/box/trex.d.ts +0 -1
- package/es/write/box/trun.d.ts +0 -1
- package/es/write/box/udta.d.ts +0 -1
- package/es/write/box/url.d.ts +0 -1
- package/es/write/box/vmhd.d.ts +0 -1
- package/es/write/box/wide.d.ts +0 -1
- package/es/write/box.d.ts +0 -15
- package/es/write/buffer.d.ts +0 -5
- package/es/write/index.d.ts +0 -5
- package/es/write/stream.d.ts +0 -20
- /package/es/{index_backup.d.ts → worker/transmuxerworker.d.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# xgplayer-mp4
|
|
2
|
+
|
|
3
|
+
## 简介
|
|
4
|
+
|
|
5
|
+
xgplayer-mp4模块基于MSE方式实现mp4的播放控制。
|
|
6
|
+
|
|
7
|
+
### MP4播放
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
import Player from "xgplayer"
|
|
11
|
+
import Mp4Plugin from "xgplayer-mp4"
|
|
12
|
+
import "xgplayer/dist/xgplayer.min.css"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const player = new Player({
|
|
17
|
+
url,
|
|
18
|
+
id,
|
|
19
|
+
autoplay: true,
|
|
20
|
+
height: window.innerHeight,
|
|
21
|
+
width: window.innerWidth,
|
|
22
|
+
plugins: [Mp4Plugin],
|
|
23
|
+
mp4plugin: {
|
|
24
|
+
maxBufferLength: 30,
|
|
25
|
+
minBufferLength: 10,
|
|
26
|
+
reqOptions:{
|
|
27
|
+
mode: 'cors',
|
|
28
|
+
method: 'POST',
|
|
29
|
+
headers: { // 需要带的自定义请求头
|
|
30
|
+
'x-test-header': 'rrrr'
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
// ... 其他配置
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
player.on('canplay', ()=>{
|
|
38
|
+
// do something
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
可配置的能力
|
|
45
|
+
|
|
46
|
+
| 配置字段 | 默认值 | 含义 |
|
|
47
|
+
| ------ | -------- | ----- |
|
|
48
|
+
| maxBufferLength | 40 | 播放的最大的buffer长度(s) |
|
|
49
|
+
| minBufferLength | 5 | 播放的最小的buffer长度(s)|
|
|
50
|
+
| disableBufferBreakCheck | false | 是否开启卡顿超时检测 |
|
|
51
|
+
| waitingTimeOut | 15s | 卡顿超时时间 |
|
|
52
|
+
| waitingInBufferTimeOut | 5s | 在buffer区间内的卡顿超时时间 |
|
|
53
|
+
| waitJampBufferMaxCnt | 3 | 一次播放中在buffer区间内卡顿超时最多可以seek调整几次 |
|
|
54
|
+
| chunkSize | 15625 | 第一次请求的数据的size长度 |
|
|
55
|
+
| tickInSeconds | 0.1 | 驱动下载的timer的时间间隔 |
|
|
56
|
+
| segmentDuration | 5s | 一次下载数据的最小视频时长|
|
|
57
|
+
| onProcessMinLen | 1024 | fetch每次回调数据的最小长度|
|
|
58
|
+
| retryCount | 2 | loader请求失败时的重试次数 |
|
|
59
|
+
| retryDelay | 1000 | 重试的时间间隔(ms) |
|
|
60
|
+
| timeout | 3000 | loader请求的超时时间(ms) |
|
|
61
|
+
| enableWorker | false | transmux是否使用worker|
|
|
62
|
+
|