@volcengine/veplayer 2.2.0-rc.2 → 2.3.0-rc.0
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/LICENSE +20 -0
- package/esm/index.d.ts +84 -88
- package/esm/veplayer.biz.live.development.js +104 -27
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +327 -178
- package/esm/veplayer.development.css +1 -1
- package/esm/veplayer.development.js +458 -143
- package/esm/veplayer.live.d.ts +327 -178
- package/esm/veplayer.live.development.css +1 -1
- package/esm/veplayer.live.development.js +458 -143
- package/esm/veplayer.live.production.css +1 -1
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.css +1 -1
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +84 -88
- package/esm/veplayer.vod.development.css +1 -1
- package/esm/veplayer.vod.development.js +366 -125
- package/esm/veplayer.vod.production.css +1 -1
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/index.d.ts +84 -88
- package/umd/veplayer.biz.live.development.js +107 -30
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.biz.vod.development.js +3 -2
- package/umd/veplayer.biz.vod.production.js +1 -1
- package/umd/veplayer.d.ts +327 -178
- package/umd/veplayer.development.css +1 -1
- package/umd/veplayer.development.js +457 -142
- package/umd/veplayer.live.d.ts +327 -178
- package/umd/veplayer.live.development.css +1 -1
- package/umd/veplayer.live.development.js +460 -145
- package/umd/veplayer.live.production.css +1 -1
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.css +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +84 -88
- package/umd/veplayer.vod.development.css +1 -1
- package/umd/veplayer.vod.development.js +371 -130
- package/umd/veplayer.vod.production.css +1 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +327 -178
- package/veplayer.live.d.ts +327 -178
- package/veplayer.vod.d.ts +84 -88
|
@@ -43,8 +43,8 @@ function _typeof(obj) {
|
|
|
43
43
|
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
|
|
44
44
|
}, _typeof(obj);
|
|
45
45
|
}
|
|
46
|
-
function _classCallCheck(
|
|
47
|
-
if (!(
|
|
46
|
+
function _classCallCheck(instance2, Constructor) {
|
|
47
|
+
if (!(instance2 instanceof Constructor)) {
|
|
48
48
|
throw new TypeError("Cannot call a class as a function");
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1449,7 +1449,7 @@ var sniffer = {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
|
-
var version = "3.0.
|
|
1452
|
+
var version = "3.0.12";
|
|
1453
1453
|
var ERROR_TYPE_MAP = {
|
|
1454
1454
|
1: "media",
|
|
1455
1455
|
2: "media",
|
|
@@ -2311,10 +2311,10 @@ var INDEXDB = /* @__PURE__ */ function() {
|
|
|
2311
2311
|
}, {
|
|
2312
2312
|
key: "addData",
|
|
2313
2313
|
value: function addData(storename, data) {
|
|
2314
|
-
var
|
|
2314
|
+
var store2 = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
|
|
2315
2315
|
var request;
|
|
2316
2316
|
for (var i = 0; i < data.length; i++) {
|
|
2317
|
-
request =
|
|
2317
|
+
request = store2.add(data[i]);
|
|
2318
2318
|
request.onerror = function() {
|
|
2319
2319
|
};
|
|
2320
2320
|
request.onsuccess = function() {
|
|
@@ -2324,10 +2324,10 @@ var INDEXDB = /* @__PURE__ */ function() {
|
|
|
2324
2324
|
}, {
|
|
2325
2325
|
key: "putData",
|
|
2326
2326
|
value: function putData(storename, data) {
|
|
2327
|
-
var
|
|
2327
|
+
var store2 = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
|
|
2328
2328
|
var request;
|
|
2329
2329
|
for (var i = 0; i < data.length; i++) {
|
|
2330
|
-
request =
|
|
2330
|
+
request = store2.put(data[i]);
|
|
2331
2331
|
request.onerror = function() {
|
|
2332
2332
|
};
|
|
2333
2333
|
request.onsuccess = function() {
|
|
@@ -2338,8 +2338,8 @@ var INDEXDB = /* @__PURE__ */ function() {
|
|
|
2338
2338
|
key: "getDataByKey",
|
|
2339
2339
|
value: function getDataByKey(storename, key, callback) {
|
|
2340
2340
|
var self2 = this;
|
|
2341
|
-
var
|
|
2342
|
-
var request =
|
|
2341
|
+
var store2 = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
|
|
2342
|
+
var request = store2.get(key);
|
|
2343
2343
|
request.onerror = function() {
|
|
2344
2344
|
callback.call(self2, null);
|
|
2345
2345
|
};
|
|
@@ -2351,14 +2351,14 @@ var INDEXDB = /* @__PURE__ */ function() {
|
|
|
2351
2351
|
}, {
|
|
2352
2352
|
key: "deleteData",
|
|
2353
2353
|
value: function deleteData(storename, key) {
|
|
2354
|
-
var
|
|
2355
|
-
|
|
2354
|
+
var store2 = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
|
|
2355
|
+
store2.delete(key);
|
|
2356
2356
|
}
|
|
2357
2357
|
}, {
|
|
2358
2358
|
key: "clearData",
|
|
2359
2359
|
value: function clearData(storename) {
|
|
2360
|
-
var
|
|
2361
|
-
|
|
2360
|
+
var store2 = this.myDB.db.transaction(storename, "readwrite").objectStore(storename);
|
|
2361
|
+
store2.clear();
|
|
2362
2362
|
}
|
|
2363
2363
|
}]);
|
|
2364
2364
|
return INDEXDB2;
|
|
@@ -2475,24 +2475,24 @@ function removePluginHooks(pluginName) {
|
|
|
2475
2475
|
return plugin.removeHooks && plugin.removeHooks.apply(plugin, args);
|
|
2476
2476
|
}
|
|
2477
2477
|
}
|
|
2478
|
-
function hooksDescriptor(
|
|
2478
|
+
function hooksDescriptor(instance2) {
|
|
2479
2479
|
var presetHooks = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
|
|
2480
|
-
|
|
2480
|
+
instance2.__hooks = {};
|
|
2481
2481
|
presetHooks && presetHooks.map(function(item) {
|
|
2482
|
-
|
|
2482
|
+
instance2.__hooks[item] = null;
|
|
2483
2483
|
});
|
|
2484
|
-
Object.defineProperty(
|
|
2484
|
+
Object.defineProperty(instance2, "hooks", {
|
|
2485
2485
|
get: function get() {
|
|
2486
|
-
return
|
|
2487
|
-
if (
|
|
2486
|
+
return instance2.__hooks && Object.keys(instance2.__hooks).map(function(key) {
|
|
2487
|
+
if (instance2.__hooks[key]) {
|
|
2488
2488
|
return key;
|
|
2489
2489
|
}
|
|
2490
2490
|
});
|
|
2491
2491
|
}
|
|
2492
2492
|
});
|
|
2493
2493
|
}
|
|
2494
|
-
function delHooksDescriptor(
|
|
2495
|
-
|
|
2494
|
+
function delHooksDescriptor(instance2) {
|
|
2495
|
+
instance2.__hooks = null;
|
|
2496
2496
|
}
|
|
2497
2497
|
function runHooks(obj, hookName, handler) {
|
|
2498
2498
|
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
|
@@ -3208,7 +3208,7 @@ var Plugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
3208
3208
|
var cs = window.getComputedStyle(this.root, null);
|
|
3209
3209
|
var cssDisplayValue = cs.getPropertyValue("display");
|
|
3210
3210
|
if (cssDisplayValue === "none") {
|
|
3211
|
-
|
|
3211
|
+
this.root.style.display = "block";
|
|
3212
3212
|
}
|
|
3213
3213
|
}
|
|
3214
3214
|
}, {
|
|
@@ -3465,28 +3465,11 @@ var pluginsManager = {
|
|
|
3465
3465
|
!player.config.closeResizeObserver && addObserver(player.root, function() {
|
|
3466
3466
|
player.resize();
|
|
3467
3467
|
});
|
|
3468
|
-
if (Object.keys(this.pluginGroup).length === 0) {
|
|
3469
|
-
player.isUserActive = true;
|
|
3470
|
-
}
|
|
3471
3468
|
this.pluginGroup[cgid] = {
|
|
3472
|
-
_player: player,
|
|
3473
3469
|
_originalOptions: player.config || {},
|
|
3474
3470
|
_plugins: {}
|
|
3475
3471
|
};
|
|
3476
3472
|
},
|
|
3477
|
-
checkPlayerRoot: function checkPlayerRoot(root) {
|
|
3478
|
-
if (this.pluginGroup) {
|
|
3479
|
-
var _keys = Object.keys(this.pluginGroup);
|
|
3480
|
-
for (var i = 0; i < _keys.length; i++) {
|
|
3481
|
-
var _p = this.pluginGroup[_keys[i]]._player;
|
|
3482
|
-
if (_p.root === root) {
|
|
3483
|
-
return _p;
|
|
3484
|
-
}
|
|
3485
|
-
}
|
|
3486
|
-
return null;
|
|
3487
|
-
}
|
|
3488
|
-
return null;
|
|
3489
|
-
},
|
|
3490
3473
|
formatPluginInfo: function formatPluginInfo(plugin, config) {
|
|
3491
3474
|
var PLUFGIN = null;
|
|
3492
3475
|
var options = null;
|
|
@@ -3561,7 +3544,7 @@ var pluginsManager = {
|
|
|
3561
3544
|
}
|
|
3562
3545
|
var plugins = this.pluginGroup[cgid]._plugins;
|
|
3563
3546
|
var originalOptions = this.pluginGroup[cgid]._originalOptions;
|
|
3564
|
-
options.player =
|
|
3547
|
+
options.player = player;
|
|
3565
3548
|
var pluginName = options.pluginName || plugin.pluginName;
|
|
3566
3549
|
if (!pluginName) {
|
|
3567
3550
|
throw new Error("The property pluginName is necessary");
|
|
@@ -3760,37 +3743,6 @@ var pluginsManager = {
|
|
|
3760
3743
|
}
|
|
3761
3744
|
});
|
|
3762
3745
|
},
|
|
3763
|
-
setCurrentUserActive: function setCurrentUserActive(playerId, isActive) {
|
|
3764
|
-
if (!this.pluginGroup[playerId]) {
|
|
3765
|
-
return;
|
|
3766
|
-
}
|
|
3767
|
-
if (!isActive) {
|
|
3768
|
-
this.pluginGroup[playerId]._player.isUserActive = isActive;
|
|
3769
|
-
return playerId;
|
|
3770
|
-
}
|
|
3771
|
-
var keys = Object.keys(this.pluginGroup);
|
|
3772
|
-
for (var i = 0; i < keys.length; i++) {
|
|
3773
|
-
var c = this.pluginGroup[keys[i]];
|
|
3774
|
-
if (c && c._player) {
|
|
3775
|
-
this.pluginGroup[keys[i]]._player.isUserActive = false;
|
|
3776
|
-
}
|
|
3777
|
-
}
|
|
3778
|
-
this.pluginGroup[playerId]._player.isUserActive = isActive;
|
|
3779
|
-
return playerId;
|
|
3780
|
-
},
|
|
3781
|
-
getCurrentUseActiveId: function getCurrentUseActiveId() {
|
|
3782
|
-
if (!this.pluginGroup) {
|
|
3783
|
-
return;
|
|
3784
|
-
}
|
|
3785
|
-
var keys = Object.keys(this.pluginGroup);
|
|
3786
|
-
for (var i = 0; i < keys.length; i++) {
|
|
3787
|
-
var c = this.pluginGroup[keys[i]];
|
|
3788
|
-
if (c && c._player && c._player.isUserActive) {
|
|
3789
|
-
return keys[i];
|
|
3790
|
-
}
|
|
3791
|
-
}
|
|
3792
|
-
return null;
|
|
3793
|
-
},
|
|
3794
3746
|
destroy: function destroy(player) {
|
|
3795
3747
|
var cgid = player._pluginInfoId;
|
|
3796
3748
|
if (!this.pluginGroup[cgid]) {
|
|
@@ -4046,7 +3998,7 @@ var Controls = /* @__PURE__ */ function(_Plugin) {
|
|
|
4046
3998
|
}
|
|
4047
3999
|
}, {
|
|
4048
4000
|
key: "show",
|
|
4049
|
-
value: function show() {
|
|
4001
|
+
value: function show(value) {
|
|
4050
4002
|
this.root.style.display = "";
|
|
4051
4003
|
this.player.focus();
|
|
4052
4004
|
}
|
|
@@ -4339,9 +4291,158 @@ var STATES = {
|
|
|
4339
4291
|
DESTROYED: 8
|
|
4340
4292
|
};
|
|
4341
4293
|
var STATE_ARRAY = ["ERROR", "INITIAL", "READY", "ATTACHING", "ATTACHED", "NOTALLOW", "RUNNING", "ENDED", "DESTROYED"];
|
|
4294
|
+
var store = {};
|
|
4295
|
+
var instance = null;
|
|
4296
|
+
var InstManager = /* @__PURE__ */ function(_EventEmitter) {
|
|
4297
|
+
_inherits(InstManager2, _EventEmitter);
|
|
4298
|
+
var _super = _createSuper(InstManager2);
|
|
4299
|
+
function InstManager2() {
|
|
4300
|
+
_classCallCheck(this, InstManager2);
|
|
4301
|
+
return _super.apply(this, arguments);
|
|
4302
|
+
}
|
|
4303
|
+
_createClass(InstManager2, [{
|
|
4304
|
+
key: "add",
|
|
4305
|
+
value: function add(player) {
|
|
4306
|
+
if (!player) {
|
|
4307
|
+
return;
|
|
4308
|
+
}
|
|
4309
|
+
store[player.playerId] = player;
|
|
4310
|
+
if (Object.keys(store).length === 1) {
|
|
4311
|
+
this.setActive(player.playerId, true);
|
|
4312
|
+
}
|
|
4313
|
+
}
|
|
4314
|
+
}, {
|
|
4315
|
+
key: "remove",
|
|
4316
|
+
value: function remove(player) {
|
|
4317
|
+
if (!player) {
|
|
4318
|
+
return;
|
|
4319
|
+
}
|
|
4320
|
+
player.isUserActive;
|
|
4321
|
+
delete store[player.playerId];
|
|
4322
|
+
}
|
|
4323
|
+
}, {
|
|
4324
|
+
key: "_iterate",
|
|
4325
|
+
value: function _iterate(fn) {
|
|
4326
|
+
var endEarly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
4327
|
+
for (var key in store) {
|
|
4328
|
+
if (Object.prototype.hasOwnProperty.call(store, key)) {
|
|
4329
|
+
var player = store[key];
|
|
4330
|
+
if (endEarly) {
|
|
4331
|
+
if (fn(player)) {
|
|
4332
|
+
break;
|
|
4333
|
+
}
|
|
4334
|
+
} else {
|
|
4335
|
+
fn(player);
|
|
4336
|
+
}
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
}
|
|
4340
|
+
}, {
|
|
4341
|
+
key: "forEach",
|
|
4342
|
+
value: function forEach(fn) {
|
|
4343
|
+
this._iterate(fn);
|
|
4344
|
+
}
|
|
4345
|
+
}, {
|
|
4346
|
+
key: "find",
|
|
4347
|
+
value: function find(fn) {
|
|
4348
|
+
var result = null;
|
|
4349
|
+
this._iterate(function(player) {
|
|
4350
|
+
var flag = fn(player);
|
|
4351
|
+
if (flag) {
|
|
4352
|
+
result = player;
|
|
4353
|
+
}
|
|
4354
|
+
return flag;
|
|
4355
|
+
}, true);
|
|
4356
|
+
return result;
|
|
4357
|
+
}
|
|
4358
|
+
}, {
|
|
4359
|
+
key: "findAll",
|
|
4360
|
+
value: function findAll(fn) {
|
|
4361
|
+
var results = [];
|
|
4362
|
+
this._iterate(function(player) {
|
|
4363
|
+
if (fn(player)) {
|
|
4364
|
+
results.push(player);
|
|
4365
|
+
}
|
|
4366
|
+
});
|
|
4367
|
+
return results;
|
|
4368
|
+
}
|
|
4369
|
+
}, {
|
|
4370
|
+
key: "setActive",
|
|
4371
|
+
value: function setActive(playerId) {
|
|
4372
|
+
var isActive = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
4373
|
+
if (!store[playerId]) {
|
|
4374
|
+
return;
|
|
4375
|
+
}
|
|
4376
|
+
if (isActive) {
|
|
4377
|
+
this.forEach(function(inst) {
|
|
4378
|
+
if (playerId === inst.playerId) {
|
|
4379
|
+
inst.isUserActive = true;
|
|
4380
|
+
inst.isInstNext = false;
|
|
4381
|
+
} else {
|
|
4382
|
+
inst.isUserActive = false;
|
|
4383
|
+
}
|
|
4384
|
+
});
|
|
4385
|
+
} else {
|
|
4386
|
+
store[playerId].isUserActive = isActive;
|
|
4387
|
+
}
|
|
4388
|
+
return playerId;
|
|
4389
|
+
}
|
|
4390
|
+
}, {
|
|
4391
|
+
key: "getActiveId",
|
|
4392
|
+
value: function getActiveId() {
|
|
4393
|
+
var keys = Object.keys(store);
|
|
4394
|
+
for (var i = 0; i < keys.length; i++) {
|
|
4395
|
+
var c = store[keys[i]];
|
|
4396
|
+
if (c && c.isUserActive) {
|
|
4397
|
+
return keys[i];
|
|
4398
|
+
}
|
|
4399
|
+
}
|
|
4400
|
+
return null;
|
|
4401
|
+
}
|
|
4402
|
+
}, {
|
|
4403
|
+
key: "setNext",
|
|
4404
|
+
value: function setNext(playerId) {
|
|
4405
|
+
var isNext = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
|
|
4406
|
+
if (!store[playerId]) {
|
|
4407
|
+
return;
|
|
4408
|
+
}
|
|
4409
|
+
if (isNext) {
|
|
4410
|
+
this.forEach(function(inst) {
|
|
4411
|
+
if (playerId === inst.playerId) {
|
|
4412
|
+
inst.isUserActive = false;
|
|
4413
|
+
inst.isInstNext = true;
|
|
4414
|
+
} else {
|
|
4415
|
+
inst.isInstNext = false;
|
|
4416
|
+
}
|
|
4417
|
+
});
|
|
4418
|
+
} else {
|
|
4419
|
+
store[playerId].isInstNext = isNext;
|
|
4420
|
+
}
|
|
4421
|
+
return playerId;
|
|
4422
|
+
}
|
|
4423
|
+
}], [{
|
|
4424
|
+
key: "getInstance",
|
|
4425
|
+
value: function getInstance() {
|
|
4426
|
+
instance || (instance = new InstManager2());
|
|
4427
|
+
return instance;
|
|
4428
|
+
}
|
|
4429
|
+
}]);
|
|
4430
|
+
return InstManager2;
|
|
4431
|
+
}(eventemitter3Exports.EventEmitter);
|
|
4432
|
+
function checkPlayerRoot(root) {
|
|
4433
|
+
var keys = Object.keys(store);
|
|
4434
|
+
for (var i = 0; i < keys.length; i++) {
|
|
4435
|
+
var p = store[keys[i]];
|
|
4436
|
+
if (p.root === root) {
|
|
4437
|
+
return p;
|
|
4438
|
+
}
|
|
4439
|
+
}
|
|
4440
|
+
return null;
|
|
4441
|
+
}
|
|
4342
4442
|
var PlAYER_HOOKS = ["play", "pause", "replay", "retry"];
|
|
4343
4443
|
var REAL_TIME_SPEED = 0;
|
|
4344
4444
|
var AVG_SPEED = 0;
|
|
4445
|
+
var instManager = null;
|
|
4345
4446
|
var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
4346
4447
|
_inherits(Player2, _MediaProxy);
|
|
4347
4448
|
var _super = _createSuper(Player2);
|
|
@@ -4354,11 +4455,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4354
4455
|
if (!_this.config) {
|
|
4355
4456
|
return;
|
|
4356
4457
|
}
|
|
4357
|
-
var _this$config = _this.config, autoplay2 = _this$config.autoplay,
|
|
4358
|
-
XG_DEBUG.logInfo("player", "canPlayFunc, startTime",
|
|
4359
|
-
if (
|
|
4360
|
-
_this.currentTime =
|
|
4361
|
-
_this.
|
|
4458
|
+
var _this$config = _this.config, autoplay2 = _this$config.autoplay, defaultPlaybackRate = _this$config.defaultPlaybackRate;
|
|
4459
|
+
XG_DEBUG.logInfo("player", "canPlayFunc, startTime", _this.__startTime);
|
|
4460
|
+
if (_this.__startTime > 0 && _this.duration > 0) {
|
|
4461
|
+
_this.currentTime = _this.__startTime > _this.duration ? _this.duration : _this.__startTime;
|
|
4462
|
+
_this.__startTime = -1;
|
|
4362
4463
|
}
|
|
4363
4464
|
_this.playbackRate = defaultPlaybackRate;
|
|
4364
4465
|
(autoplay2 || _this._useAutoplay) && _this.mediaPlay();
|
|
@@ -4449,6 +4550,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4449
4550
|
_this.isSeeking = false;
|
|
4450
4551
|
_this.isCanplay = false;
|
|
4451
4552
|
_this._useAutoplay = false;
|
|
4553
|
+
_this.__startTime = -1;
|
|
4452
4554
|
_this.rotateDeg = 0;
|
|
4453
4555
|
_this.isActive = false;
|
|
4454
4556
|
_this.fullscreen = false;
|
|
@@ -4503,6 +4605,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4503
4605
|
_this.innerStates = {
|
|
4504
4606
|
isActiveLocked: false
|
|
4505
4607
|
};
|
|
4608
|
+
_this.instManager = instManager;
|
|
4506
4609
|
var rootInit = _this._initDOM();
|
|
4507
4610
|
if (!rootInit) {
|
|
4508
4611
|
console.error(new Error("can't find the dom which id is ".concat(_this.config.id, " or this.config.el does not exist")));
|
|
@@ -4540,7 +4643,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4540
4643
|
_createClass(Player2, [{
|
|
4541
4644
|
key: "_initDOM",
|
|
4542
4645
|
value: function _initDOM() {
|
|
4543
|
-
var _this2 = this;
|
|
4646
|
+
var _instManager, _this2 = this;
|
|
4544
4647
|
this.root = this.config.id ? document.getElementById(this.config.id) : null;
|
|
4545
4648
|
if (!this.root) {
|
|
4546
4649
|
var el = this.config.el;
|
|
@@ -4556,12 +4659,13 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4556
4659
|
return false;
|
|
4557
4660
|
}
|
|
4558
4661
|
}
|
|
4559
|
-
var ret =
|
|
4662
|
+
var ret = checkPlayerRoot(this.root);
|
|
4560
4663
|
if (ret) {
|
|
4561
4664
|
XG_DEBUG.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize");
|
|
4562
4665
|
ret.destroy();
|
|
4563
4666
|
}
|
|
4564
4667
|
this.root.setAttribute(PLATER_ID, this.playerId);
|
|
4668
|
+
(_instManager = instManager) === null || _instManager === void 0 ? void 0 : _instManager.add(this);
|
|
4565
4669
|
pluginsManager.init(this);
|
|
4566
4670
|
this._initBaseDoms();
|
|
4567
4671
|
var XgVideoProxy = this.constructor.XgVideoProxy;
|
|
@@ -4704,10 +4808,13 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4704
4808
|
!util.isMSE(this.media) && this.load();
|
|
4705
4809
|
(sniffer.os.isIpad || sniffer.os.isPhone) && this.mediaPlay();
|
|
4706
4810
|
}
|
|
4707
|
-
|
|
4811
|
+
var startTime = this.config.startTime;
|
|
4812
|
+
this.__startTime = startTime > 0 ? startTime : -1;
|
|
4813
|
+
this.config.startTime = 0;
|
|
4814
|
+
if (readyState >= 2 && this.duration > 0) {
|
|
4708
4815
|
this.canPlayFunc();
|
|
4709
4816
|
} else {
|
|
4710
|
-
this.
|
|
4817
|
+
this.on(CANPLAY, this.canPlayFunc);
|
|
4711
4818
|
}
|
|
4712
4819
|
if (!this.hasStart || this.state < STATES.ATTACHED) {
|
|
4713
4820
|
pluginsManager.afterInit(this);
|
|
@@ -4949,6 +5056,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4949
5056
|
}
|
|
4950
5057
|
_src = this.preProcessUrl(_src).url;
|
|
4951
5058
|
var curTime = this.currentTime;
|
|
5059
|
+
this.__startTime = curTime;
|
|
4952
5060
|
var isPaused = this.paused && !this.isError;
|
|
4953
5061
|
this.src = _src;
|
|
4954
5062
|
return new Promise(function(resolve, reject) {
|
|
@@ -4958,7 +5066,10 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
4958
5066
|
reject(e);
|
|
4959
5067
|
};
|
|
4960
5068
|
var _canplay = function _canplay2() {
|
|
4961
|
-
_this9.
|
|
5069
|
+
if (_this9.duration > 0 && _this9.__startTime > 0) {
|
|
5070
|
+
_this9.currentTime = _this9.__startTime;
|
|
5071
|
+
_this9.__startTime = -1;
|
|
5072
|
+
}
|
|
4962
5073
|
if (isPaused) {
|
|
4963
5074
|
_this9.pause();
|
|
4964
5075
|
}
|
|
@@ -5185,7 +5296,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5185
5296
|
clsList.forEach(function(cls) {
|
|
5186
5297
|
_this16.removeClass(cls);
|
|
5187
5298
|
});
|
|
5188
|
-
this.addClass(STATE_CLASS.
|
|
5299
|
+
this.addClass(STATE_CLASS.NO_START);
|
|
5189
5300
|
this.emit(RESET);
|
|
5190
5301
|
}
|
|
5191
5302
|
}, {
|
|
@@ -5214,7 +5325,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5214
5325
|
}, {
|
|
5215
5326
|
key: "destroy",
|
|
5216
5327
|
value: function destroy2() {
|
|
5217
|
-
var _this18 = this;
|
|
5328
|
+
var _instManager2, _this18 = this;
|
|
5218
5329
|
var innerContainer = this.innerContainer, root = this.root, media = this.media;
|
|
5219
5330
|
if (!root || !media) {
|
|
5220
5331
|
return;
|
|
@@ -5227,6 +5338,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5227
5338
|
this._detachSourceEvents(this.media);
|
|
5228
5339
|
util.clearAllTimers(this);
|
|
5229
5340
|
this.emit(DESTROY);
|
|
5341
|
+
(_instManager2 = instManager) === null || _instManager2 === void 0 ? void 0 : _instManager2.remove(this);
|
|
5230
5342
|
pluginsManager.destroy(this);
|
|
5231
5343
|
delHooksDescriptor(this);
|
|
5232
5344
|
_get(_getPrototypeOf(Player2.prototype), "destroy", this).call(this);
|
|
@@ -5578,6 +5690,14 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5578
5690
|
this.isCanplay = true;
|
|
5579
5691
|
this.waitTimer && util.clearTimeout(this, this.waitTimer);
|
|
5580
5692
|
}
|
|
5693
|
+
}, {
|
|
5694
|
+
key: "onDurationchange",
|
|
5695
|
+
value: function onDurationchange() {
|
|
5696
|
+
if (this.__startTime > 0 && this.duration > 0) {
|
|
5697
|
+
this.currentTime = this.__startTime;
|
|
5698
|
+
this.__startTime = -1;
|
|
5699
|
+
}
|
|
5700
|
+
}
|
|
5581
5701
|
}, {
|
|
5582
5702
|
key: "onLoadeddata",
|
|
5583
5703
|
value: function onLoadeddata() {
|
|
@@ -5755,8 +5875,9 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5755
5875
|
}, {
|
|
5756
5876
|
key: "resizePosition",
|
|
5757
5877
|
value: function resizePosition() {
|
|
5758
|
-
var _this$videoPos = this.videoPos,
|
|
5759
|
-
|
|
5878
|
+
var _this$videoPos = this.videoPos, vy = _this$videoPos.vy, vx = _this$videoPos.vx, h = _this$videoPos.h, w = _this$videoPos.w;
|
|
5879
|
+
var rotate = this.videoPos.rotate;
|
|
5880
|
+
if (rotate < 0 && h < 0 && w < 0) {
|
|
5760
5881
|
return;
|
|
5761
5882
|
}
|
|
5762
5883
|
var _pi = this.videoPos._pi;
|
|
@@ -5767,6 +5888,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
5767
5888
|
return;
|
|
5768
5889
|
}
|
|
5769
5890
|
this.videoPos.pi = _pi;
|
|
5891
|
+
rotate = rotate < 0 ? 0 : rotate;
|
|
5770
5892
|
var _pos = {
|
|
5771
5893
|
rotate
|
|
5772
5894
|
};
|
|
@@ -6199,7 +6321,8 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6199
6321
|
}
|
|
6200
6322
|
}, {
|
|
6201
6323
|
key: "setUserActive",
|
|
6202
|
-
value: function setUserActive(isActive
|
|
6324
|
+
value: function setUserActive(isActive) {
|
|
6325
|
+
var isMuted = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
6203
6326
|
if (typeof isMuted === "boolean" && isMuted !== this.muted) {
|
|
6204
6327
|
this.addInnerOP("volumechange");
|
|
6205
6328
|
this.muted = isMuted;
|
|
@@ -6214,15 +6337,25 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6214
6337
|
set: function set(value) {
|
|
6215
6338
|
XG_DEBUG.config.debug = value;
|
|
6216
6339
|
}
|
|
6340
|
+
}, {
|
|
6341
|
+
key: "instManager",
|
|
6342
|
+
get: function get() {
|
|
6343
|
+
return instManager;
|
|
6344
|
+
},
|
|
6345
|
+
set: function set(value) {
|
|
6346
|
+
instManager = value;
|
|
6347
|
+
}
|
|
6217
6348
|
}, {
|
|
6218
6349
|
key: "getCurrentUserActivePlayerId",
|
|
6219
6350
|
value: function getCurrentUserActivePlayerId() {
|
|
6220
|
-
|
|
6351
|
+
var _instManager3;
|
|
6352
|
+
return (_instManager3 = instManager) === null || _instManager3 === void 0 ? void 0 : _instManager3.getActiveId();
|
|
6221
6353
|
}
|
|
6222
6354
|
}, {
|
|
6223
6355
|
key: "setCurrentUserActive",
|
|
6224
|
-
value: function
|
|
6225
|
-
|
|
6356
|
+
value: function setCurrentUserActive(playerId, isActive) {
|
|
6357
|
+
var _instManager4;
|
|
6358
|
+
(_instManager4 = instManager) === null || _instManager4 === void 0 ? void 0 : _instManager4.setActive(playerId, isActive);
|
|
6226
6359
|
}
|
|
6227
6360
|
}, {
|
|
6228
6361
|
key: "isHevcSupported",
|
|
@@ -6257,6 +6390,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
|
|
|
6257
6390
|
}(MediaProxy);
|
|
6258
6391
|
_defineProperty(Player, "defaultPreset", null);
|
|
6259
6392
|
_defineProperty(Player, "XgVideoProxy", null);
|
|
6393
|
+
Player.instManager = InstManager.getInstance();
|
|
6260
6394
|
var index_min = "";
|
|
6261
6395
|
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
6262
6396
|
ErrorCode2[ErrorCode2["MANIFEST_HLS_ERROR"] = 1100] = "MANIFEST_HLS_ERROR";
|
|
@@ -6383,6 +6517,14 @@ const ERROR_INFO = {
|
|
|
6383
6517
|
messageTextKey: "MODULE_LOAD_ERROR",
|
|
6384
6518
|
level: "Fatal"
|
|
6385
6519
|
/* Fatal */
|
|
6520
|
+
},
|
|
6521
|
+
[
|
|
6522
|
+
7100
|
|
6523
|
+
/* DRM_LICENSE */
|
|
6524
|
+
]: {
|
|
6525
|
+
messageTextKey: "DRM_LICENSE",
|
|
6526
|
+
level: "Fatal"
|
|
6527
|
+
/* Fatal */
|
|
6386
6528
|
}
|
|
6387
6529
|
};
|
|
6388
6530
|
const ERROR_TYPE_INFO = {
|
|
@@ -6465,7 +6607,7 @@ class VeError extends Error {
|
|
|
6465
6607
|
const message = (i18n == null ? void 0 : i18n.getText(errorInfo == null ? void 0 : errorInfo.messageTextKey)) ?? (errorInfo == null ? void 0 : errorInfo.message) ?? ((_a = errorInfo == null ? void 0 : errorInfo.error) == null ? void 0 : _a.message) ?? (i18n == null ? void 0 : i18n.getText("UNKNOWN"));
|
|
6466
6608
|
super(message);
|
|
6467
6609
|
/**
|
|
6468
|
-
* @brief 错误码,对应[错误码字典](
|
|
6610
|
+
* @brief 错误码,对应[错误码字典](#ErrorCode)。
|
|
6469
6611
|
*/
|
|
6470
6612
|
__publicField(this, "errorCode");
|
|
6471
6613
|
/**
|
|
@@ -6527,7 +6669,7 @@ var Poster = /* @__PURE__ */ function(_Plugin) {
|
|
|
6527
6669
|
}
|
|
6528
6670
|
}, {
|
|
6529
6671
|
key: "show",
|
|
6530
|
-
value: function show() {
|
|
6672
|
+
value: function show(value) {
|
|
6531
6673
|
util.removeClass(this.root, "hide");
|
|
6532
6674
|
}
|
|
6533
6675
|
}, {
|
|
@@ -6606,10 +6748,11 @@ var Poster = /* @__PURE__ */ function(_Plugin) {
|
|
|
6606
6748
|
}, {
|
|
6607
6749
|
key: "render",
|
|
6608
6750
|
value: function render() {
|
|
6609
|
-
var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay, fillMode = _this$config.fillMode;
|
|
6751
|
+
var _this$config = this.config, poster = _this$config.poster, hideCanplay = _this$config.hideCanplay, fillMode = _this$config.fillMode, notHidden = _this$config.notHidden;
|
|
6610
6752
|
var _bg = this.getBgSize(fillMode);
|
|
6611
6753
|
var style = poster ? "background-image:url(".concat(poster, ");").concat(_bg) : _bg;
|
|
6612
|
-
|
|
6754
|
+
var className = notHidden ? "xg-not-hidden" : hideCanplay ? "xg-showplay" : "";
|
|
6755
|
+
return '<xg-poster class="xgplayer-poster '.concat(className, '" style="').concat(style, '">\n </xg-poster>');
|
|
6613
6756
|
}
|
|
6614
6757
|
}], [{
|
|
6615
6758
|
key: "pluginName",
|
|
@@ -6622,6 +6765,7 @@ var Poster = /* @__PURE__ */ function(_Plugin) {
|
|
|
6622
6765
|
return {
|
|
6623
6766
|
isEndedShow: true,
|
|
6624
6767
|
hideCanplay: false,
|
|
6768
|
+
notHidden: false,
|
|
6625
6769
|
poster: "",
|
|
6626
6770
|
fillMode: "fixWidth"
|
|
6627
6771
|
};
|
|
@@ -6765,7 +6909,7 @@ var Start = /* @__PURE__ */ function(_Plugin) {
|
|
|
6765
6909
|
}
|
|
6766
6910
|
}, {
|
|
6767
6911
|
key: "show",
|
|
6768
|
-
value: function show() {
|
|
6912
|
+
value: function show(value) {
|
|
6769
6913
|
util.removeClass(this.root, "hide");
|
|
6770
6914
|
}
|
|
6771
6915
|
}, {
|
|
@@ -7727,14 +7871,14 @@ var PCPlugin = /* @__PURE__ */ function(_BasePlugin) {
|
|
|
7727
7871
|
key: "initEvents",
|
|
7728
7872
|
value: function initEvents() {
|
|
7729
7873
|
var _this3 = this;
|
|
7730
|
-
var _this$player = this.player,
|
|
7874
|
+
var _this$player = this.player, media = _this$player.media, root = _this$player.root;
|
|
7731
7875
|
var enableContextmenu = this.playerConfig.enableContextmenu;
|
|
7732
7876
|
root && root.addEventListener("click", this.onVideoClick, false);
|
|
7733
7877
|
root && root.addEventListener("dblclick", this.onVideoDblClick, false);
|
|
7734
7878
|
Object.keys(MOUSE_EVENTS).map(function(item) {
|
|
7735
7879
|
root.addEventListener(item, _this3[MOUSE_EVENTS[item]], false);
|
|
7736
7880
|
});
|
|
7737
|
-
enableContextmenu &&
|
|
7881
|
+
!enableContextmenu && media && media.addEventListener("contextmenu", this.onContextmenu, false);
|
|
7738
7882
|
}
|
|
7739
7883
|
}, {
|
|
7740
7884
|
key: "switchPlayPause",
|
|
@@ -9458,16 +9602,6 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9458
9602
|
}
|
|
9459
9603
|
}
|
|
9460
9604
|
}
|
|
9461
|
-
}, {
|
|
9462
|
-
key: "show",
|
|
9463
|
-
value: function show() {
|
|
9464
|
-
_get(_getPrototypeOf(Fullscreen2.prototype), "show", this).call(this);
|
|
9465
|
-
}
|
|
9466
|
-
}, {
|
|
9467
|
-
key: "hide",
|
|
9468
|
-
value: function hide() {
|
|
9469
|
-
_get(_getPrototypeOf(Fullscreen2.prototype), "hide", this).call(this);
|
|
9470
|
-
}
|
|
9471
9605
|
}, {
|
|
9472
9606
|
key: "render",
|
|
9473
9607
|
value: function render() {
|
|
@@ -9923,11 +10057,14 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9923
10057
|
}, 0);
|
|
9924
10058
|
!paused && player.mediaPlay();
|
|
9925
10059
|
_this3.setAttr("data-state", "normal");
|
|
10060
|
+
_this3.pipWindow = null;
|
|
9926
10061
|
player.emit(PIP_CHANGE, false);
|
|
9927
10062
|
};
|
|
9928
10063
|
this.enterPIPCallback = function(e) {
|
|
9929
10064
|
player.emit(PIP_CHANGE, true);
|
|
9930
|
-
|
|
10065
|
+
if (e !== null && e !== void 0 && e.pictureInPictureWindow) {
|
|
10066
|
+
_this3.pipWindow = e.pictureInPictureWindow;
|
|
10067
|
+
}
|
|
9931
10068
|
_this3.setAttr("data-state", "pip");
|
|
9932
10069
|
};
|
|
9933
10070
|
this.onWebkitpresentationmodechanged = function(e) {
|
|
@@ -9948,10 +10085,33 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9948
10085
|
PIP2.checkWebkitSetPresentationMode(player.media) && player.media.addEventListener("webkitpresentationmodechanged", this.onWebkitpresentationmodechanged);
|
|
9949
10086
|
}
|
|
9950
10087
|
}
|
|
10088
|
+
}, {
|
|
10089
|
+
key: "copyStyleIntoPiPWindow",
|
|
10090
|
+
value: function copyStyleIntoPiPWindow(pipWin) {
|
|
10091
|
+
var textContent = _toConsumableArray(document.styleSheets).map(function(style2) {
|
|
10092
|
+
try {
|
|
10093
|
+
return _toConsumableArray(style2.cssRules).map(function(rule) {
|
|
10094
|
+
return rule.cssText;
|
|
10095
|
+
}).join("");
|
|
10096
|
+
} catch (e) {
|
|
10097
|
+
var link = document.createElement("link");
|
|
10098
|
+
link.rel = "stylesheet";
|
|
10099
|
+
link.type = style2.type;
|
|
10100
|
+
link.media = style2.media;
|
|
10101
|
+
link.href = style2.href;
|
|
10102
|
+
pipWin.document.head.appendChild(link);
|
|
10103
|
+
}
|
|
10104
|
+
return "";
|
|
10105
|
+
}).filter(Boolean).join("\n");
|
|
10106
|
+
var style = document.createElement("style");
|
|
10107
|
+
style.textContent = textContent;
|
|
10108
|
+
pipWin.document.head.appendChild(style);
|
|
10109
|
+
}
|
|
9951
10110
|
}, {
|
|
9952
10111
|
key: "requestPIP",
|
|
9953
10112
|
value: function requestPIP() {
|
|
9954
|
-
var
|
|
10113
|
+
var _this4 = this;
|
|
10114
|
+
var player = this.player, playerConfig = this.playerConfig, config = this.config;
|
|
9955
10115
|
if (!this.isPIPAvailable() || this.isPip) {
|
|
9956
10116
|
return;
|
|
9957
10117
|
}
|
|
@@ -9960,7 +10120,62 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9960
10120
|
if (poster) {
|
|
9961
10121
|
player.media.poster = util.typeOf(poster) === "String" ? poster : poster.poster;
|
|
9962
10122
|
}
|
|
9963
|
-
|
|
10123
|
+
if (config.preferDocument && this.isDocPIPAvailable()) {
|
|
10124
|
+
var pipOptions = {};
|
|
10125
|
+
if (config.width && config.height) {
|
|
10126
|
+
pipOptions.width = config.width;
|
|
10127
|
+
pipOptions.height = config.height;
|
|
10128
|
+
} else {
|
|
10129
|
+
var playerRect = player.root.getBoundingClientRect();
|
|
10130
|
+
pipOptions.width = playerRect.width;
|
|
10131
|
+
pipOptions.height = playerRect.height;
|
|
10132
|
+
}
|
|
10133
|
+
documentPictureInPicture.requestWindow(pipOptions).then(function(pipWin) {
|
|
10134
|
+
var docPiPNode = config.docPiPNode, docPiPStyle = config.docPiPStyle;
|
|
10135
|
+
_this4.enterPIPCallback();
|
|
10136
|
+
var pipRoot = docPiPNode || player.root;
|
|
10137
|
+
var parentNode = pipRoot.parentElement;
|
|
10138
|
+
var previousSibling = pipRoot.previousSibling;
|
|
10139
|
+
var nextSibling = pipRoot.nextSibling;
|
|
10140
|
+
_this4.copyStyleIntoPiPWindow(pipWin);
|
|
10141
|
+
var styles = document.createElement("style");
|
|
10142
|
+
styles.append("body{padding:0; margin:0;}");
|
|
10143
|
+
if (docPiPStyle) {
|
|
10144
|
+
var cssContent = "";
|
|
10145
|
+
if (typeof docPiPStyle === "string") {
|
|
10146
|
+
cssContent = docPiPStyle;
|
|
10147
|
+
} else if (typeof docPiPStyle === "function") {
|
|
10148
|
+
cssContent = docPiPStyle.call(config);
|
|
10149
|
+
}
|
|
10150
|
+
if (cssContent) {
|
|
10151
|
+
styles.append(cssContent);
|
|
10152
|
+
}
|
|
10153
|
+
} else if (pipRoot === player.root) {
|
|
10154
|
+
styles.append("\n .xgplayer{width: 100%!important; height: 100%!important;}\n ");
|
|
10155
|
+
}
|
|
10156
|
+
pipWin.document.head.append(styles);
|
|
10157
|
+
pipWin.document.body.append(pipRoot);
|
|
10158
|
+
pipWin.addEventListener("pagehide", function(event) {
|
|
10159
|
+
if (parentNode) {
|
|
10160
|
+
if (nextSibling) {
|
|
10161
|
+
parentNode.insertBefore(pipRoot, nextSibling);
|
|
10162
|
+
} else if (previousSibling) {
|
|
10163
|
+
parentNode.insertBefore(pipRoot, previousSibling.nextSibling);
|
|
10164
|
+
} else {
|
|
10165
|
+
parentNode.appendChild(pipRoot);
|
|
10166
|
+
}
|
|
10167
|
+
} else {
|
|
10168
|
+
}
|
|
10169
|
+
_this4.leavePIPCallback();
|
|
10170
|
+
}, {
|
|
10171
|
+
once: true
|
|
10172
|
+
});
|
|
10173
|
+
});
|
|
10174
|
+
} else if (PIP2.checkWebkitSetPresentationMode(player.media)) {
|
|
10175
|
+
player.media.webkitSetPresentationMode("picture-in-picture");
|
|
10176
|
+
} else {
|
|
10177
|
+
player.media.requestPictureInPicture();
|
|
10178
|
+
}
|
|
9964
10179
|
return true;
|
|
9965
10180
|
} catch (reason) {
|
|
9966
10181
|
console.error("requestPiP", reason);
|
|
@@ -9973,7 +10188,14 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9973
10188
|
var player = this.player;
|
|
9974
10189
|
try {
|
|
9975
10190
|
if (this.isPIPAvailable() && this.isPip) {
|
|
9976
|
-
|
|
10191
|
+
var _documentPictureInPic;
|
|
10192
|
+
if (this.isDocPIPAvailable() && (_documentPictureInPic = documentPictureInPicture) !== null && _documentPictureInPic !== void 0 && _documentPictureInPic.window) {
|
|
10193
|
+
documentPictureInPicture.window.close();
|
|
10194
|
+
} else if (PIP2.checkWebkitSetPresentationMode(player.media)) {
|
|
10195
|
+
player.media.webkitSetPresentationMode("inline");
|
|
10196
|
+
} else {
|
|
10197
|
+
document.exitPictureInPicture();
|
|
10198
|
+
}
|
|
9977
10199
|
}
|
|
9978
10200
|
return true;
|
|
9979
10201
|
} catch (reason) {
|
|
@@ -9984,15 +10206,21 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
9984
10206
|
}, {
|
|
9985
10207
|
key: "isPip",
|
|
9986
10208
|
get: function get() {
|
|
10209
|
+
var _documentPictureInPic2;
|
|
9987
10210
|
var player = this.player;
|
|
9988
|
-
return document.pictureInPictureElement && document.pictureInPictureElement === player.media || player.media.webkitPresentationMode === PresentationMode.PIP;
|
|
10211
|
+
return !!(this.isDocPIPAvailable() && (_documentPictureInPic2 = documentPictureInPicture) !== null && _documentPictureInPic2 !== void 0 && _documentPictureInPic2.window) || document.pictureInPictureElement && document.pictureInPictureElement === player.media || player.media.webkitPresentationMode === PresentationMode.PIP;
|
|
9989
10212
|
}
|
|
9990
10213
|
}, {
|
|
9991
10214
|
key: "isPIPAvailable",
|
|
9992
10215
|
value: function isPIPAvailable() {
|
|
9993
10216
|
var video = this.player.media;
|
|
9994
10217
|
var _isEnabled = util.typeOf(document.pictureInPictureEnabled) === "Boolean" ? document.pictureInPictureEnabled : true;
|
|
9995
|
-
return _isEnabled && (util.typeOf(video.disablePictureInPicture) === "Boolean" && !video.disablePictureInPicture || video.webkitSupportsPresentationMode && util.typeOf(video.webkitSetPresentationMode) === "Function");
|
|
10218
|
+
return _isEnabled && (util.typeOf(video.disablePictureInPicture) === "Boolean" && !video.disablePictureInPicture || video.webkitSupportsPresentationMode && util.typeOf(video.webkitSetPresentationMode) === "Function") || this.isDocPIPAvailable();
|
|
10219
|
+
}
|
|
10220
|
+
}, {
|
|
10221
|
+
key: "isDocPIPAvailable",
|
|
10222
|
+
value: function isDocPIPAvailable() {
|
|
10223
|
+
return "documentPictureInPicture" in window && /^(https|file)/.test(location.protocol);
|
|
9996
10224
|
}
|
|
9997
10225
|
}, {
|
|
9998
10226
|
key: "destroy",
|
|
@@ -10024,7 +10252,12 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
|
|
|
10024
10252
|
return {
|
|
10025
10253
|
position: POSITIONS$1.CONTROLS_RIGHT,
|
|
10026
10254
|
index: 6,
|
|
10027
|
-
showIcon: false
|
|
10255
|
+
showIcon: false,
|
|
10256
|
+
preferDocument: false,
|
|
10257
|
+
width: void 0,
|
|
10258
|
+
height: void 0,
|
|
10259
|
+
docPiPNode: void 0,
|
|
10260
|
+
docPiPStyle: void 0
|
|
10028
10261
|
};
|
|
10029
10262
|
}
|
|
10030
10263
|
}, {
|
|
@@ -12016,7 +12249,7 @@ class DefinitionPlugin extends OptionsIcon {
|
|
|
12016
12249
|
}
|
|
12017
12250
|
this._waitingStartTime = Date.now();
|
|
12018
12251
|
const currentTime = this.player.currentTime;
|
|
12019
|
-
this._timer = setTimeout(() => {
|
|
12252
|
+
this._timer = window.setTimeout(() => {
|
|
12020
12253
|
if (this.player && this.player.currentTime <= currentTime + 0.1) {
|
|
12021
12254
|
this.player.emit(Events.LONG_WAITING);
|
|
12022
12255
|
if (this.config.needFallback) {
|
|
@@ -12121,7 +12354,8 @@ const NAME_MAP = {
|
|
|
12121
12354
|
"plugin:hls": "veplayer.plugin.hls.[env].[ext]",
|
|
12122
12355
|
"plugin:shaka": "veplayer.plugin.shaka.[env].[ext]",
|
|
12123
12356
|
"plugin:rtm": "veplayer.plugin.rtm.[env].[ext]",
|
|
12124
|
-
"plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]"
|
|
12357
|
+
"plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]",
|
|
12358
|
+
"plugin:drm": "veplayer.plugin.drm.[env].[ext]"
|
|
12125
12359
|
};
|
|
12126
12360
|
var DynamicModule = /* @__PURE__ */ ((DynamicModule2) => {
|
|
12127
12361
|
DynamicModule2["BizVod"] = "biz:vod";
|
|
@@ -12132,6 +12366,7 @@ var DynamicModule = /* @__PURE__ */ ((DynamicModule2) => {
|
|
|
12132
12366
|
DynamicModule2["PluginShaka"] = "plugin:shaka";
|
|
12133
12367
|
DynamicModule2["PluginRtm"] = "plugin:rtm";
|
|
12134
12368
|
DynamicModule2["PluginXgvideo"] = "plugin:xgvideo";
|
|
12369
|
+
DynamicModule2["PluginDrm"] = "plugin:drm";
|
|
12135
12370
|
return DynamicModule2;
|
|
12136
12371
|
})(DynamicModule || {});
|
|
12137
12372
|
class Loader {
|
|
@@ -12175,13 +12410,13 @@ class Loader {
|
|
|
12175
12410
|
src: src2 ?? moduleSrc,
|
|
12176
12411
|
name,
|
|
12177
12412
|
state: 0,
|
|
12178
|
-
exports: {}
|
|
12413
|
+
exports: { __PLUGIN_NAME__: name }
|
|
12179
12414
|
};
|
|
12180
12415
|
this.modules[name] = module;
|
|
12181
12416
|
this.mountPromiseMap[name] = this._mount(module);
|
|
12182
12417
|
return this.mountPromiseMap[name];
|
|
12183
12418
|
});
|
|
12184
|
-
__publicField(this, "
|
|
12419
|
+
__publicField(this, "registerPlugin", (name, exports) => {
|
|
12185
12420
|
if (!this._moduleSystem) {
|
|
12186
12421
|
throw new Error(
|
|
12187
12422
|
`You have to specify moduleSystem first, call setModuleSystem(moduleSystem) to set module system`
|
|
@@ -12208,6 +12443,11 @@ class Loader {
|
|
|
12208
12443
|
}
|
|
12209
12444
|
return this.modules[name].exports;
|
|
12210
12445
|
});
|
|
12446
|
+
__publicField(this, "register", (exports) => {
|
|
12447
|
+
return exports.map((exportModule) => {
|
|
12448
|
+
return this.registerPlugin(exportModule.__PLUGIN_NAME__, exportModule);
|
|
12449
|
+
});
|
|
12450
|
+
});
|
|
12211
12451
|
this._baseUrl = options.baseUrl;
|
|
12212
12452
|
}
|
|
12213
12453
|
get baseUrl() {
|
|
@@ -12247,6 +12487,7 @@ const baseUrl = src.slice(0, src.lastIndexOf("/"));
|
|
|
12247
12487
|
const loader = new Loader({
|
|
12248
12488
|
baseUrl
|
|
12249
12489
|
});
|
|
12490
|
+
loader.registerPlugin;
|
|
12250
12491
|
const register2 = loader.register;
|
|
12251
12492
|
function setModuleSystem(moduleSystem) {
|
|
12252
12493
|
loader.setModuleSystem(moduleSystem);
|
|
@@ -12436,7 +12677,7 @@ class Autoplay extends Plugin {
|
|
|
12436
12677
|
}
|
|
12437
12678
|
wxCanPlayFn() {
|
|
12438
12679
|
window.WeixinJSBridge && window.WeixinJSBridge.invoke("getNetworkType", {}, () => {
|
|
12439
|
-
this._wxTimer = setTimeout(() => {
|
|
12680
|
+
this._wxTimer = window.setTimeout(() => {
|
|
12440
12681
|
this._wxTimer && clearTimeout(this._wxTimer);
|
|
12441
12682
|
const ret = this.player.play();
|
|
12442
12683
|
if (ret && ret.then) {
|
|
@@ -12510,8 +12751,8 @@ class Autoplay extends Plugin {
|
|
|
12510
12751
|
this._state.showUnmuteBt = true;
|
|
12511
12752
|
this._state.mode = 1;
|
|
12512
12753
|
this.renderUnmuteBt();
|
|
12513
|
-
this._timer = setTimeout(() => {
|
|
12514
|
-
this._timer && clearTimeout(this._timer);
|
|
12754
|
+
this._timer = window.setTimeout(() => {
|
|
12755
|
+
this._timer && window.clearTimeout(this._timer);
|
|
12515
12756
|
const ret = this.player.play();
|
|
12516
12757
|
if (ret && ret.then) {
|
|
12517
12758
|
ret.then(() => {
|
|
@@ -13277,7 +13518,7 @@ class VePlayerBase {
|
|
|
13277
13518
|
/**
|
|
13278
13519
|
* @brief 调用此方法监听指定事件,事件处理函数只执行一次。
|
|
13279
13520
|
* @param event 表示事件的名称。
|
|
13280
|
-
* @param callback
|
|
13521
|
+
* @param callback 表示事件的回调函数。
|
|
13281
13522
|
*/
|
|
13282
13523
|
once(event, callback) {
|
|
13283
13524
|
var _a;
|
|
@@ -13293,7 +13534,7 @@ class VePlayerBase {
|
|
|
13293
13534
|
/**
|
|
13294
13535
|
* @brief 调用此方法解绑或移除指定事件的事件监听。
|
|
13295
13536
|
* @param event 表示事件的名称。
|
|
13296
|
-
* @param callback
|
|
13537
|
+
* @param callback 表示事件的回调函数。
|
|
13297
13538
|
*/
|
|
13298
13539
|
off(event, callback) {
|
|
13299
13540
|
var _a;
|
|
@@ -13322,8 +13563,8 @@ class VePlayerBase {
|
|
|
13322
13563
|
}
|
|
13323
13564
|
/**
|
|
13324
13565
|
* @brief 调用此方法监听指定事件。
|
|
13325
|
-
* @param event
|
|
13326
|
-
* @param callback
|
|
13566
|
+
* @param event 表示事件名称。
|
|
13567
|
+
* @param callback 表示事件的回调函数。
|
|
13327
13568
|
*/
|
|
13328
13569
|
on(event, callback) {
|
|
13329
13570
|
var _a;
|