xgplayer 3.0.12 → 3.0.13

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.
@@ -0,0 +1,91 @@
1
+ declare namespace _default {
2
+ const LANG: string;
3
+ namespace TEXT {
4
+ namespace ERROR_TYPES {
5
+ namespace network {
6
+ const code: number;
7
+ const msg: string;
8
+ }
9
+ namespace mse {
10
+ const code_1: number;
11
+ export { code_1 as code };
12
+ const msg_1: string;
13
+ export { msg_1 as msg };
14
+ }
15
+ namespace parse {
16
+ const code_2: number;
17
+ export { code_2 as code };
18
+ const msg_2: string;
19
+ export { msg_2 as msg };
20
+ }
21
+ namespace format {
22
+ const code_3: number;
23
+ export { code_3 as code };
24
+ const msg_3: string;
25
+ export { msg_3 as msg };
26
+ }
27
+ namespace decoder {
28
+ const code_4: number;
29
+ export { code_4 as code };
30
+ const msg_4: string;
31
+ export { msg_4 as msg };
32
+ }
33
+ namespace runtime {
34
+ const code_5: number;
35
+ export { code_5 as code };
36
+ const msg_5: string;
37
+ export { msg_5 as msg };
38
+ }
39
+ namespace timeout {
40
+ const code_6: number;
41
+ export { code_6 as code };
42
+ const msg_6: string;
43
+ export { msg_6 as msg };
44
+ }
45
+ namespace other {
46
+ const code_7: number;
47
+ export { code_7 as code };
48
+ const msg_7: string;
49
+ export { msg_7 as msg };
50
+ }
51
+ }
52
+ const HAVE_NOTHING: string;
53
+ const HAVE_METADATA: string;
54
+ const HAVE_CURRENT_DATA: string;
55
+ const HAVE_FUTURE_DATA: string;
56
+ const HAVE_ENOUGH_DATA: string;
57
+ const NETWORK_EMPTY: string;
58
+ const NETWORK_IDLE: string;
59
+ const NETWORK_LOADING: string;
60
+ const NETWORK_NO_SOURCE: string;
61
+ const MEDIA_ERR_ABORTED: string;
62
+ const MEDIA_ERR_NETWORK: string;
63
+ const MEDIA_ERR_DECODE: string;
64
+ const MEDIA_ERR_SRC_NOT_SUPPORTED: string;
65
+ const REPLAY: string;
66
+ const ERROR: string;
67
+ const PLAY_TIPS: string;
68
+ const PAUSE_TIPS: string;
69
+ const PLAYNEXT_TIPS: string;
70
+ const DOWNLOAD_TIPS: string;
71
+ const ROTATE_TIPS: string;
72
+ const RELOAD_TIPS: string;
73
+ const FULLSCREEN_TIPS: string;
74
+ const EXITFULLSCREEN_TIPS: string;
75
+ const CSSFULLSCREEN_TIPS: string;
76
+ const EXITCSSFULLSCREEN_TIPS: string;
77
+ const TEXTTRACK: string;
78
+ const PIP: string;
79
+ const SCREENSHOT: string;
80
+ const LIVE: string;
81
+ const OFF: string;
82
+ const OPEN: string;
83
+ const MINI_DRAG: string;
84
+ const MINISCREEN: string;
85
+ const REFRESH_TIPS: string;
86
+ const REFRESH: string;
87
+ const FORWARD: string;
88
+ const LIVE_TIP: string;
89
+ }
90
+ }
91
+ export default _default;
@@ -0,0 +1,91 @@
1
+ declare namespace _default {
2
+ const LANG: string;
3
+ namespace TEXT {
4
+ namespace ERROR_TYPES {
5
+ namespace network {
6
+ const code: number;
7
+ const msg: string;
8
+ }
9
+ namespace mse {
10
+ const code_1: number;
11
+ export { code_1 as code };
12
+ const msg_1: string;
13
+ export { msg_1 as msg };
14
+ }
15
+ namespace parse {
16
+ const code_2: number;
17
+ export { code_2 as code };
18
+ const msg_2: string;
19
+ export { msg_2 as msg };
20
+ }
21
+ namespace format {
22
+ const code_3: number;
23
+ export { code_3 as code };
24
+ const msg_3: string;
25
+ export { msg_3 as msg };
26
+ }
27
+ namespace decoder {
28
+ const code_4: number;
29
+ export { code_4 as code };
30
+ const msg_4: string;
31
+ export { msg_4 as msg };
32
+ }
33
+ namespace runtime {
34
+ const code_5: number;
35
+ export { code_5 as code };
36
+ const msg_5: string;
37
+ export { msg_5 as msg };
38
+ }
39
+ namespace timeout {
40
+ const code_6: number;
41
+ export { code_6 as code };
42
+ const msg_6: string;
43
+ export { msg_6 as msg };
44
+ }
45
+ namespace other {
46
+ const code_7: number;
47
+ export { code_7 as code };
48
+ const msg_7: string;
49
+ export { msg_7 as msg };
50
+ }
51
+ }
52
+ const HAVE_NOTHING: string;
53
+ const HAVE_METADATA: string;
54
+ const HAVE_CURRENT_DATA: string;
55
+ const HAVE_FUTURE_DATA: string;
56
+ const HAVE_ENOUGH_DATA: string;
57
+ const NETWORK_EMPTY: string;
58
+ const NETWORK_IDLE: string;
59
+ const NETWORK_LOADING: string;
60
+ const NETWORK_NO_SOURCE: string;
61
+ const MEDIA_ERR_ABORTED: string;
62
+ const MEDIA_ERR_NETWORK: string;
63
+ const MEDIA_ERR_DECODE: string;
64
+ const MEDIA_ERR_SRC_NOT_SUPPORTED: string;
65
+ const REPLAY: string;
66
+ const ERROR: string;
67
+ const PLAY_TIPS: string;
68
+ const PAUSE_TIPS: string;
69
+ const PLAYNEXT_TIPS: string;
70
+ const DOWNLOAD_TIPS: string;
71
+ const ROTATE_TIPS: string;
72
+ const RELOAD_TIPS: string;
73
+ const FULLSCREEN_TIPS: string;
74
+ const EXITFULLSCREEN_TIPS: string;
75
+ const CSSFULLSCREEN_TIPS: string;
76
+ const EXITCSSFULLSCREEN_TIPS: string;
77
+ const TEXTTRACK: string;
78
+ const PIP: string;
79
+ const SCREENSHOT: string;
80
+ const LIVE: string;
81
+ const OFF: string;
82
+ const OPEN: string;
83
+ const MINI_DRAG: string;
84
+ const MINISCREEN: string;
85
+ const REFRESH_TIPS: string;
86
+ const REFRESH: string;
87
+ const FORWARD: string;
88
+ const LIVE_TIP: string;
89
+ }
90
+ }
91
+ export default _default;
@@ -0,0 +1,91 @@
1
+ declare namespace _default {
2
+ const LANG: string;
3
+ namespace TEXT {
4
+ namespace ERROR_TYPES {
5
+ namespace network {
6
+ const code: number;
7
+ const msg: string;
8
+ }
9
+ namespace mse {
10
+ const code_1: number;
11
+ export { code_1 as code };
12
+ const msg_1: string;
13
+ export { msg_1 as msg };
14
+ }
15
+ namespace parse {
16
+ const code_2: number;
17
+ export { code_2 as code };
18
+ const msg_2: string;
19
+ export { msg_2 as msg };
20
+ }
21
+ namespace format {
22
+ const code_3: number;
23
+ export { code_3 as code };
24
+ const msg_3: string;
25
+ export { msg_3 as msg };
26
+ }
27
+ namespace decoder {
28
+ const code_4: number;
29
+ export { code_4 as code };
30
+ const msg_4: string;
31
+ export { msg_4 as msg };
32
+ }
33
+ namespace runtime {
34
+ const code_5: number;
35
+ export { code_5 as code };
36
+ const msg_5: string;
37
+ export { msg_5 as msg };
38
+ }
39
+ namespace timeout {
40
+ const code_6: number;
41
+ export { code_6 as code };
42
+ const msg_6: string;
43
+ export { msg_6 as msg };
44
+ }
45
+ namespace other {
46
+ const code_7: number;
47
+ export { code_7 as code };
48
+ const msg_7: string;
49
+ export { msg_7 as msg };
50
+ }
51
+ }
52
+ const HAVE_NOTHING: string;
53
+ const HAVE_METADATA: string;
54
+ const HAVE_CURRENT_DATA: string;
55
+ const HAVE_FUTURE_DATA: string;
56
+ const HAVE_ENOUGH_DATA: string;
57
+ const NETWORK_EMPTY: string;
58
+ const NETWORK_IDLE: string;
59
+ const NETWORK_LOADING: string;
60
+ const NETWORK_NO_SOURCE: string;
61
+ const MEDIA_ERR_ABORTED: string;
62
+ const MEDIA_ERR_NETWORK: string;
63
+ const MEDIA_ERR_DECODE: string;
64
+ const MEDIA_ERR_SRC_NOT_SUPPORTED: string;
65
+ const REPLAY: string;
66
+ const ERROR: string;
67
+ const PLAY_TIPS: string;
68
+ const PAUSE_TIPS: string;
69
+ const PLAYNEXT_TIPS: string;
70
+ const DOWNLOAD_TIPS: string;
71
+ const ROTATE_TIPS: string;
72
+ const RELOAD_TIPS: string;
73
+ const FULLSCREEN_TIPS: string;
74
+ const EXITFULLSCREEN_TIPS: string;
75
+ const CSSFULLSCREEN_TIPS: string;
76
+ const EXITCSSFULLSCREEN_TIPS: string;
77
+ const TEXTTRACK: string;
78
+ const PIP: string;
79
+ const SCREENSHOT: string;
80
+ const LIVE: string;
81
+ const OFF: string;
82
+ const OPEN: string;
83
+ const MINI_DRAG: string;
84
+ const MINISCREEN: string;
85
+ const REFRESH_TIPS: string;
86
+ const REFRESH: string;
87
+ const FORWARD: string;
88
+ const LIVE_TIP: string;
89
+ }
90
+ }
91
+ export default _default;
@@ -0,0 +1,91 @@
1
+ declare namespace _default {
2
+ const LANG: string;
3
+ namespace TEXT {
4
+ namespace ERROR_TYPES {
5
+ namespace network {
6
+ const code: number;
7
+ const msg: string;
8
+ }
9
+ namespace mse {
10
+ const code_1: number;
11
+ export { code_1 as code };
12
+ const msg_1: string;
13
+ export { msg_1 as msg };
14
+ }
15
+ namespace parse {
16
+ const code_2: number;
17
+ export { code_2 as code };
18
+ const msg_2: string;
19
+ export { msg_2 as msg };
20
+ }
21
+ namespace format {
22
+ const code_3: number;
23
+ export { code_3 as code };
24
+ const msg_3: string;
25
+ export { msg_3 as msg };
26
+ }
27
+ namespace decoder {
28
+ const code_4: number;
29
+ export { code_4 as code };
30
+ const msg_4: string;
31
+ export { msg_4 as msg };
32
+ }
33
+ namespace runtime {
34
+ const code_5: number;
35
+ export { code_5 as code };
36
+ const msg_5: string;
37
+ export { msg_5 as msg };
38
+ }
39
+ namespace timeout {
40
+ const code_6: number;
41
+ export { code_6 as code };
42
+ const msg_6: string;
43
+ export { msg_6 as msg };
44
+ }
45
+ namespace other {
46
+ const code_7: number;
47
+ export { code_7 as code };
48
+ const msg_7: string;
49
+ export { msg_7 as msg };
50
+ }
51
+ }
52
+ const HAVE_NOTHING: string;
53
+ const HAVE_METADATA: string;
54
+ const HAVE_CURRENT_DATA: string;
55
+ const HAVE_FUTURE_DATA: string;
56
+ const HAVE_ENOUGH_DATA: string;
57
+ const NETWORK_EMPTY: string;
58
+ const NETWORK_IDLE: string;
59
+ const NETWORK_LOADING: string;
60
+ const NETWORK_NO_SOURCE: string;
61
+ const MEDIA_ERR_ABORTED: string;
62
+ const MEDIA_ERR_NETWORK: string;
63
+ const MEDIA_ERR_DECODE: string;
64
+ const MEDIA_ERR_SRC_NOT_SUPPORTED: string;
65
+ const REPLAY: string;
66
+ const ERROR: string;
67
+ const PLAY_TIPS: string;
68
+ const PAUSE_TIPS: string;
69
+ const PLAYNEXT_TIPS: string;
70
+ const DOWNLOAD_TIPS: string;
71
+ const ROTATE_TIPS: string;
72
+ const RELOAD_TIPS: string;
73
+ const FULLSCREEN_TIPS: string;
74
+ const EXITFULLSCREEN_TIPS: string;
75
+ const CSSFULLSCREEN_TIPS: string;
76
+ const EXITCSSFULLSCREEN_TIPS: string;
77
+ const TEXTTRACK: string;
78
+ const PIP: string;
79
+ const SCREENSHOT: string;
80
+ const LIVE: string;
81
+ const OFF: string;
82
+ const OPEN: string;
83
+ const MINI_DRAG: string;
84
+ const MINISCREEN: string;
85
+ const REFRESH_TIPS: string;
86
+ const REFRESH: string;
87
+ const FORWARD: string;
88
+ const LIVE_TIP: string;
89
+ }
90
+ }
91
+ export default _default;
package/es/player.d.ts CHANGED
@@ -78,6 +78,12 @@ declare class Player extends MediaProxy {
78
78
  * @private
79
79
  */
80
80
  private waitTimer;
81
+ /**
82
+ * @public
83
+ * @description This switch provides the playback plugin with the ability
84
+ * to handle media source by itself.
85
+ */
86
+ public handleSource: boolean;
81
87
  /**
82
88
  * @private
83
89
  */
@@ -670,7 +676,7 @@ declare class Player extends MediaProxy {
670
676
  * @param { {[propName: string]: any} } [ext]
671
677
  * @returns { url: IUrl, [propName: string]: any }
672
678
  */
673
- preProcessUrl(url: IUrl, ext?: {
679
+ _preProcessUrl(url: IUrl, ext?: {
674
680
  [propName: string]: any;
675
681
  }): import("./defaultConfig").IUrl;
676
682
  /**
package/es/player.js CHANGED
@@ -133,6 +133,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
133
133
  }
134
134
  _this.userTimer = null;
135
135
  _this.waitTimer = null;
136
+ _this.handleSource = true;
136
137
  _this._state = STATES.INITIAL;
137
138
  _this.isError = false;
138
139
  _this._hasStart = false;
@@ -376,13 +377,15 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
376
377
  return;
377
378
  }
378
379
  }
379
- this._detachSourceEvents(this.media);
380
- if (util.typeOf(url) === "Array" && url.length > 0) {
381
- this._attachSourceEvents(this.media, url);
382
- } else if (!this.media.src || this.media.src !== url) {
383
- this.media.src = url;
384
- } else if (!url) {
385
- this.media.removeAttribute("src");
380
+ if (this.handleSource) {
381
+ this._detachSourceEvents(this.media);
382
+ if (util.typeOf(url) === "Array" && url.length > 0) {
383
+ this._attachSourceEvents(this.media, url);
384
+ } else if (!this.media.src || this.media.src !== url) {
385
+ this.media.src = url;
386
+ } else if (!url) {
387
+ this.media.removeAttribute("src");
388
+ }
386
389
  }
387
390
  if (util.typeOf(this.config.volume) === "Number") {
388
391
  this.volume = this.config.volume;
@@ -625,7 +628,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
625
628
  if (!url) {
626
629
  url = _this8.url || _this8.config.url;
627
630
  }
628
- var _furl = _this8.preProcessUrl(url);
631
+ var _furl = _this8._preProcessUrl(url);
629
632
  var ret = _this8._startInit(_furl.url);
630
633
  return ret;
631
634
  }).catch(function(e) {
@@ -643,7 +646,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
643
646
  if (util.typeOf(url) === "Object") {
644
647
  _src = url.url;
645
648
  }
646
- _src = this.preProcessUrl(_src).url;
649
+ _src = this._preProcessUrl(_src).url;
647
650
  var curTime = this.currentTime;
648
651
  this.__startTime = curTime;
649
652
  var isPaused = this.paused && !this.isError;
@@ -988,7 +991,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
988
991
  runHooks(this, "retry", function() {
989
992
  var cur = _this20.currentTime;
990
993
  var url = _this20.config.url;
991
- var _srcRet = !util.isMSE(_this20.media) ? _this20.preProcessUrl(url) : {
994
+ var _srcRet = !util.isMSE(_this20.media) ? _this20._preProcessUrl(url) : {
992
995
  url
993
996
  };
994
997
  _this20.src = _srcRet.url;
@@ -1641,10 +1644,10 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
1641
1644
  this._state = newState;
1642
1645
  }
1643
1646
  }, {
1644
- key: "preProcessUrl",
1645
- value: function preProcessUrl(url, ext) {
1646
- var preProcessUrl2 = this.config.preProcessUrl;
1647
- return !util.isBlob(url) && preProcessUrl2 && typeof preProcessUrl2 === "function" ? preProcessUrl2(url, ext) : {
1647
+ key: "_preProcessUrl",
1648
+ value: function _preProcessUrl(url, ext) {
1649
+ var preProcessUrl = this.config.preProcessUrl;
1650
+ return !util.isBlob(url) && typeof preProcessUrl === "function" ? preProcessUrl(url, ext) : {
1648
1651
  url
1649
1652
  };
1650
1653
  }
package/es/version.js CHANGED
@@ -1,2 +1,2 @@
1
- var version = "3.0.12";
1
+ var version = "3.0.13";
2
2
  export { version as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xgplayer",
3
- "version": "3.0.12",
3
+ "version": "3.0.13",
4
4
  "description": "video player",
5
5
  "main": "dist/index.min.js",
6
6
  "module": "es/index.js",
@@ -43,7 +43,7 @@
43
43
  "delegate": "^3.2.0",
44
44
  "downloadjs": "1.4.7",
45
45
  "eventemitter3": "^4.0.7",
46
- "xgplayer-subtitles": "3.0.12"
46
+ "xgplayer-subtitles": "3.0.13"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "core-js": ">=3.12.1"