xgplayer 3.0.1 → 3.0.2
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 +19 -36
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/es/error.d.ts +2 -0
- package/es/error.js +19 -5
- package/es/mediaProxy.d.ts +5 -0
- package/es/mediaProxy.js +3 -0
- package/es/player.js +12 -8
- package/es/plugins/fpsDetect/index.js +1 -1
- package/es/plugins/logger/index.js +1 -1
- package/es/plugins/play/index.js +5 -2
- package/es/plugins/progress/index.js +4 -0
- package/es/plugins/screenShot/index.d.ts +1 -1
- package/es/plugins/screenShot/index.js +33 -6
- package/es/plugins/start/index.d.ts +1 -0
- package/es/plugins/start/index.js +11 -1
- package/es/plugins/track/index.js +14 -8
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.js +3 -0
- package/es/version.js +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/xgplayer" target="_blank">
|
|
6
6
|
<img src="https://img.shields.io/npm/v/xgplayer.svg" alt="npm">
|
|
7
7
|
</a>
|
|
8
|
-
<a href="https://www.npmjs.com/package/xgplayer">
|
|
9
|
-
<img src="https://img.shields.io/npm/dm/xgplaer.svg" alg="download">
|
|
10
|
-
</a>
|
|
11
8
|
<a href="https://www.npmjs.com/package/xgplayer" target="_blank">
|
|
12
9
|
<img src="https://img.shields.io/npm/l/xgplayer.svg" alt="license">
|
|
13
10
|
</a>
|
|
@@ -19,14 +16,14 @@
|
|
|
19
16
|
|
|
20
17
|
### Introduction
|
|
21
18
|
|
|
22
|
-
xgplayer is a web video player library.
|
|
23
|
-
it can be staged loading for that does not support streaming mp4. This means seamless switching with clarity, load control, and video savings. It also integrates on-demand and live support for FLV, HLS, and dash. [Document](http://h5player.bytedance.com/)
|
|
19
|
+
xgplayer is a web video player library. It has designed a separate, detachable UI component based on the principle that everything is componentized. More importantly, it is not only flexible in the UI layer, but also bold in its functionality: it gets rid of video loading, buffering, and format support for video dependence. Especially on mp4
|
|
20
|
+
it can be staged loading for that does not support streaming mp4. This means seamless switching with clarity, load control, and video savings. It also integrates on-demand and live support for FLV, HLS, and dash. [Document](http://h5player.bytedance.com/en/)
|
|
24
21
|
|
|
25
22
|
### Start
|
|
26
23
|
|
|
27
24
|
1. Install
|
|
28
25
|
|
|
29
|
-
```
|
|
26
|
+
```bash
|
|
30
27
|
$ npm install xgplayer
|
|
31
28
|
```
|
|
32
29
|
|
|
@@ -48,51 +45,37 @@ it can be staged loading for that does not support streaming mp4. This means sea
|
|
|
48
45
|
})
|
|
49
46
|
```
|
|
50
47
|
|
|
51
|
-
This is the easiest way to configure the player,then it runs with video. For more advanced content, see the plug-in section or documentation. [more config](http://h5player.bytedance.com/config
|
|
48
|
+
This is the easiest way to configure the player, then it runs with video. For more advanced content, see the plug-in section or documentation. [more config](http://h5player.bytedance.com/en/config/)
|
|
52
49
|
|
|
53
50
|
|
|
54
51
|
|
|
55
52
|
|
|
56
53
|
### Plugins
|
|
57
54
|
|
|
58
|
-
xgplayer provides more plugins
|
|
59
|
-
|
|
60
|
-
The following is how to use a self-starting plug-in:
|
|
61
|
-
|
|
62
|
-
```js
|
|
63
|
-
import Player from 'xgplayer';
|
|
64
|
-
import 'xgplyaer-mp4';
|
|
65
|
-
|
|
66
|
-
const player = new Player({
|
|
67
|
-
id: 'video',
|
|
68
|
-
url: '//abc.com/test.mp4'
|
|
69
|
-
})
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
<code>xgplayer-mp4</code>plugin is self-starting, It loads mp4 video itself, parses mp4 format, implements custom loading, buffering, seamless switching, and so on. it will automatically downgrade devices that do not support [MSE](https://www.w3.org/TR/media-source/). [details](http://h5player.bytedance.com/plugins/#xgplayer-mp4)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Mobile Support
|
|
77
|
-
|
|
78
|
-
xgplayer supports mobile terminal, but android device brand and system are numerous, there are much compatibility problems, the player provides whitelist mechanism to ensure the perfect operation in mobile terminal. [whitelist](http://h5player.bytedance.com/config/#%E7%99%BD%E5%90%8D%E5%8D%95)
|
|
79
|
-
|
|
55
|
+
xgplayer provides more plugins and supports custom plugins, for more content viewing [plugins](http://h5player.bytedance.com/en/plugins/). There are many built-in plugins in the player, if you need to close specific plugins, you can disable them by [ignores](https://h5player.bytedance.com/config/#ignores) configuration
|
|
80
56
|
|
|
81
57
|
|
|
82
58
|
### Dev
|
|
83
59
|
|
|
84
|
-
|
|
60
|
+
In order to debug by developers, we provide demos code in the fixtures directory of the repo. The player uses yarn for package management, and it only takes a few simple steps to start debugging in the repo
|
|
85
61
|
|
|
86
|
-
```
|
|
87
|
-
$ git clone --recurse-submodules -j8 git@github.com:bytedance/xgplayer.git # OR git clone git@github.com:bytedance/xgplayer.git
|
|
62
|
+
```bash
|
|
88
63
|
$ cd xgplayer
|
|
89
|
-
$
|
|
90
|
-
$
|
|
64
|
+
$ yarn
|
|
65
|
+
$ yarn dev:xgplayer
|
|
91
66
|
```
|
|
92
67
|
|
|
93
|
-
please
|
|
68
|
+
To debug other plugins, please refer to the scripts command provided in package.json in the root directory of the repo, such as:
|
|
94
69
|
|
|
70
|
+
```bash
|
|
71
|
+
$ yarn dev:hls
|
|
72
|
+
$ yarn dev:flv
|
|
73
|
+
$ yarn dev:mp4
|
|
74
|
+
```
|
|
95
75
|
|
|
96
76
|
### License
|
|
97
77
|
|
|
98
|
-
|
|
78
|
+
Welcome to use xgplayer! Please read the following terms carefully. Using xgplayer means that you accept and agree to the terms.
|
|
79
|
+
1. Xgplayer is licensed under the [MIT](http://opensource.org/licenses/MIT) License. You comply with its obligations by default.
|
|
80
|
+
2. By default, you authorize us to place your logo in xgplayer website, which using xgplayer.
|
|
81
|
+
If you have any problem, please let us know.
|