xgplayer 3.0.25-rc.9 → 3.0.26

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.
Files changed (109) hide show
  1. package/dist/index.min.js +1 -1
  2. package/dist/index.min.js.map +1 -1
  3. package/es/defaultConfig.d.ts +15 -15
  4. package/es/error.d.ts +12 -12
  5. package/es/events.d.ts +3 -3
  6. package/es/icons.d.ts +1 -1
  7. package/es/index.d.ts +19 -19
  8. package/es/index.umd.d.ts +17 -17
  9. package/es/instManager.d.ts +1 -1
  10. package/es/lang/br.d.ts +54 -54
  11. package/es/lang/de.d.ts +54 -54
  12. package/es/lang/en.d.ts +55 -55
  13. package/es/lang/es.d.ts +54 -54
  14. package/es/lang/fr.d.ts +54 -54
  15. package/es/lang/i18n.d.ts +7 -0
  16. package/es/lang/id.d.ts +54 -54
  17. package/es/lang/index.d.ts +1 -1
  18. package/es/lang/it.d.ts +54 -54
  19. package/es/lang/jp.d.ts +55 -55
  20. package/es/lang/kr.d.ts +54 -54
  21. package/es/lang/ms-my.d.ts +54 -54
  22. package/es/lang/ru.d.ts +54 -54
  23. package/es/lang/th.d.ts +54 -54
  24. package/es/lang/vn.d.ts +54 -54
  25. package/es/lang/zh-cn.d.ts +55 -55
  26. package/es/lang/zh-hk.d.ts +55 -55
  27. package/es/lang/zh-hk.js +1 -1
  28. package/es/mediaProxy.d.ts +42 -30
  29. package/es/mediaProxy.js +35 -21
  30. package/es/player.d.ts +51 -52
  31. package/es/player.js +3 -3
  32. package/es/plugin/basePlugin.d.ts +12 -12
  33. package/es/plugin/hooksDescriptor.d.ts +3 -3
  34. package/es/plugin/index.d.ts +12 -12
  35. package/es/plugin/plugin.d.ts +26 -23
  36. package/es/plugin/plugin.js +3 -1
  37. package/es/plugin/pluginsManager.d.ts +9 -71
  38. package/es/plugin/pluginsManager.js +22 -9
  39. package/es/plugin/resizeObserver.d.ts +1 -1
  40. package/es/plugins/common/iconPlugin.d.ts +1 -1
  41. package/es/plugins/common/optionList.d.ts +4 -4
  42. package/es/plugins/common/optionsIcon.d.ts +7 -7
  43. package/es/plugins/common/thumbnail.d.ts +4 -4
  44. package/es/plugins/controls/index.d.ts +8 -8
  45. package/es/plugins/cssFullScreen/index.d.ts +4 -4
  46. package/es/plugins/danmu/danmuIcon.d.ts +1 -1
  47. package/es/plugins/danmu/danmuPanel.d.ts +2 -2
  48. package/es/plugins/danmu/index.d.ts +3 -3
  49. package/es/plugins/definition/index.d.ts +2 -2
  50. package/es/plugins/download/index.d.ts +5 -5
  51. package/es/plugins/download/saveAs.d.ts +6 -6
  52. package/es/plugins/dynamicBg/index.d.ts +14 -15
  53. package/es/plugins/enter/index.d.ts +3 -3
  54. package/es/plugins/error/index.d.ts +3 -3
  55. package/es/plugins/fpsDetect/index.d.ts +5 -5
  56. package/es/plugins/fullscreen/backicon.d.ts +2 -2
  57. package/es/plugins/fullscreen/index.d.ts +4 -4
  58. package/es/plugins/gapJump/index.d.ts +6 -6
  59. package/es/plugins/heatmap/index.d.ts +3 -4
  60. package/es/plugins/keyboard/index.d.ts +5 -5
  61. package/es/plugins/keyboard/index.js +1 -1
  62. package/es/plugins/loading/index.d.ts +1 -1
  63. package/es/plugins/logger/index.d.ts +22 -22
  64. package/es/plugins/miniScreen/index.d.ts +8 -8
  65. package/es/plugins/miniScreen/miniScreenIcon.d.ts +1 -1
  66. package/es/plugins/mobile/index.d.ts +8 -8
  67. package/es/plugins/netAdaption/index.d.ts +2 -2
  68. package/es/plugins/pc/index.d.ts +2 -2
  69. package/es/plugins/pc/index.js +1 -1
  70. package/es/plugins/pip/index.d.ts +12 -12
  71. package/es/plugins/play/index.d.ts +2 -2
  72. package/es/plugins/playNext/index.d.ts +5 -5
  73. package/es/plugins/playbackRate/index.d.ts +5 -5
  74. package/es/plugins/poster/index.d.ts +3 -3
  75. package/es/plugins/progress/index.d.ts +15 -15
  76. package/es/plugins/progress/innerList.d.ts +6 -6
  77. package/es/plugins/progress/innerList.js +1 -1
  78. package/es/plugins/progress/miniProgress.d.ts +4 -4
  79. package/es/plugins/progressPreview/dotsApi.js +1 -1
  80. package/es/plugins/progressPreview/index.d.ts +17 -17
  81. package/es/plugins/prompt/index.d.ts +3 -3
  82. package/es/plugins/replay/index.d.ts +2 -2
  83. package/es/plugins/rotate/index.d.ts +5 -5
  84. package/es/plugins/screenShot/index.d.ts +6 -6
  85. package/es/plugins/start/index.d.ts +5 -5
  86. package/es/plugins/stats/index.d.ts +7 -7
  87. package/es/plugins/stats/index.js +1 -1
  88. package/es/plugins/testspeed/index.d.ts +6 -6
  89. package/es/plugins/time/index.d.ts +8 -9
  90. package/es/plugins/time/timesegments.d.ts +3 -3
  91. package/es/plugins/time/timesegments.js +1 -1
  92. package/es/plugins/track/index.d.ts +14 -15
  93. package/es/plugins/track/nativeSubTitle.d.ts +2 -1
  94. package/es/plugins/volume/index.d.ts +9 -9
  95. package/es/plugins/waitingTimeoutJump/index.d.ts +4 -4
  96. package/es/presets/default-en.d.ts +27 -27
  97. package/es/presets/default.d.ts +28 -28
  98. package/es/presets/live.d.ts +14 -14
  99. package/es/presets/mobile.d.ts +23 -23
  100. package/es/state.d.ts +8 -8
  101. package/es/stateClassMap.d.ts +29 -29
  102. package/es/utils/database.d.ts +11 -4
  103. package/es/utils/debug.d.ts +1 -1
  104. package/es/utils/draggabilly.d.ts +3 -2
  105. package/es/utils/sniffer.d.ts +2 -2
  106. package/es/utils/util.d.ts +61 -59
  107. package/es/utils/util.js +2 -0
  108. package/es/version.js +1 -1
  109. package/package.json +3 -3
