xgplayer 2.31.4 → 2.31.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/browser/controls/errorRetry.js +1 -1
- package/browser/controls/memoryPlay.js +1 -1
- package/browser/controls/nativeTextTrack.js +1 -1
- package/browser/controls/pip.js +1 -1
- package/browser/controls/progress.js +1 -1
- package/browser/core_player.js +1 -1
- package/browser/core_player.js.map +1 -1
- package/browser/index.js +2 -2
- package/browser/index.js.map +1 -1
- package/browser/simple_player.js +1 -1
- package/browser/simple_player.js.map +1 -1
- package/dist/controls/errorRetry.js +1 -1
- package/dist/controls/memoryPlay.js +1 -1
- package/dist/controls/nativeTextTrack.js +1 -1
- package/dist/controls/pip.js +1 -1
- package/dist/controls/progress.js +1 -1
- package/dist/core_player.js +6 -1
- package/dist/core_player.js.map +1 -1
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/simple_player.js +21 -5
- package/dist/simple_player.js.map +1 -1
- package/es/controls/errorRetry.js +1 -1
- package/es/controls/memoryPlay.js +1 -1
- package/es/controls/nativeTextTrack.js +1 -1
- package/es/controls/pip.js +1 -1
- package/es/controls/progress.js +1 -1
- package/es/core_player.js +1 -1
- package/es/core_player.js.map +1 -1
- package/es/index.js +2 -2
- package/es/index.js.map +1 -1
- package/es/simple_player.js +1 -1
- package/es/simple_player.js.map +1 -1
- package/package.json +1 -1
- package/src/controls/memoryPlay.js +4 -1
- package/src/controls/pip.js +3 -1
- package/src/proxy.js +3 -0
- package/src/skin/controls/memoryPlay.js +1 -1
- package/src/skin/controls/progress.js +17 -6
- package/version.json +1 -1
- package/browser/controls.js.map +0 -1
- package/browser/player.js.map +0 -1
- package/dist/controls.js.map +0 -1
- package/dist/player.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1221,7 +1221,7 @@ module.exports = exports["default"];
|
|
|
1221
1221
|
/* 8 */
|
|
1222
1222
|
/***/ (function(module) {
|
|
1223
1223
|
|
|
1224
|
-
module.exports = JSON.parse("{\"version\":\"2.31.
|
|
1224
|
+
module.exports = JSON.parse("{\"version\":\"2.31.6\"}");
|
|
1225
1225
|
|
|
1226
1226
|
/***/ }),
|
|
1227
1227
|
/* 9 */
|
|
@@ -2703,6 +2703,11 @@ var Proxy = function () {
|
|
|
2703
2703
|
get: function get() {
|
|
2704
2704
|
return (0, _util.hasClass)(this.root, 'xgplayer-pip-active');
|
|
2705
2705
|
}
|
|
2706
|
+
}, {
|
|
2707
|
+
key: 'isMiniPlayer',
|
|
2708
|
+
get: function get() {
|
|
2709
|
+
return (0, _util.hasClass)(this.root, 'xgplayer-miniplayer-active');
|
|
2710
|
+
}
|
|
2706
2711
|
}]);
|
|
2707
2712
|
|
|
2708
2713
|
return Proxy;
|
|
@@ -4730,8 +4735,12 @@ var s_progress = function s_progress() {
|
|
|
4730
4735
|
player.config.enableSwipeHandler.call(player);
|
|
4731
4736
|
});
|
|
4732
4737
|
};
|
|
4733
|
-
|
|
4734
|
-
|
|
4738
|
+
var events = ['touchstart', 'mousedown'];
|
|
4739
|
+
if (_sniffer2.default.device === 'mobile') {
|
|
4740
|
+
// 解决在移动端触发多次seeking问题
|
|
4741
|
+
events.pop();
|
|
4742
|
+
}
|
|
4743
|
+
events.forEach(function (item) {
|
|
4735
4744
|
container.addEventListener(item, function (e) {
|
|
4736
4745
|
if (player.config.disableProgress) return;
|
|
4737
4746
|
// e.preventDefault()
|
|
@@ -4770,6 +4779,7 @@ var s_progress = function s_progress() {
|
|
|
4770
4779
|
progress.style.width = w * 100 / containerWidth + '%';
|
|
4771
4780
|
|
|
4772
4781
|
if (player.videoConfig.mediaType === 'video' && !player.dash && !player.config.closeMoveSeek) {
|
|
4782
|
+
console.log('trigger touchmove');
|
|
4773
4783
|
player.currentTime = Number(now).toFixed(1);
|
|
4774
4784
|
} else {
|
|
4775
4785
|
var time = (0, _util.findDom)(player.controls, '.xgplayer-time');
|
|
@@ -4795,6 +4805,7 @@ var s_progress = function s_progress() {
|
|
|
4795
4805
|
player.emit('focus');
|
|
4796
4806
|
};
|
|
4797
4807
|
var up = function up(e) {
|
|
4808
|
+
console.log('up event', e);
|
|
4798
4809
|
// e.preventDefault()
|
|
4799
4810
|
e.stopPropagation();
|
|
4800
4811
|
(0, _util.event)(e);
|
|
@@ -4814,6 +4825,7 @@ var s_progress = function s_progress() {
|
|
|
4814
4825
|
if (now < 0) now = 0;
|
|
4815
4826
|
if (player.config.allowSeekPlayed && Number(now).toFixed(1) > player.maxPlayedTime) {} else {
|
|
4816
4827
|
progress.style.width = w * 100 / containerWidth + '%';
|
|
4828
|
+
console.warn('trigger touchup');
|
|
4817
4829
|
player.currentTime = Number(now).toFixed(1);
|
|
4818
4830
|
}
|
|
4819
4831
|
}
|
|
@@ -4823,10 +4835,14 @@ var s_progress = function s_progress() {
|
|
|
4823
4835
|
player.emit('focus');
|
|
4824
4836
|
player.isProgressMoving = false;
|
|
4825
4837
|
};
|
|
4826
|
-
|
|
4838
|
+
// if (item === 'touchstart') {
|
|
4827
4839
|
window.addEventListener('touchmove', move, { passive: false });
|
|
4828
|
-
window.addEventListener('mouseup', up);
|
|
4829
4840
|
window.addEventListener('touchend', up);
|
|
4841
|
+
// } else {
|
|
4842
|
+
window.addEventListener('mousemove', move);
|
|
4843
|
+
// console.warn('add envent mouseup')
|
|
4844
|
+
window.addEventListener('mouseup', up);
|
|
4845
|
+
// }
|
|
4830
4846
|
return true;
|
|
4831
4847
|
});
|
|
4832
4848
|
});
|
|
@@ -6321,7 +6337,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6321
6337
|
var memoryPlay = function memoryPlay() {
|
|
6322
6338
|
var player = this;
|
|
6323
6339
|
player.on('memoryPlayStart', function (lastPlayTime) {
|
|
6324
|
-
|
|
6340
|
+
setTimeout(function () {
|
|
6341
|
+
console.log('memoryPlayStart', lastPlayTime, player.readyState, 11);
|
|
6342
|
+
player.currentTime = lastPlayTime;
|
|
6343
|
+
});
|
|
6325
6344
|
});
|
|
6326
6345
|
};
|
|
6327
6346
|
|
|
@@ -7833,10 +7852,12 @@ var pip = function pip() {
|
|
|
7833
7852
|
};
|
|
7834
7853
|
|
|
7835
7854
|
player.video.addEventListener('enterpictureinpicture', function (pipWindow) {
|
|
7855
|
+
(0, _util.addClass)(player.root, 'xgplayer-pip-active');
|
|
7836
7856
|
player.emit('requestPictureInPicture', pipWindow);
|
|
7837
7857
|
});
|
|
7838
7858
|
|
|
7839
7859
|
player.video.addEventListener('leavepictureinpicture', function () {
|
|
7860
|
+
(0, _util.removeClass)(player.root, 'xgplayer-pip-active');
|
|
7840
7861
|
player.emit('exitPictureInPicture');
|
|
7841
7862
|
});
|
|
7842
7863
|
|
|
@@ -13522,7 +13543,7 @@ var s_memoryPlay = function s_memoryPlay() {
|
|
|
13522
13543
|
}, lastPlayTimeHideDelay * 1000);
|
|
13523
13544
|
}
|
|
13524
13545
|
};
|
|
13525
|
-
player.once('
|
|
13546
|
+
player.once('playing', handlePlay);
|
|
13526
13547
|
player.once('ended', removeFunc);
|
|
13527
13548
|
};
|
|
13528
13549
|
|