xgplayer-mp3 3.0.27 → 3.0.28-rc.1

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 CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  English | [简体中文](./README.zh-CN.md)
4
4
 
5
- `xgplayer-mp3` is an xgplayer streaming plugin for standalone MP3 files. It
6
- loads data on demand with HTTP Range requests and provides MSE-based seeking
7
- for CBR and indexed VBR files. When the runtime or input is unsupported, the
8
- plugin falls back to native `<audio>` playback by default.
5
+ `xgplayer-mp3` is an MSE streaming plugin for xgplayer that loads standalone
6
+ MP3 files on demand. It uses HTTP Range requests and provides MSE-based seeking
7
+ for CBR and indexed VBR files. When the runtime or input is unsupported, it
8
+ falls back to native `<audio>` handling by default.
9
9
 
10
10
  ## Installation
11
11
 
@@ -13,12 +13,6 @@ plugin falls back to native `<audio>` playback by default.
13
13
  npm install xgplayer xgplayer-mp3
14
14
  ```
15
15
 
16
- Or:
17
-
18
- ```bash
19
- yarn add xgplayer xgplayer-mp3
20
- ```
21
-
22
16
  ## Basic usage
23
17
 
24
18
  ```html
@@ -56,12 +50,12 @@ Access-Control-Expose-Headers: Content-Range, Content-Length, Accept-Ranges
56
50
  ```
57
51
 
58
52
  If the server ignores the Range header and returns the complete file with
59
- `200`, playback still works, but the entire file is downloaded and retained in
60
- memory.
53
+ `200`, the file still loads, but the entire response is downloaded and retained
54
+ in memory.
61
55
 
62
56
  For a `206` response, JavaScript must be able to read a `Content-Range` header
63
57
  that contains the complete file size. Otherwise, the plugin falls back to
64
- native playback.
58
+ native audio handling.
65
59
 
66
60
  ## Configuration
67
61
 
@@ -92,7 +86,7 @@ Common options:
92
86
  | `retryDelay` | `1000` | Delay between retries, in milliseconds |
93
87
  | `timeout` | `5000` | Timeout for one network request, in milliseconds |
94
88
  | `reqOptions` | `null` | Request options such as method, headers, and credentials |
95
- | `closeDowngrade` | `false` | Disable fallback to native playback after a fatal plugin error |
89
+ | `closeDowngrade` | `false` | Disable fallback to native audio after a fatal plugin error |
96
90
 
97
91
  Advanced options:
98
92
 
@@ -141,7 +135,7 @@ if (MP3Plugin.isSupported()) {
141
135
  ```
142
136
 
143
137
  Manual detection is usually unnecessary. The plugin restores the original URL
144
- and playback state, then delegates to native `<audio>` playback when:
138
+ and media state, then delegates to native `<audio>` when:
145
139
 
146
140
  - The runtime does not support `audio/mpeg` MSE.
147
141
  - The file is unsupported or has no reliable seek mapping.
@@ -176,10 +170,10 @@ families such as MPEG-4.
176
170
 
177
171
  ## How it works
178
172
 
179
- ![xgplayer-mp3 playback pipeline](./docs/mp3-mse-flow.svg)
173
+ ![xgplayer-mp3 streaming pipeline](./docs/mp3-mse-flow.svg)
180
174
 
181
175
  The plugin probes ID3 data, MP3 frames, and Xing/Info/VBRI indexes. It then maps
182
- playback time to byte positions and loads frame-aligned data through HTTP Range
176
+ media time to byte positions and loads frame-aligned data through HTTP Range
183
177
  requests.
184
178
 
185
179
  `xgplayer-mp3` follows the
@@ -197,5 +191,5 @@ Fatal errors are reported through the `playCatch` event:
197
191
  | `MP3_1` | Before the first data append completes |
198
192
  | `MP3_2` | After the first data append completes |
199
193
 
200
- With the default configuration, the plugin proceeds with native playback
201
- fallback after emitting the event.
194
+ With the default configuration, the plugin proceeds with native fallback after
195
+ emitting the event.
package/README.zh-CN.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [English](./README.md) | 简体中文
4
4
 
5
- `xgplayer-mp3` 是面向独立 MP3 文件的 xgplayer 流式播放插件。它通过 HTTP
6
- Range 按需加载,并为 CBR 和带索引的 VBR 文件提供基于 MSE 的 seek 能力。
7
- 当运行环境或文件不满足要求时,默认交由浏览器原生 `<audio>` 播放。
5
+ `xgplayer-mp3` 是面向 xgplayer 的 MSE 流式插件,用于按需加载独立 MP3 文件。
6
+ 它通过 HTTP Range 加载,并为 CBR 和带索引的 VBR 文件提供基于 MSE 的 seek 能力。
7
+ 当运行环境或文件不满足要求时,默认交由浏览器原生 `<audio>` 处理。
8
8
 
9
9
  ## 安装
10
10
 
@@ -12,12 +12,6 @@ Range 按需加载,并为 CBR 和带索引的 VBR 文件提供基于 MSE 的 s
12
12
  npm install xgplayer xgplayer-mp3
13
13
  ```
14
14
 
15
- 或者:
16
-
17
- ```bash
18
- yarn add xgplayer xgplayer-mp3
19
- ```
20
-
21
15
  ## 基础用法
22
16
 
23
17
  ```html
@@ -167,7 +161,7 @@ MPEG Audio Version 与 Layer 是两个独立维度:
167
161
 
168
162
  ## 工作原理
169
163
 
170
- ![xgplayer-mp3 playback pipeline](./docs/mp3-mse-flow.svg)
164
+ ![xgplayer-mp3 streaming pipeline](./docs/mp3-mse-flow.svg)
171
165
 
172
166
  插件首先探测 ID3、MP3 帧和 Xing/Info/VBRI 索引,再将播放时间映射到文件字节
173
167
  位置,通过 HTTP Range 加载帧对齐的数据。