@@ -1,92 +1,92 @@
1
1
  declare namespace _default {
2
- const LANG: string;
2
+ let LANG: string;
3
3
  namespace TEXT {
4
4
  namespace ERROR_TYPES {
5
5
  namespace network {
6
- const code: number;
7
- const msg: string;
6
+ let code: number;
7
+ let msg: string;
8
8
  }
9
9
  namespace mse {
10
- const code_1: number;
10
+ let code_1: number;
11
11
  export { code_1 as code };
12
- const msg_1: string;
12
+ let msg_1: string;
13
13
  export { msg_1 as msg };
14
14
  }
15
15
  namespace parse {
16
- const code_2: number;
16
+ let code_2: number;
17
17
  export { code_2 as code };
18
- const msg_2: string;
18
+ let msg_2: string;
19
19
  export { msg_2 as msg };
20
20
  }
21
21
  namespace format {
22
- const code_3: number;
22
+ let code_3: number;
23
23
  export { code_3 as code };
24
- const msg_3: string;
24
+ let msg_3: string;
25
25
  export { msg_3 as msg };
26
26
  }
27
27
  namespace decoder {
28
- const code_4: number;
28
+ let code_4: number;
29
29
  export { code_4 as code };
30
- const msg_4: string;
30
+ let msg_4: string;
31
31
  export { msg_4 as msg };
32
32
  }
33
33
  namespace runtime {
34
- const code_5: number;
34
+ let code_5: number;
35
35
  export { code_5 as code };
36
- const msg_5: string;
36
+ let msg_5: string;
37
37
  export { msg_5 as msg };
38
38
  }
39
39
  namespace timeout {
40
- const code_6: number;
40
+ let code_6: number;
41
41
  export { code_6 as code };
42
- const msg_6: string;
42
+ let msg_6: string;
43
43
  export { msg_6 as msg };
44
44
  }
45
45
  namespace other {
46
- const code_7: number;
46
+ let code_7: number;
47
47
  export { code_7 as code };
48
- const msg_7: string;
48
+ let msg_7: string;
49
49
  export { msg_7 as msg };
50
50
  }
51
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 TEXTTRACK_OFF: string;
79
- const PIP: string;
80
- const SCREENSHOT: string;
81
- const LIVE: string;
82
- const OFF: string;
83
- const OPEN: string;
84
- const MINI_DRAG: string;
85
- const MINISCREEN: string;
86
- const REFRESH_TIPS: string;
87
- const REFRESH: string;
88
- const FORWARD: string;
89
- const LIVE_TIP: string;
52
+ let HAVE_NOTHING: string;
53
+ let HAVE_METADATA: string;
54
+ let HAVE_CURRENT_DATA: string;
55
+ let HAVE_FUTURE_DATA: string;
56
+ let HAVE_ENOUGH_DATA: string;
57
+ let NETWORK_EMPTY: string;
58
+ let NETWORK_IDLE: string;
59
+ let NETWORK_LOADING: string;
60
+ let NETWORK_NO_SOURCE: string;
61
+ let MEDIA_ERR_ABORTED: string;
62
+ let MEDIA_ERR_NETWORK: string;
63
+ let MEDIA_ERR_DECODE: string;
64
+ let MEDIA_ERR_SRC_NOT_SUPPORTED: string;
65
+ let REPLAY: string;
66
+ let ERROR: string;
67
+ let PLAY_TIPS: string;
68
+ let PAUSE_TIPS: string;
69
+ let PLAYNEXT_TIPS: string;
70
+ let DOWNLOAD_TIPS: string;
71
+ let ROTATE_TIPS: string;
72
+ let RELOAD_TIPS: string;
73
+ let FULLSCREEN_TIPS: string;
74
+ let EXITFULLSCREEN_TIPS: string;
75
+ let CSSFULLSCREEN_TIPS: string;
76
+ let EXITCSSFULLSCREEN_TIPS: string;
77
+ let TEXTTRACK: string;
78
+ let TEXTTRACK_OFF: string;
79
+ let PIP: string;
80
+ let SCREENSHOT: string;
81
+ let LIVE: string;
82
+ let OFF: string;
83
+ let OPEN: string;
84
+ let MINI_DRAG: string;
85
+ let MINISCREEN: string;
86
+ let REFRESH_TIPS: string;
87
+ let REFRESH: string;
88
+ let FORWARD: string;
89
+ let LIVE_TIP: string;
90
90
  }
91
91
  }
92
92
  export default _default;
package/es/lang/zh-hk.js CHANGED
@@ -71,7 +71,7 @@ var zhHk = {
71
71
  MINISCREEN: "\u5C0F\u5C4F\u5E55",
72
72
  REFRESH_TIPS: "\u8ACB\u8A66\u8A66",
73
73
  REFRESH: "\u5237\u65B0",
74
- FORWARD: "\u5FEB\u8FDB\u4E2D",
74
+ FORWARD: "\u5FEB\u9032\u4E2D",
75
75
  LIVE_TIP: "\u76F4\u64AD"
76
76
  }
77
77
  };
