@volcengine/veplayer 2.12.0-rc.1 → 2.12.0-rc.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/esm/veplayer.biz.live.development.js +16 -2
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +2 -1
- package/esm/veplayer.development.js +163 -138
- package/esm/veplayer.live.d.ts +2 -1
- package/esm/veplayer.live.development.js +163 -138
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.development.js +145 -134
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/veplayer.biz.live.development.js +16 -2
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +2 -1
- package/umd/veplayer.development.js +163 -138
- package/umd/veplayer.live.d.ts +2 -1
- package/umd/veplayer.live.development.js +163 -138
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.development.js +145 -134
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +2 -1
- package/veplayer.live.d.ts +2 -1
|
@@ -1460,7 +1460,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
};
|
|
1463
|
-
var version = "3.0.24-rc.
|
|
1463
|
+
var version = "3.0.24-rc.6";
|
|
1464
1464
|
var ERROR_TYPE_MAP = {
|
|
1465
1465
|
1: "media",
|
|
1466
1466
|
2: "media",
|
|
@@ -4541,6 +4541,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4541
4541
|
_inherits(Player2, _MediaProxy);
|
|
4542
4542
|
var _super = _createSuper(Player2);
|
|
4543
4543
|
function Player2(options) {
|
|
4544
|
+
var _this$onReady, _this2;
|
|
4544
4545
|
var _this;
|
|
4545
4546
|
_classCallCheck(this, Player2);
|
|
4546
4547
|
var _config = util.deepMerge(getDefaultConfig$1(), options);
|
|
@@ -4709,16 +4710,18 @@ var __publicField = (obj, key, value) => {
|
|
|
4709
4710
|
return _possibleConstructorReturn(_this);
|
|
4710
4711
|
}
|
|
4711
4712
|
var _this$config2 = _this.config, _this$config2$definit = _this$config2.definition, definition = _this$config2$definit === void 0 ? {} : _this$config2$definit, url = _this$config2.url;
|
|
4712
|
-
if (
|
|
4713
|
-
var
|
|
4713
|
+
if (Array.isArray(definition === null || definition === void 0 ? void 0 : definition.list) && definition.list.length > 0) {
|
|
4714
|
+
var curDefinition = definition.list.find(function(e) {
|
|
4714
4715
|
return e.definition && e.definition === definition.defaultDefinition;
|
|
4715
4716
|
});
|
|
4716
|
-
if (!
|
|
4717
|
+
if (!curDefinition) {
|
|
4717
4718
|
definition.defaultDefinition = definition.list[0].definition;
|
|
4718
|
-
|
|
4719
|
+
curDefinition = definition.list[0];
|
|
4720
|
+
}
|
|
4721
|
+
_this.curDefinition = curDefinition;
|
|
4722
|
+
if (!url) {
|
|
4723
|
+
_this.config.url = curDefinition.url;
|
|
4719
4724
|
}
|
|
4720
|
-
_this.config.url = defaultDefinitionObj.url;
|
|
4721
|
-
_this.curDefinition = defaultDefinitionObj;
|
|
4722
4725
|
}
|
|
4723
4726
|
_this._bindEvents();
|
|
4724
4727
|
_this._registerPresets();
|
|
@@ -4729,7 +4732,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4729
4732
|
util.setTimeout(_assertThisInitialized(_this), function() {
|
|
4730
4733
|
_this.emit(READY);
|
|
4731
4734
|
}, 0);
|
|
4732
|
-
_this.onReady
|
|
4735
|
+
(_this$onReady = (_this2 = _this).onReady) === null || _this$onReady === void 0 ? void 0 : _this$onReady.call(_this2);
|
|
4733
4736
|
if (_this.config.videoInit || _this.config.autoplay) {
|
|
4734
4737
|
if (!_this.hasStart || _this.state < STATES.ATTACHED) {
|
|
4735
4738
|
_this.start();
|
|
@@ -4740,7 +4743,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4740
4743
|
_createClass(Player2, [{
|
|
4741
4744
|
key: "_initDOM",
|
|
4742
4745
|
value: function _initDOM() {
|
|
4743
|
-
var _instManager,
|
|
4746
|
+
var _instManager, _this3 = this;
|
|
4744
4747
|
this.root = this.config.id ? document.getElementById(this.config.id) : null;
|
|
4745
4748
|
if (!this.root) {
|
|
4746
4749
|
var el = this.config.el;
|
|
@@ -4793,15 +4796,15 @@ var __publicField = (obj, key, value) => {
|
|
|
4793
4796
|
"padding-top": "".concat(_height * 100 / _width, "%")
|
|
4794
4797
|
};
|
|
4795
4798
|
Object.keys(style).forEach(function(key) {
|
|
4796
|
-
|
|
4799
|
+
_this3.root.style[key] = style[key];
|
|
4797
4800
|
});
|
|
4798
4801
|
} else {
|
|
4799
4802
|
["width", "height"].forEach(function(key) {
|
|
4800
|
-
if (
|
|
4801
|
-
if (typeof
|
|
4802
|
-
|
|
4803
|
+
if (_this3.config[key]) {
|
|
4804
|
+
if (typeof _this3.config[key] !== "number") {
|
|
4805
|
+
_this3.root.style[key] = _this3.config[key];
|
|
4803
4806
|
} else {
|
|
4804
|
-
|
|
4807
|
+
_this3.root.style[key] = "".concat(_this3.config[key], "px");
|
|
4805
4808
|
}
|
|
4806
4809
|
}
|
|
4807
4810
|
});
|
|
@@ -4829,12 +4832,12 @@ var __publicField = (obj, key, value) => {
|
|
|
4829
4832
|
}, {
|
|
4830
4833
|
key: "_bindEvents",
|
|
4831
4834
|
value: function _bindEvents() {
|
|
4832
|
-
var
|
|
4835
|
+
var _this4 = this;
|
|
4833
4836
|
["focus", "blur"].forEach(function(item) {
|
|
4834
|
-
|
|
4837
|
+
_this4.on(item, _this4["on" + item.charAt(0).toUpperCase() + item.slice(1)]);
|
|
4835
4838
|
});
|
|
4836
4839
|
FULLSCREEN_EVENTS.forEach(function(item) {
|
|
4837
|
-
document && document.addEventListener(item,
|
|
4840
|
+
document && document.addEventListener(item, _this4.onFullscreenChange);
|
|
4838
4841
|
});
|
|
4839
4842
|
if (sniffer.os.isIos) {
|
|
4840
4843
|
this.media.addEventListener("webkitbeginfullscreen", this._onWebkitbeginfullscreen);
|
|
@@ -4842,8 +4845,8 @@ var __publicField = (obj, key, value) => {
|
|
|
4842
4845
|
}
|
|
4843
4846
|
this.once(LOADED_DATA, this.resize);
|
|
4844
4847
|
this.playFunc = function() {
|
|
4845
|
-
if (!
|
|
4846
|
-
|
|
4848
|
+
if (!_this4.config.closeFocusVideoFocus) {
|
|
4849
|
+
_this4.media.focus();
|
|
4847
4850
|
}
|
|
4848
4851
|
};
|
|
4849
4852
|
this.once(PLAY, this.playFunc);
|
|
@@ -4851,10 +4854,10 @@ var __publicField = (obj, key, value) => {
|
|
|
4851
4854
|
}, {
|
|
4852
4855
|
key: "_unbindEvents",
|
|
4853
4856
|
value: function _unbindEvents() {
|
|
4854
|
-
var
|
|
4857
|
+
var _this5 = this;
|
|
4855
4858
|
this.root.removeEventListener("mousemove", this.mousemoveFunc);
|
|
4856
4859
|
FULLSCREEN_EVENTS.forEach(function(item) {
|
|
4857
|
-
document.removeEventListener(item,
|
|
4860
|
+
document.removeEventListener(item, _this5.onFullscreenChange);
|
|
4858
4861
|
});
|
|
4859
4862
|
this.playFunc && this.off(PLAY, this.playFunc);
|
|
4860
4863
|
this.off(CANPLAY, this.canPlayFunc);
|
|
@@ -4873,7 +4876,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4873
4876
|
}, {
|
|
4874
4877
|
key: "_startInit",
|
|
4875
4878
|
value: function _startInit(url) {
|
|
4876
|
-
var
|
|
4879
|
+
var _this6 = this;
|
|
4877
4880
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
4878
4881
|
if (!this.media) {
|
|
4879
4882
|
return;
|
|
@@ -4926,13 +4929,13 @@ var __publicField = (obj, key, value) => {
|
|
|
4926
4929
|
this.hasStart = true;
|
|
4927
4930
|
this.setState(STATES.ATTACHED);
|
|
4928
4931
|
util.setTimeout(this, function() {
|
|
4929
|
-
|
|
4932
|
+
_this6.emit(COMPLETE);
|
|
4930
4933
|
}, 0);
|
|
4931
4934
|
}
|
|
4932
4935
|
}, {
|
|
4933
4936
|
key: "_registerPlugins",
|
|
4934
4937
|
value: function _registerPlugins() {
|
|
4935
|
-
var
|
|
4938
|
+
var _this7 = this;
|
|
4936
4939
|
var isInit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
4937
4940
|
this._loadingPlugins = [];
|
|
4938
4941
|
var ignores = this.config.ignores || [];
|
|
@@ -4951,19 +4954,19 @@ var __publicField = (obj, key, value) => {
|
|
|
4951
4954
|
return;
|
|
4952
4955
|
}
|
|
4953
4956
|
if (plugin.lazy && plugin.loader) {
|
|
4954
|
-
var loadingPlugin = pluginsManager.lazyRegister(
|
|
4957
|
+
var loadingPlugin = pluginsManager.lazyRegister(_this7, plugin);
|
|
4955
4958
|
if (plugin.forceBeforeInit) {
|
|
4956
4959
|
loadingPlugin.then(function() {
|
|
4957
|
-
|
|
4960
|
+
_this7._loadingPlugins.splice(_this7._loadingPlugins.indexOf(loadingPlugin), 1);
|
|
4958
4961
|
}).catch(function(e) {
|
|
4959
4962
|
XG_DEBUG.logError("_registerPlugins:loadingPlugin", e);
|
|
4960
|
-
|
|
4963
|
+
_this7._loadingPlugins.splice(_this7._loadingPlugins.indexOf(loadingPlugin), 1);
|
|
4961
4964
|
});
|
|
4962
|
-
|
|
4965
|
+
_this7._loadingPlugins.push(loadingPlugin);
|
|
4963
4966
|
}
|
|
4964
4967
|
return;
|
|
4965
4968
|
}
|
|
4966
|
-
return
|
|
4969
|
+
return _this7.registerPlugin(plugin);
|
|
4967
4970
|
} catch (err) {
|
|
4968
4971
|
XG_DEBUG.logError("_registerPlugins:", err);
|
|
4969
4972
|
}
|
|
@@ -4972,9 +4975,9 @@ var __publicField = (obj, key, value) => {
|
|
|
4972
4975
|
}, {
|
|
4973
4976
|
key: "_registerPresets",
|
|
4974
4977
|
value: function _registerPresets() {
|
|
4975
|
-
var
|
|
4978
|
+
var _this8 = this;
|
|
4976
4979
|
this.config.presets.forEach(function(preset) {
|
|
4977
|
-
usePreset(
|
|
4980
|
+
usePreset(_this8, preset);
|
|
4978
4981
|
});
|
|
4979
4982
|
}
|
|
4980
4983
|
}, {
|
|
@@ -5124,7 +5127,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5124
5127
|
}, {
|
|
5125
5128
|
key: "start",
|
|
5126
5129
|
value: function start(url) {
|
|
5127
|
-
var
|
|
5130
|
+
var _this9 = this;
|
|
5128
5131
|
if (this.state > STATES.ATTACHING) {
|
|
5129
5132
|
return;
|
|
5130
5133
|
}
|
|
@@ -5139,14 +5142,14 @@ var __publicField = (obj, key, value) => {
|
|
|
5139
5142
|
this.setState(STATES.ATTACHING);
|
|
5140
5143
|
this._registerPlugins(false);
|
|
5141
5144
|
return pluginsManager.beforeInit(this).then(function() {
|
|
5142
|
-
if (!
|
|
5145
|
+
if (!_this9.config) {
|
|
5143
5146
|
return;
|
|
5144
5147
|
}
|
|
5145
5148
|
if (!url) {
|
|
5146
|
-
url =
|
|
5149
|
+
url = _this9.url || _this9.config.url;
|
|
5147
5150
|
}
|
|
5148
|
-
var _furl =
|
|
5149
|
-
var ret =
|
|
5151
|
+
var _furl = _this9.preProcessUrl(url);
|
|
5152
|
+
var ret = _this9._startInit(_furl.url, {
|
|
5150
5153
|
playSessionId
|
|
5151
5154
|
});
|
|
5152
5155
|
return ret;
|
|
@@ -5160,7 +5163,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5160
5163
|
}, {
|
|
5161
5164
|
key: "switchURL",
|
|
5162
5165
|
value: function switchURL(url, options) {
|
|
5163
|
-
var
|
|
5166
|
+
var _this10 = this;
|
|
5164
5167
|
var _src = url;
|
|
5165
5168
|
if (util.typeOf(url) === "Object") {
|
|
5166
5169
|
_src = url.url;
|
|
@@ -5172,32 +5175,32 @@ var __publicField = (obj, key, value) => {
|
|
|
5172
5175
|
this.src = _src;
|
|
5173
5176
|
return new Promise(function(resolve, reject) {
|
|
5174
5177
|
var _error = function _error2(e) {
|
|
5175
|
-
|
|
5176
|
-
|
|
5178
|
+
_this10.off("timeupdate", _canplay);
|
|
5179
|
+
_this10.off("canplay", _canplay);
|
|
5177
5180
|
reject(e);
|
|
5178
5181
|
};
|
|
5179
5182
|
var _canplay = function _canplay2() {
|
|
5180
|
-
|
|
5183
|
+
_this10._seekToStartTime();
|
|
5181
5184
|
if (isPaused) {
|
|
5182
|
-
|
|
5185
|
+
_this10.pause();
|
|
5183
5186
|
}
|
|
5184
|
-
|
|
5187
|
+
_this10.off("error", _error);
|
|
5185
5188
|
resolve(true);
|
|
5186
5189
|
};
|
|
5187
|
-
|
|
5190
|
+
_this10.once("error", _error);
|
|
5188
5191
|
if (!_src) {
|
|
5189
|
-
|
|
5192
|
+
_this10.errorHandler("error", {
|
|
5190
5193
|
code: 6,
|
|
5191
5194
|
message: "empty_src"
|
|
5192
5195
|
});
|
|
5193
5196
|
return;
|
|
5194
5197
|
}
|
|
5195
5198
|
if (sniffer.os.isAndroid) {
|
|
5196
|
-
|
|
5199
|
+
_this10.once("timeupdate", _canplay);
|
|
5197
5200
|
} else {
|
|
5198
|
-
|
|
5201
|
+
_this10.once("canplay", _canplay);
|
|
5199
5202
|
}
|
|
5200
|
-
|
|
5203
|
+
_this10.play();
|
|
5201
5204
|
});
|
|
5202
5205
|
}
|
|
5203
5206
|
}, {
|
|
@@ -5208,7 +5211,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5208
5211
|
}, {
|
|
5209
5212
|
key: "mediaPlay",
|
|
5210
5213
|
value: function mediaPlay() {
|
|
5211
|
-
var
|
|
5214
|
+
var _this11 = this;
|
|
5212
5215
|
if (!this.hasStart && this.state < STATES.ATTACHED) {
|
|
5213
5216
|
this.removeClass(STATE_CLASS.NO_START);
|
|
5214
5217
|
this.addClass(STATE_CLASS.ENTER);
|
|
@@ -5223,28 +5226,28 @@ var __publicField = (obj, key, value) => {
|
|
|
5223
5226
|
var playPromise = _get(_getPrototypeOf(Player2.prototype), "play", this).call(this);
|
|
5224
5227
|
if (playPromise !== void 0 && playPromise && playPromise.then) {
|
|
5225
5228
|
playPromise.then(function() {
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
if (
|
|
5229
|
+
_this11.removeClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
|
|
5230
|
+
_this11.addClass(STATE_CLASS.PLAYING);
|
|
5231
|
+
if (_this11.state < STATES.RUNNING) {
|
|
5229
5232
|
XG_DEBUG.logInfo(">>>>playPromise.then");
|
|
5230
|
-
|
|
5231
|
-
|
|
5233
|
+
_this11.setState(STATES.RUNNING);
|
|
5234
|
+
_this11.emit(AUTOPLAY_STARTED);
|
|
5232
5235
|
}
|
|
5233
5236
|
}).catch(function(e) {
|
|
5234
5237
|
XG_DEBUG.logWarn(">>>>playPromise.catch", e.name);
|
|
5235
|
-
if (
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
+
if (_this11.media && _this11.media.error) {
|
|
5239
|
+
_this11.onError();
|
|
5240
|
+
_this11.removeClass(STATE_CLASS.ENTER);
|
|
5238
5241
|
return;
|
|
5239
5242
|
}
|
|
5240
5243
|
if (e.name === "NotAllowedError") {
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5244
|
+
_this11._errorTimer = util.setTimeout(_this11, function() {
|
|
5245
|
+
_this11._errorTimer = null;
|
|
5246
|
+
_this11.emit(AUTOPLAY_PREVENTED);
|
|
5247
|
+
_this11.addClass(STATE_CLASS.NOT_ALLOW_AUTOPLAY);
|
|
5248
|
+
_this11.removeClass(STATE_CLASS.ENTER);
|
|
5249
|
+
_this11.pause();
|
|
5250
|
+
_this11.setState(STATES.NOTALLOW);
|
|
5248
5251
|
}, 0);
|
|
5249
5252
|
}
|
|
5250
5253
|
});
|
|
@@ -5274,24 +5277,24 @@ var __publicField = (obj, key, value) => {
|
|
|
5274
5277
|
}, {
|
|
5275
5278
|
key: "play",
|
|
5276
5279
|
value: function play() {
|
|
5277
|
-
var
|
|
5280
|
+
var _this12 = this;
|
|
5278
5281
|
this.removeClass(STATE_CLASS.PAUSED);
|
|
5279
5282
|
return runHooks(this, "play", function() {
|
|
5280
|
-
return
|
|
5283
|
+
return _this12.mediaPlay();
|
|
5281
5284
|
});
|
|
5282
5285
|
}
|
|
5283
5286
|
}, {
|
|
5284
5287
|
key: "pause",
|
|
5285
5288
|
value: function pause() {
|
|
5286
|
-
var
|
|
5289
|
+
var _this13 = this;
|
|
5287
5290
|
runHooks(this, "pause", function() {
|
|
5288
|
-
_get(_getPrototypeOf(Player2.prototype), "pause",
|
|
5291
|
+
_get(_getPrototypeOf(Player2.prototype), "pause", _this13).call(_this13);
|
|
5289
5292
|
});
|
|
5290
5293
|
}
|
|
5291
5294
|
}, {
|
|
5292
5295
|
key: "seek",
|
|
5293
5296
|
value: function seek(time, status) {
|
|
5294
|
-
var
|
|
5297
|
+
var _this14 = this;
|
|
5295
5298
|
if (!this.media || Number.isNaN(Number(time)) || !this.hasStart) {
|
|
5296
5299
|
return;
|
|
5297
5300
|
}
|
|
@@ -5301,20 +5304,20 @@ var __publicField = (obj, key, value) => {
|
|
|
5301
5304
|
!this._isPauseBeforeSeek && (this._isPauseBeforeSeek = this.paused ? 2 : 1);
|
|
5302
5305
|
this._onceSeekCanplay && this.off(SEEKED, this._onceSeekCanplay);
|
|
5303
5306
|
this._onceSeekCanplay = function() {
|
|
5304
|
-
|
|
5305
|
-
|
|
5307
|
+
_this14.removeClass(STATE_CLASS.ENTER);
|
|
5308
|
+
_this14.isSeeking = false;
|
|
5306
5309
|
switch (_status) {
|
|
5307
5310
|
case "play":
|
|
5308
|
-
|
|
5311
|
+
_this14.play();
|
|
5309
5312
|
break;
|
|
5310
5313
|
case "pause":
|
|
5311
|
-
|
|
5314
|
+
_this14.pause();
|
|
5312
5315
|
break;
|
|
5313
5316
|
default:
|
|
5314
|
-
|
|
5317
|
+
_this14._isPauseBeforeSeek > 1 || _this14.paused ? _this14.pause() : _this14.play();
|
|
5315
5318
|
}
|
|
5316
|
-
|
|
5317
|
-
|
|
5319
|
+
_this14._isPauseBeforeSeek = 0;
|
|
5320
|
+
_this14._onceSeekCanplay = null;
|
|
5318
5321
|
};
|
|
5319
5322
|
this.once(SEEKED, this._onceSeekCanplay);
|
|
5320
5323
|
if (this.state < STATES.RUNNING) {
|
|
@@ -5328,13 +5331,13 @@ var __publicField = (obj, key, value) => {
|
|
|
5328
5331
|
}, {
|
|
5329
5332
|
key: "getInitDefinition",
|
|
5330
5333
|
value: function getInitDefinition() {
|
|
5331
|
-
var
|
|
5334
|
+
var _this15 = this;
|
|
5332
5335
|
var _this$config5 = this.config, definition = _this$config5.definition, url = _this$config5.url;
|
|
5333
5336
|
if (!url && definition && definition.list && definition.list.length > 0 && definition.defaultDefinition) {
|
|
5334
5337
|
definition.list.map(function(item) {
|
|
5335
5338
|
if (item.definition === definition.defaultDefinition) {
|
|
5336
|
-
|
|
5337
|
-
|
|
5339
|
+
_this15.config.url = item.url;
|
|
5340
|
+
_this15.curDefinition = item;
|
|
5338
5341
|
}
|
|
5339
5342
|
});
|
|
5340
5343
|
}
|
|
@@ -5342,12 +5345,12 @@ var __publicField = (obj, key, value) => {
|
|
|
5342
5345
|
}, {
|
|
5343
5346
|
key: "changeDefinition",
|
|
5344
5347
|
value: function changeDefinition(to, from) {
|
|
5345
|
-
var
|
|
5348
|
+
var _this16 = this;
|
|
5346
5349
|
var definition = this.config.definition;
|
|
5347
5350
|
if (Array.isArray(definition === null || definition === void 0 ? void 0 : definition.list)) {
|
|
5348
5351
|
definition.list.forEach(function(item) {
|
|
5349
5352
|
if ((to === null || to === void 0 ? void 0 : to.definition) === item.definition) {
|
|
5350
|
-
|
|
5353
|
+
_this16.curDefinition = item;
|
|
5351
5354
|
}
|
|
5352
5355
|
});
|
|
5353
5356
|
}
|
|
@@ -5367,7 +5370,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5367
5370
|
}, to));
|
|
5368
5371
|
if (ret && ret.then) {
|
|
5369
5372
|
ret.then(function() {
|
|
5370
|
-
|
|
5373
|
+
_this16.emit(AFTER_DEFINITION_CHANGE, {
|
|
5371
5374
|
from,
|
|
5372
5375
|
to
|
|
5373
5376
|
});
|
|
@@ -5391,7 +5394,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5391
5394
|
}, {
|
|
5392
5395
|
key: "resetState",
|
|
5393
5396
|
value: function resetState() {
|
|
5394
|
-
var
|
|
5397
|
+
var _this17 = this;
|
|
5395
5398
|
var NOT_ALLOW_AUTOPLAY = STATE_CLASS.NOT_ALLOW_AUTOPLAY, PLAYING2 = STATE_CLASS.PLAYING, NO_START = STATE_CLASS.NO_START, PAUSED = STATE_CLASS.PAUSED, REPLAY2 = STATE_CLASS.REPLAY, ENTER = STATE_CLASS.ENTER, ENDED2 = STATE_CLASS.ENDED, ERROR2 = STATE_CLASS.ERROR, LOADING2 = STATE_CLASS.LOADING;
|
|
5396
5399
|
var clsList = [NOT_ALLOW_AUTOPLAY, PLAYING2, NO_START, PAUSED, REPLAY2, ENTER, ENDED2, ERROR2, LOADING2];
|
|
5397
5400
|
this.hasStart = false;
|
|
@@ -5402,7 +5405,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5402
5405
|
this._accPlayed.t = 0;
|
|
5403
5406
|
this._accPlayed.loopAcc = 0;
|
|
5404
5407
|
clsList.forEach(function(cls) {
|
|
5405
|
-
|
|
5408
|
+
_this17.removeClass(cls);
|
|
5406
5409
|
});
|
|
5407
5410
|
this.addClass(STATE_CLASS.NO_START);
|
|
5408
5411
|
this.emit(RESET);
|
|
@@ -5410,7 +5413,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5410
5413
|
}, {
|
|
5411
5414
|
key: "reset",
|
|
5412
5415
|
value: function reset() {
|
|
5413
|
-
var
|
|
5416
|
+
var _this18 = this;
|
|
5414
5417
|
var unregisterPlugins = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
5415
5418
|
var isResetConfig = arguments.length > 1 ? arguments[1] : void 0;
|
|
5416
5419
|
this.resetState();
|
|
@@ -5419,13 +5422,13 @@ var __publicField = (obj, key, value) => {
|
|
|
5419
5422
|
return;
|
|
5420
5423
|
}
|
|
5421
5424
|
unregisterPlugins.map(function(pn) {
|
|
5422
|
-
|
|
5425
|
+
_this18.deregister(pn);
|
|
5423
5426
|
});
|
|
5424
5427
|
if (isResetConfig) {
|
|
5425
5428
|
var de = getDefaultConfig$1();
|
|
5426
5429
|
Object.keys(this.config).forEach(function(k) {
|
|
5427
|
-
if (
|
|
5428
|
-
|
|
5430
|
+
if (_this18.config[k] !== "undefined" && (k === "plugins" || k === "presets" || k === "el" || k === "id")) {
|
|
5431
|
+
_this18.config[k] = de[k];
|
|
5429
5432
|
}
|
|
5430
5433
|
});
|
|
5431
5434
|
}
|
|
@@ -5433,7 +5436,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5433
5436
|
}, {
|
|
5434
5437
|
key: "destroy",
|
|
5435
5438
|
value: function destroy() {
|
|
5436
|
-
var _instManager2,
|
|
5439
|
+
var _instManager2, _this19 = this;
|
|
5437
5440
|
var innerContainer = this.innerContainer, root2 = this.root, media = this.media;
|
|
5438
5441
|
if (!root2 || !media) {
|
|
5439
5442
|
return;
|
|
@@ -5462,8 +5465,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5462
5465
|
}
|
|
5463
5466
|
!innerContainer && media instanceof window.Node && root2.contains(media) && !this.config.remainMediaAfterDestroy && root2.removeChild(media);
|
|
5464
5467
|
["topBar", "leftBar", "rightBar", "innerContainer"].map(function(item) {
|
|
5465
|
-
|
|
5466
|
-
|
|
5468
|
+
_this19[item] && root2.removeChild(_this19[item]);
|
|
5469
|
+
_this19[item] = null;
|
|
5467
5470
|
});
|
|
5468
5471
|
var cList = root2.className.split(" ");
|
|
5469
5472
|
if (cList.length > 0) {
|
|
@@ -5475,45 +5478,45 @@ var __publicField = (obj, key, value) => {
|
|
|
5475
5478
|
}
|
|
5476
5479
|
this.removeAttribute("data-xgfill");
|
|
5477
5480
|
["isSeeking", "isCanplay", "isActive", "cssfullscreen", "fullscreen"].forEach(function(key) {
|
|
5478
|
-
|
|
5481
|
+
_this19[key] = false;
|
|
5479
5482
|
});
|
|
5480
5483
|
}
|
|
5481
5484
|
}, {
|
|
5482
5485
|
key: "replay",
|
|
5483
5486
|
value: function replay() {
|
|
5484
|
-
var
|
|
5487
|
+
var _this20 = this;
|
|
5485
5488
|
this.removeClass(STATE_CLASS.ENDED);
|
|
5486
5489
|
this.currentTime = 0;
|
|
5487
5490
|
this.isSeeking = false;
|
|
5488
5491
|
runHooks(this, "replay", function() {
|
|
5489
|
-
|
|
5490
|
-
var playPromise =
|
|
5492
|
+
_this20.once(SEEKED, function() {
|
|
5493
|
+
var playPromise = _this20.mediaPlay();
|
|
5491
5494
|
if (playPromise && playPromise.catch) {
|
|
5492
5495
|
playPromise.catch(function(err) {
|
|
5493
5496
|
console.log(err);
|
|
5494
5497
|
});
|
|
5495
5498
|
}
|
|
5496
5499
|
});
|
|
5497
|
-
|
|
5498
|
-
|
|
5500
|
+
_this20.emit(REPLAY);
|
|
5501
|
+
_this20.onPlay();
|
|
5499
5502
|
});
|
|
5500
5503
|
}
|
|
5501
5504
|
}, {
|
|
5502
5505
|
key: "retry",
|
|
5503
5506
|
value: function retry() {
|
|
5504
|
-
var
|
|
5507
|
+
var _this21 = this;
|
|
5505
5508
|
this.removeClass(STATE_CLASS.ERROR);
|
|
5506
5509
|
this.addClass(STATE_CLASS.LOADING);
|
|
5507
5510
|
runHooks(this, "retry", function() {
|
|
5508
|
-
var cur =
|
|
5509
|
-
var url =
|
|
5510
|
-
var _srcRet = !util.isMSE(
|
|
5511
|
+
var cur = _this21.currentTime;
|
|
5512
|
+
var url = _this21.config.url;
|
|
5513
|
+
var _srcRet = !util.isMSE(_this21.media) ? _this21.preProcessUrl(url) : {
|
|
5511
5514
|
url
|
|
5512
5515
|
};
|
|
5513
|
-
|
|
5514
|
-
!
|
|
5515
|
-
|
|
5516
|
-
|
|
5516
|
+
_this21.src = _srcRet.url;
|
|
5517
|
+
!_this21.config.isLive && (_this21.currentTime = cur);
|
|
5518
|
+
_this21.once(CANPLAY, function() {
|
|
5519
|
+
_this21.mediaPlay();
|
|
5517
5520
|
});
|
|
5518
5521
|
});
|
|
5519
5522
|
}
|
|
@@ -5748,7 +5751,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5748
5751
|
}, {
|
|
5749
5752
|
key: "onFocus",
|
|
5750
5753
|
value: function onFocus() {
|
|
5751
|
-
var
|
|
5754
|
+
var _this22 = this;
|
|
5752
5755
|
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
5753
5756
|
autoHide: true,
|
|
5754
5757
|
delay: 3e3
|
|
@@ -5766,8 +5769,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5766
5769
|
}
|
|
5767
5770
|
var time = data && data.delay ? data.delay : this.config.inactive;
|
|
5768
5771
|
this.userTimer = util.setTimeout(this, function() {
|
|
5769
|
-
|
|
5770
|
-
|
|
5772
|
+
_this22.userTimer = null;
|
|
5773
|
+
_this22.blur();
|
|
5771
5774
|
}, time);
|
|
5772
5775
|
}
|
|
5773
5776
|
}, {
|
|
@@ -5800,7 +5803,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5800
5803
|
}, {
|
|
5801
5804
|
key: "onLoadeddata",
|
|
5802
5805
|
value: function onLoadeddata() {
|
|
5803
|
-
var
|
|
5806
|
+
var _this23 = this;
|
|
5804
5807
|
this.isError = false;
|
|
5805
5808
|
this.isSeeking = false;
|
|
5806
5809
|
if (this.__startTime > 0) {
|
|
@@ -5808,7 +5811,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5808
5811
|
this._seekToStartTime();
|
|
5809
5812
|
} else {
|
|
5810
5813
|
this.once(DURATION_CHANGE, function() {
|
|
5811
|
-
|
|
5814
|
+
_this23._seekToStartTime();
|
|
5812
5815
|
});
|
|
5813
5816
|
}
|
|
5814
5817
|
}
|
|
@@ -5879,27 +5882,27 @@ var __publicField = (obj, key, value) => {
|
|
|
5879
5882
|
}, {
|
|
5880
5883
|
key: "onWaiting",
|
|
5881
5884
|
value: function onWaiting() {
|
|
5882
|
-
var
|
|
5885
|
+
var _this24 = this;
|
|
5883
5886
|
if (this.waitTimer) {
|
|
5884
5887
|
util.clearTimeout(this, this.waitTimer);
|
|
5885
5888
|
}
|
|
5886
5889
|
this.updateAcc("waiting");
|
|
5887
5890
|
this.waitTimer = util.setTimeout(this, function() {
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
util.clearTimeout(
|
|
5891
|
-
|
|
5891
|
+
_this24.addClass(STATE_CLASS.LOADING);
|
|
5892
|
+
_this24.emit(LOADING);
|
|
5893
|
+
util.clearTimeout(_this24, _this24.waitTimer);
|
|
5894
|
+
_this24.waitTimer = null;
|
|
5892
5895
|
}, this.config.minWaitDelay);
|
|
5893
5896
|
}
|
|
5894
5897
|
}, {
|
|
5895
5898
|
key: "onPlaying",
|
|
5896
5899
|
value: function onPlaying() {
|
|
5897
|
-
var
|
|
5900
|
+
var _this25 = this;
|
|
5898
5901
|
this.isError = false;
|
|
5899
5902
|
var NO_START = STATE_CLASS.NO_START, PAUSED = STATE_CLASS.PAUSED, ENDED2 = STATE_CLASS.ENDED, ERROR2 = STATE_CLASS.ERROR, REPLAY2 = STATE_CLASS.REPLAY, LOADING2 = STATE_CLASS.LOADING;
|
|
5900
5903
|
var clsList = [NO_START, PAUSED, ENDED2, ERROR2, REPLAY2, LOADING2];
|
|
5901
5904
|
clsList.forEach(function(cls) {
|
|
5902
|
-
|
|
5905
|
+
_this25.removeClass(cls);
|
|
5903
5906
|
});
|
|
5904
5907
|
if (!this._accPlayed.t && !this.paused && !this.ended) {
|
|
5905
5908
|
this._accPlayed.t = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -5987,7 +5990,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5987
5990
|
}, {
|
|
5988
5991
|
key: "resizePosition",
|
|
5989
5992
|
value: function resizePosition() {
|
|
5990
|
-
var
|
|
5993
|
+
var _this26 = this;
|
|
5991
5994
|
var _this$videoPos = this.videoPos, vy = _this$videoPos.vy, vx = _this$videoPos.vx, h = _this$videoPos.h, w = _this$videoPos.w;
|
|
5992
5995
|
var rotate = this.videoPos.rotate;
|
|
5993
5996
|
if (rotate < 0 && h < 0 && w < 0) {
|
|
@@ -6044,7 +6047,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6044
6047
|
styles.transform = formStyle;
|
|
6045
6048
|
styles.webkitTransform = formStyle;
|
|
6046
6049
|
Object.keys(styles).map(function(key) {
|
|
6047
|
-
|
|
6050
|
+
_this26.media.style[key] = styles[key];
|
|
6048
6051
|
});
|
|
6049
6052
|
}
|
|
6050
6053
|
}, {
|
|
@@ -6069,14 +6072,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6069
6072
|
}, {
|
|
6070
6073
|
key: "setConfig",
|
|
6071
6074
|
value: function setConfig(config) {
|
|
6072
|
-
var
|
|
6075
|
+
var _this27 = this;
|
|
6073
6076
|
if (!config) {
|
|
6074
6077
|
return;
|
|
6075
6078
|
}
|
|
6076
6079
|
Object.keys(config).map(function(key) {
|
|
6077
6080
|
if (key !== "plugins") {
|
|
6078
|
-
|
|
6079
|
-
var plugin =
|
|
6081
|
+
_this27.config[key] = config[key];
|
|
6082
|
+
var plugin = _this27.plugins[key.toLowerCase()];
|
|
6080
6083
|
if (plugin && util.typeOf(plugin.setConfig) === "Function") {
|
|
6081
6084
|
plugin.setConfig(config[key]);
|
|
6082
6085
|
}
|
|
@@ -6086,20 +6089,20 @@ var __publicField = (obj, key, value) => {
|
|
|
6086
6089
|
}, {
|
|
6087
6090
|
key: "playNext",
|
|
6088
6091
|
value: function playNext(config) {
|
|
6089
|
-
var
|
|
6092
|
+
var _this28 = this;
|
|
6090
6093
|
this.resetState();
|
|
6091
6094
|
this.setConfig(config);
|
|
6092
6095
|
this._currentTime = 0;
|
|
6093
6096
|
this._duration = 0;
|
|
6094
6097
|
runHooks(this, "playnext", function() {
|
|
6095
|
-
|
|
6096
|
-
|
|
6098
|
+
_this28.start();
|
|
6099
|
+
_this28.emit(PLAYNEXT, config);
|
|
6097
6100
|
});
|
|
6098
6101
|
}
|
|
6099
6102
|
}, {
|
|
6100
6103
|
key: "resize",
|
|
6101
6104
|
value: function resize() {
|
|
6102
|
-
var
|
|
6105
|
+
var _this29 = this;
|
|
6103
6106
|
if (!this.media || !this.root) {
|
|
6104
6107
|
return;
|
|
6105
6108
|
}
|
|
@@ -6139,7 +6142,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6139
6142
|
}
|
|
6140
6143
|
if (!this.fullscreen && !this.cssfullscreen) {
|
|
6141
6144
|
Object.keys(_style).forEach(function(key) {
|
|
6142
|
-
|
|
6145
|
+
_this29.root.style[key] = _style[key];
|
|
6143
6146
|
});
|
|
6144
6147
|
}
|
|
6145
6148
|
if (videoFillMode === "fillHeight" && fit < videoFit || videoFillMode === "fillWidth" && fit > videoFit) {
|
|
@@ -6239,15 +6242,15 @@ var __publicField = (obj, key, value) => {
|
|
|
6239
6242
|
return this.config.definition.list || [];
|
|
6240
6243
|
},
|
|
6241
6244
|
set: function set(list) {
|
|
6242
|
-
var
|
|
6245
|
+
var _this30 = this;
|
|
6243
6246
|
var definition = this.config.definition;
|
|
6244
6247
|
var curDef = null;
|
|
6245
6248
|
var targetDef = null;
|
|
6246
6249
|
definition.list = list;
|
|
6247
6250
|
this.emit("resourceReady", list);
|
|
6248
6251
|
list.forEach(function(item) {
|
|
6249
|
-
var
|
|
6250
|
-
if (((
|
|
6252
|
+
var _this30$curDefinition;
|
|
6253
|
+
if (((_this30$curDefinition = _this30.curDefinition) === null || _this30$curDefinition === void 0 ? void 0 : _this30$curDefinition.definition) === item.definition) {
|
|
6251
6254
|
curDef = item;
|
|
6252
6255
|
}
|
|
6253
6256
|
if (definition.defaultDefinition === item.definition) {
|
|
@@ -6423,6 +6426,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6423
6426
|
value: function hook$1(hookName, handler) {
|
|
6424
6427
|
return hook.call.apply(hook, [this].concat(Array.prototype.slice.call(arguments)));
|
|
6425
6428
|
}
|
|
6429
|
+
}, {
|
|
6430
|
+
key: "runHooks",
|
|
6431
|
+
value: function runHooks$1() {
|
|
6432
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
6433
|
+
args[_key] = arguments[_key];
|
|
6434
|
+
}
|
|
6435
|
+
return runHooks.call.apply(runHooks, [this].concat(Array.prototype.slice.call(arguments)));
|
|
6436
|
+
}
|
|
6426
6437
|
}, {
|
|
6427
6438
|
key: "useHooks",
|
|
6428
6439
|
value: function useHooks$1(hookName, handler) {
|
|
@@ -6436,16 +6447,16 @@ var __publicField = (obj, key, value) => {
|
|
|
6436
6447
|
}, {
|
|
6437
6448
|
key: "usePluginHooks",
|
|
6438
6449
|
value: function usePluginHooks$1(pluginName, hookName, handler) {
|
|
6439
|
-
for (var
|
|
6440
|
-
args[
|
|
6450
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
|
6451
|
+
args[_key2 - 3] = arguments[_key2];
|
|
6441
6452
|
}
|
|
6442
6453
|
return usePluginHooks.call.apply(usePluginHooks, [this].concat(Array.prototype.slice.call(arguments)));
|
|
6443
6454
|
}
|
|
6444
6455
|
}, {
|
|
6445
6456
|
key: "removePluginHooks",
|
|
6446
6457
|
value: function removePluginHooks$1(pluginName, hookName, handler) {
|
|
6447
|
-
for (var
|
|
6448
|
-
args[
|
|
6458
|
+
for (var _len3 = arguments.length, args = new Array(_len3 > 3 ? _len3 - 3 : 0), _key3 = 3; _key3 < _len3; _key3++) {
|
|
6459
|
+
args[_key3 - 3] = arguments[_key3];
|
|
6449
6460
|
}
|
|
6450
6461
|
return removePluginHooks.call.apply(removePluginHooks, [this].concat(Array.prototype.slice.call(arguments)));
|
|
6451
6462
|
}
|
|
@@ -14501,7 +14512,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14501
14512
|
* @brief Retrieve the player SDK version number.
|
|
14502
14513
|
*/
|
|
14503
14514
|
get playerVersion() {
|
|
14504
|
-
return "2.12.0-rc.
|
|
14515
|
+
return "2.12.0-rc.2";
|
|
14505
14516
|
}
|
|
14506
14517
|
/** {zh}
|
|
14507
14518
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|