@@ -1,5 +1,5 @@
1
1
  export default MediaProxy;
2
- export type EventEmitter = import('eventemitter3');
2
+ export type EventEmitter = import("eventemitter3");
3
3
  export type IMediaProxy = {
4
4
  duration: number;
5
5
  currentTime: number;
@@ -18,11 +18,11 @@ export type IMediaProxy = {
18
18
  play: Function;
19
19
  pause: Function;
20
20
  };
21
- export type IPlayerOptions = import('./defaultConfig').IPlayerOptions;
21
+ export type IPlayerOptions = import("./defaultConfig").IPlayerOptions;
22
22
  /**
23
23
  * @extends { EventEmitter }
24
24
  */
25
- declare class MediaProxy {
25
+ declare class MediaProxy extends EventEmitter<string | symbol, any> {
26
26
  /**
27
27
  * @param { IPlayerOptions } options
28
28
  */
@@ -73,7 +73,7 @@ declare class MediaProxy {
73
73
  * @type { HTMLVideoElement | HTMLAudioElement | HTMLElement | IMediaProxy | null }
74
74
  */
75
75
  media: HTMLVideoElement | HTMLAudioElement | HTMLElement | IMediaProxy | null;
76
- set volume(arg: number);
76
+ set volume(vol: number);
77
77
  /**
78
78
  * @type { number }
79
79
  * @description 设置/返回视频的音量
@@ -121,6 +121,23 @@ declare class MediaProxy {
121
121
  * @param { any } [media]
122
122
  */
123
123
  detachVideoEvents(media?: any): void;
124
+ /**
125
+ * @description Assemble source elements for the media element,
126
+ * and add error event listeners to each source element
127
+ * @public
128
+ */
129
+ public assembleSource(urls: any, mediaEl: any): void;
130
+ /**
131
+ * @private
132
+ */
133
+ private _videoSourceCount;
134
+ _videoSourceIndex: any;
135
+ _sourceError: ((e: any) => void) | undefined;
136
+ /**
137
+ * @description disassemble source elements for the media element
138
+ * @public
139
+ */
140
+ public disassembleSource(mediaEl: any): void;
124
141
  /**
125
142
  * 针对source列表播放方式添加错误监听
126
143
  * @doc https://stackoverflow.com/questions/47557135/html5-detect-the-type-of-error-when-trying-to-load-a-video-using-a-source-elem
@@ -132,13 +149,7 @@ declare class MediaProxy {
132
149
  src: string;
133
150
  type: string;
134
151
  }>): void;
135
- /**
136
- * @private
137
- */
138
- private _videoSourceCount;
139
- _videoSourceIndex: number;
140
- _vLoadeddata: (e: any) => void;
141
- _sourceError: (e: any) => void;
152
+ _vLoadeddata: ((e: any) => void) | undefined;
142
153
  /**
143
154
  * 移除source列表错误事件监听
144
155
  * @protected
@@ -149,18 +160,18 @@ declare class MediaProxy {
149
160
  * @description Media Error handler
150
161
  * @param { string } eventName
151
162
  */
152
- errorHandler(name: any, error?: any): void;
163
+ errorHandler(name: any, error?: null): void;
153
164
  destroy(): void;
154
165
  /**
155
166
  * @type { HTMLVideoElement | HTMLAudioElement | HTMLElement | IMediaProxy | null }
156
167
  * @deprecated Property [video] is renamed to [media],you can access using player.media= xx
157
168
  */
158
- set video(arg: HTMLElement | HTMLVideoElement | HTMLAudioElement | IMediaProxy);
169
+ set video(media: HTMLVideoElement | HTMLAudioElement | HTMLElement | IMediaProxy | null);
159
170
  /**
160
171
  * @type { HTMLVideoElement | HTMLAudioElement | HTMLElement | IMediaProxy | null }
161
172
  * @deprecated Property [video] is renamed to [media],you can access using player.media
162
173
  */
163
- get video(): HTMLElement | HTMLVideoElement | HTMLAudioElement | IMediaProxy;
174
+ get video(): HTMLVideoElement | HTMLAudioElement | HTMLElement | IMediaProxy | null;
164
175
  /**
165
176
  *
166
177
  * @returns { Promise<void> | null }
@@ -184,21 +195,21 @@ declare class MediaProxy {
184
195
  * @type { boolean }
185
196
  * @description 设置/返回 自动播放属性
186
197
  */
187
- set autoplay(arg: any);
198
+ set autoplay(isTrue: any);
188
199
  get autoplay(): any;
189
200
  /**
190
201
  * @type { TimeRanges | null }
191
202
  * @description 返回当前缓冲的TimeRange对象集合
192
203
  */
193
- get buffered(): TimeRanges;
204
+ get buffered(): TimeRanges | null;
194
205
  /**
195
206
  * @type { Array<{start: number, end: number}> | null}
196
207
  * @description 返回当前自定义的缓存列表
197
208
  */
198
- get buffered2(): {
209
+ get buffered2(): Array<{
199
210
  start: number;
200
211
  end: number;
201
- }[];
212
+ }> | null;
202
213
  /**
203
214
  * @type { {start: number, end: number} }
204
215
  */
@@ -206,25 +217,25 @@ declare class MediaProxy {
206
217
  start: number;
207
218
  end: number;
208
219
  };
209
- set crossOrigin(arg: string);
220
+ set crossOrigin(isTrue: string);
210
221
  /**
211
222
  * @type { string}
212
223
  * @description 设置/返回是否跨域
213
224
  * */
214
225
  get crossOrigin(): string;
215
- set currentSrc(arg: string);
226
+ set currentSrc(src: string);
216
227
  /**
217
228
  * @type { string }
218
229
  * @description 设置/返回视频播放地址
219
230
  * */
220
231
  get currentSrc(): string;
221
- set currentTime(arg: number);
232
+ set currentTime(time: number);
222
233
  /**
223
234
  * @type { number }
224
235
  * @description 设置/返回视频当前播放时间
225
236
  * */
226
237
  get currentTime(): number;
227
- set defaultMuted(arg: boolean);
238
+ set defaultMuted(isTrue: boolean);
228
239
  /**
229
240
  * @type { boolean }
230
241
  * 设置/返回视频默认静音
@@ -250,13 +261,13 @@ declare class MediaProxy {
250
261
  * @description return error description text
251
262
  */
252
263
  get errorNote(): string;
253
- set loop(arg: boolean);
264
+ set loop(isTrue: boolean);
254
265
  /**
255
266
  * @type { boolean }
256
267
  * @description 否开启了循环播放
257
268
  */
258
269
  get loop(): boolean;
259
- set muted(arg: boolean);
270
+ set muted(isTrue: boolean);
260
271
  /**
261
272
  * @type { boolean }
262
273
  * @description 静音
@@ -266,13 +277,13 @@ declare class MediaProxy {
266
277
  * @type { 0 | 1 | 2 | 3 }
267
278
  * @description 返回视频的当前网络状态
268
279
  */
269
- get networkState(): 0 | 2 | 1 | 3;
280
+ get networkState(): 0 | 1 | 2 | 3;
270
281
  /**
271
282
  * @type { boolean }
272
283
  * @description 回当前视频是否是暂停状态
273
284
  */
274
285
  get paused(): boolean;
275
- set playbackRate(arg: number);
286
+ set playbackRate(rate: number);
276
287
  /**
277
288
  * @type { number }
278
289
  * @description 返回/设置倍速
@@ -281,8 +292,8 @@ declare class MediaProxy {
281
292
  /**
282
293
  * @type { TimeRanges | null}
283
294
  */
284
- get played(): TimeRanges;
285
- set preload(arg: boolean);
295
+ get played(): TimeRanges | null;
296
+ set preload(isTrue: boolean);
286
297
  /**
287
298
  * @type { boolean }
288
299
  */
@@ -291,7 +302,7 @@ declare class MediaProxy {
291
302
  * @type { 0 | 1 | 2 | 3 | 4 }
292
303
  * @description 回视频的就绪状态
293
304
  */
294
- get readyState(): 0 | 2 | 1 | 3 | 4;
305
+ get readyState(): 0 | 1 | 2 | 3 | 4;
295
306
  /**
296
307
  * @type { boolean }
297
308
  * @description 当前视频是否可以seek
@@ -302,7 +313,7 @@ declare class MediaProxy {
302
313
  * @description 当前视频是否处于seeking状态下
303
314
  */
304
315
  get seeking(): boolean;
305
- set src(arg: any);
316
+ set src(url: any);
306
317
  /**
307
318
  * @type { any }
308
319
  * @description 设置/返回当前视频的地址
@@ -343,3 +354,4 @@ declare class MediaProxy {
343
354
  off(event: string, callback: (...args: any[]) => any, ...args: any[]): void;
344
355
  offAll(): void;
345
356
  }
357
+ import EventEmitter from 'eventemitter3';
package/es/mediaProxy.js CHANGED
@@ -3,7 +3,7 @@ import EventEmitter from "eventemitter3";
3
3
  import util from "./utils/util.js";
4
4
  import sniffer from "./utils/sniffer.js";
5
5
  import Errors, { ERROR_TYPE_MAP } from "./error.js";
6
- import { VIDEO_EVENTS, SOURCE_SUCCESS, SOURCE_ERROR, URL_CHANGE, WAITING } from "./events.js";
6
+ import { VIDEO_EVENTS, SOURCE_ERROR, SOURCE_SUCCESS, URL_CHANGE, WAITING } from "./events.js";
7
7
  function emitVideoEvent(eventKey, e) {
8
8
  if (!this || !this.emit) {
9
9
  return;
@@ -183,30 +183,20 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
183
183
  this._evHandlers = null;
184
184
  }
185
185
  }, {
186
- key: "_attachSourceEvents",
187
- value: function _attachSourceEvents(video, urls) {
186
+ key: "assembleSource",
187
+ value: function assembleSource(urls, mediaEl) {
188
188
  var _this6 = this;
189
- video.removeAttribute("src");
190
- video.load();
189
+ var media = mediaEl || this.media || this.video;
191
190
  urls.forEach(function(item, index) {
192
- _this6.media.appendChild(util.createDom("source", "", {
191
+ media.appendChild(util.createDom("source", "", {
193
192
  src: "".concat(item.src),
194
193
  type: "".concat(item.type || ""),
195
194
  "data-index": index + 1
196
195
  }));
197
196
  });
198
- var _c = video.children;
199
- if (!_c) {
200
- return;
201
- }
197
+ var _c = media.children;
202
198
  this._videoSourceCount = _c.length;
203
199
  this._videoSourceIndex = _c.length;
204
- this._vLoadeddata = function(e) {
205
- _this6.emit(SOURCE_SUCCESS, {
206
- src: e.target.currentSrc,
207
- host: util.getHostFromUrl(e.target.currentSrc)
208
- });
209
- };
210
200
  var _eHandler = null;
211
201
  for (var i = 0; i < this._evHandlers.length; i++) {
212
202
  if (Object.keys(this._evHandlers[i])[0] === "error") {
@@ -239,12 +229,12 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
239
229
  for (var _i = 0; _i < _c.length; _i++) {
240
230
  _c[_i].addEventListener("error", this._sourceError);
241
231
  }
242
- video.addEventListener("loadeddata", this._vLoadeddata);
243
232
  }
244
233
  }, {
245
- key: "_detachSourceEvents",
246
- value: function _detachSourceEvents(video) {
247
- var _c = video.children;
234
+ key: "disassembleSource",
235
+ value: function disassembleSource(mediaEl) {
236
+ var media = mediaEl || this.media || this.video;
237
+ var _c = media.children;
248
238
  if (!_c || _c.length === 0 || !this._sourceError) {
249
239
  return;
250
240
  }
@@ -252,8 +242,32 @@ var MediaProxy = /* @__PURE__ */ function(_EventEmitter) {
252
242
  _c[i].removeEventListener("error", this._sourceError);
253
243
  }
254
244
  while (_c.length > 0) {
255
- video.removeChild(_c[0]);
245
+ media.removeChild(_c[0]);
256
246
  }
247
+ }
248
+ }, {
249
+ key: "_attachSourceEvents",
250
+ value: function _attachSourceEvents(video, urls) {
251
+ var _this7 = this;
252
+ video.removeAttribute("src");
253
+ video.load();
254
+ this.assembleSource(urls, video);
255
+ var _c = video.children;
256
+ if (!_c) {
257
+ return;
258
+ }
259
+ this._vLoadeddata = function(e) {
260
+ _this7.emit(SOURCE_SUCCESS, {
261
+ src: e.target.currentSrc,
262
+ host: util.getHostFromUrl(e.target.currentSrc)
263
+ });
264
+ };
265
+ video.addEventListener("loadeddata", this._vLoadeddata);
266
+ }
267
+ }, {
268
+ key: "_detachSourceEvents",
269
+ value: function _detachSourceEvents(video) {
270
+ this.disassembleSource(video);
257
271
  this._vLoadeddata && video.removeEventListener("loadeddata", this._vLoadeddata);
258
272
  }
259
273
  }, {