wargerm 0.4.18 → 0.4.21
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/dist/components/Modal/index.d.ts +1 -0
- package/dist/index.css +18 -0
- package/dist/index.esm.css +18 -0
- package/dist/index.esm.js +65 -43
- package/dist/index.js +65 -43
- package/package.json +1 -1
@@ -27,6 +27,7 @@ declare class Modal extends React.PureComponent<Props> {
|
|
27
27
|
destory(): void;
|
28
28
|
} | undefined;
|
29
29
|
static hidden: () => void;
|
30
|
+
static destory: () => void;
|
30
31
|
renderFooter: () => JSX.Element | null;
|
31
32
|
containerRef: React.RefObject<any>;
|
32
33
|
titleRef: React.RefObject<any>;
|
package/dist/index.css
CHANGED
@@ -1441,6 +1441,15 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
|
|
1441
1441
|
background: #0f6ab7;
|
1442
1442
|
}
|
1443
1443
|
[data-prefers-color='dark'] .videoContainer {
|
1444
|
+
min-width: 10px;
|
1445
|
+
min-height: 10px;
|
1446
|
+
width: 100%;
|
1447
|
+
height: 100%;
|
1448
|
+
display: flex;
|
1449
|
+
flex-direction: column;
|
1450
|
+
}
|
1451
|
+
[data-prefers-color='dark'] .videoContainer .videoContainer-grid {
|
1452
|
+
flex: 1;
|
1444
1453
|
width: 100%;
|
1445
1454
|
height: 100%;
|
1446
1455
|
display: grid;
|
@@ -2856,6 +2865,15 @@ button[data-prefers-color='light'] .swiper-pagination-bullet {
|
|
2856
2865
|
background: #0f6ab7;
|
2857
2866
|
}
|
2858
2867
|
[data-prefers-color='light'] .videoContainer {
|
2868
|
+
min-width: 10px;
|
2869
|
+
min-height: 10px;
|
2870
|
+
width: 100%;
|
2871
|
+
height: 100%;
|
2872
|
+
display: flex;
|
2873
|
+
flex-direction: column;
|
2874
|
+
}
|
2875
|
+
[data-prefers-color='light'] .videoContainer .videoContainer-grid {
|
2876
|
+
flex: 1;
|
2859
2877
|
width: 100%;
|
2860
2878
|
height: 100%;
|
2861
2879
|
display: grid;
|
package/dist/index.esm.css
CHANGED
@@ -1441,6 +1441,15 @@ button[data-prefers-color='dark'] .swiper-pagination-bullet {
|
|
1441
1441
|
background: #0f6ab7;
|
1442
1442
|
}
|
1443
1443
|
[data-prefers-color='dark'] .videoContainer {
|
1444
|
+
min-width: 10px;
|
1445
|
+
min-height: 10px;
|
1446
|
+
width: 100%;
|
1447
|
+
height: 100%;
|
1448
|
+
display: flex;
|
1449
|
+
flex-direction: column;
|
1450
|
+
}
|
1451
|
+
[data-prefers-color='dark'] .videoContainer .videoContainer-grid {
|
1452
|
+
flex: 1;
|
1444
1453
|
width: 100%;
|
1445
1454
|
height: 100%;
|
1446
1455
|
display: grid;
|
@@ -2856,6 +2865,15 @@ button[data-prefers-color='light'] .swiper-pagination-bullet {
|
|
2856
2865
|
background: #0f6ab7;
|
2857
2866
|
}
|
2858
2867
|
[data-prefers-color='light'] .videoContainer {
|
2868
|
+
min-width: 10px;
|
2869
|
+
min-height: 10px;
|
2870
|
+
width: 100%;
|
2871
|
+
height: 100%;
|
2872
|
+
display: flex;
|
2873
|
+
flex-direction: column;
|
2874
|
+
}
|
2875
|
+
[data-prefers-color='light'] .videoContainer .videoContainer-grid {
|
2876
|
+
flex: 1;
|
2859
2877
|
width: 100%;
|
2860
2878
|
height: 100%;
|
2861
2879
|
display: grid;
|
package/dist/index.esm.js
CHANGED
@@ -9639,8 +9639,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
|
|
9639
9639
|
};
|
9640
9640
|
|
9641
9641
|
function DialogModel(props, ref) {
|
9642
|
-
var
|
9643
|
-
width = _props$width === void 0 ? 600 : _props$width,
|
9642
|
+
var width = props.width,
|
9644
9643
|
visible = props.visible,
|
9645
9644
|
destroyOnClose = props.destroyOnClose,
|
9646
9645
|
closeCb = props.closeCb,
|
@@ -9702,8 +9701,7 @@ function DialogModel(props, ref) {
|
|
9702
9701
|
className: classnames((_classNames = {}, _defineProperty(_classNames, className, true), _defineProperty(_classNames, 'model_container', true), _defineProperty(_classNames, "animate__animated", true), _defineProperty(_classNames, flag ? 'animate__bounceInDown' : 'animate__fadeOutRightBig', true), _classNames)),
|
9703
9702
|
style: _objectSpread2({
|
9704
9703
|
opacity: modelShowAync ? 1 : 0,
|
9705
|
-
width: typeof width == 'number' ? width + 'px' : width
|
9706
|
-
left: "calc(50% - ".concat(typeof width == 'number' ? width / 2 : width / 2, "px)")
|
9704
|
+
width: typeof width == 'number' ? width + 'px' : width
|
9707
9705
|
}, style)
|
9708
9706
|
}, /*#__PURE__*/React.createElement("div", {
|
9709
9707
|
className: 'model_wrap'
|
@@ -9732,6 +9730,13 @@ function DialogModel(props, ref) {
|
|
9732
9730
|
}
|
9733
9731
|
})), document.body);
|
9734
9732
|
}, [modelShowAync, modelShow, props, isDesChild]);
|
9733
|
+
useEffect(function () {
|
9734
|
+
var containerEl = containerRef.current;
|
9735
|
+
var containerElWidth = containerEl.offsetWidth;
|
9736
|
+
var containerElHeight = containerEl.offsetHeight;
|
9737
|
+
containerEl.style.left = "calc(50% - ".concat(containerElWidth / 2, "px)");
|
9738
|
+
containerEl.style.top = "calc(50% - ".concat(containerElHeight / 2, "px)");
|
9739
|
+
}, [modelShow]);
|
9735
9740
|
useEffect(function () {
|
9736
9741
|
var containerEl = containerRef.current;
|
9737
9742
|
var rEl = rRef.current;
|
@@ -9966,18 +9971,19 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
9966
9971
|
|
9967
9972
|
Modal.show = void 0;
|
9968
9973
|
Modal.hidden = void 0;
|
9974
|
+
Modal.destory = void 0;
|
9975
|
+
var Modals = {};
|
9969
9976
|
|
9970
9977
|
Modal.show = function (config) {
|
9971
|
-
var
|
9972
|
-
|
9973
|
-
if (ModalContainer) return;
|
9978
|
+
var modelSysbol = Math.random().toString(36).slice(2, 36);
|
9979
|
+
if (Modals[modelSysbol]) return;
|
9974
9980
|
|
9975
9981
|
var props = _objectSpread2(_objectSpread2({}, config), {}, {
|
9976
9982
|
visible: true
|
9977
9983
|
});
|
9978
9984
|
|
9979
|
-
var container =
|
9980
|
-
var manager = container[modelSysbol] = {
|
9985
|
+
var container = document.createElement('div');
|
9986
|
+
var manager = container[modelSysbol] = Modals[modelSysbol] = {
|
9981
9987
|
setShow: null,
|
9982
9988
|
mounted: false,
|
9983
9989
|
hidden: function hidden() {
|
@@ -9986,8 +9992,12 @@ Modal.show = function (config) {
|
|
9986
9992
|
},
|
9987
9993
|
destory: function destory() {
|
9988
9994
|
ReactDOM.unmountComponentAtNode(container);
|
9989
|
-
|
9990
|
-
|
9995
|
+
|
9996
|
+
if (document.body.contains(container)) {
|
9997
|
+
document.body.removeChild(container);
|
9998
|
+
}
|
9999
|
+
|
10000
|
+
delete Modals[modelSysbol];
|
9991
10001
|
}
|
9992
10002
|
};
|
9993
10003
|
|
@@ -10019,8 +10029,20 @@ Modal.show = function (config) {
|
|
10019
10029
|
return manager;
|
10020
10030
|
};
|
10021
10031
|
|
10022
|
-
Modal.hidden = function () {
|
10023
|
-
|
10032
|
+
Modal.hidden = function () {
|
10033
|
+
if (Object.keys(Modals).length == 0) return;
|
10034
|
+
|
10035
|
+
for (var key in Modals) {
|
10036
|
+
Modals[key].hidden();
|
10037
|
+
}
|
10038
|
+
};
|
10039
|
+
|
10040
|
+
Modal.destory = function () {
|
10041
|
+
if (Object.keys(Modals).length == 0) return;
|
10042
|
+
|
10043
|
+
for (var key in Modals) {
|
10044
|
+
Modals[key].destory();
|
10045
|
+
}
|
10024
10046
|
};
|
10025
10047
|
|
10026
10048
|
var controlShow$1 = function controlShow(f1, f2, value, timer) {
|
@@ -11108,15 +11130,9 @@ function Xgplay(_ref, fRef) {
|
|
11108
11130
|
setRef = _ref.setRef;
|
11109
11131
|
var ref = useRef(null);
|
11110
11132
|
var playerRef = useRef(null);
|
11111
|
-
|
11112
|
-
var _useState = useState(null),
|
11113
|
-
_useState2 = _slicedToArray(_useState, 2),
|
11114
|
-
player = _useState2[0],
|
11115
|
-
setPlayer = _useState2[1];
|
11116
|
-
|
11117
11133
|
useEffect(function () {
|
11118
11134
|
if (ref.current) {
|
11119
|
-
if (type.indexOf('hls') !== -1) {
|
11135
|
+
if ((type === null || type === void 0 ? void 0 : type.indexOf('hls')) !== -1) {
|
11120
11136
|
playerRef.current = new HlsJsPlayer(_objectSpread2({
|
11121
11137
|
el: ref.current,
|
11122
11138
|
width: '100%',
|
@@ -11125,7 +11141,7 @@ function Xgplay(_ref, fRef) {
|
|
11125
11141
|
isLive: true,
|
11126
11142
|
autoplayMuted: true
|
11127
11143
|
}, config));
|
11128
|
-
} else if (type.indexOf('flv') !== -1) {
|
11144
|
+
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('flv')) !== -1) {
|
11129
11145
|
playerRef.current = new FlvPlayer(_objectSpread2({
|
11130
11146
|
el: ref.current,
|
11131
11147
|
width: '100%',
|
@@ -11134,7 +11150,7 @@ function Xgplay(_ref, fRef) {
|
|
11134
11150
|
isLive: true,
|
11135
11151
|
autoplayMuted: true
|
11136
11152
|
}, config));
|
11137
|
-
} else if (type.indexOf('mp4') !== -1) {
|
11153
|
+
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
11138
11154
|
playerRef.current = new Player(_objectSpread2({
|
11139
11155
|
el: ref.current,
|
11140
11156
|
width: '100%',
|
@@ -11199,11 +11215,7 @@ var IconFont = createFromIconfontCN({
|
|
11199
11215
|
function VideoPlayer(_ref, ref) {
|
11200
11216
|
var _ref$footer = _ref.footer,
|
11201
11217
|
footer = _ref$footer === void 0 ? true : _ref$footer,
|
11202
|
-
|
11203
|
-
style = _ref$style === void 0 ? {
|
11204
|
-
width: 400,
|
11205
|
-
height: 400
|
11206
|
-
} : _ref$style,
|
11218
|
+
style = _ref.style,
|
11207
11219
|
_ref$config = _ref.config,
|
11208
11220
|
config = _ref$config === void 0 ? {} : _ref$config,
|
11209
11221
|
layoutIndex = _ref.layoutIndex,
|
@@ -11247,20 +11259,25 @@ function VideoPlayer(_ref, ref) {
|
|
11247
11259
|
currentLayoutIndex = _useState2[0],
|
11248
11260
|
setCurrentLayoutIndex = _useState2[1];
|
11249
11261
|
|
11262
|
+
var _useState3 = useState(url),
|
11263
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
11264
|
+
urls = _useState4[0],
|
11265
|
+
setUrls = _useState4[1];
|
11266
|
+
|
11250
11267
|
var initPlayerIndex = layouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : layouts[layoutIndex || 0].span - 1;
|
11251
11268
|
|
11252
|
-
var
|
11253
|
-
|
11254
|
-
currentPlayerIndex =
|
11255
|
-
setCurrentPlayerIndex =
|
11269
|
+
var _useState5 = useState(initPlayerIndex),
|
11270
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
11271
|
+
currentPlayerIndex = _useState6[0],
|
11272
|
+
setCurrentPlayerIndex = _useState6[1];
|
11256
11273
|
|
11257
11274
|
var domRef = useRef(null);
|
11258
11275
|
var playerRef = useRef({});
|
11259
11276
|
|
11260
|
-
var
|
11261
|
-
|
11262
|
-
players =
|
11263
|
-
setPlayers =
|
11277
|
+
var _useState7 = useState([]),
|
11278
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
11279
|
+
players = _useState8[0],
|
11280
|
+
setPlayers = _useState8[1];
|
11264
11281
|
|
11265
11282
|
var renderDom = useMemo(function () {
|
11266
11283
|
var arr = new Array(layouts[currentLayoutIndex].span).fill(0);
|
@@ -11271,16 +11288,16 @@ function VideoPlayer(_ref, ref) {
|
|
11271
11288
|
onClickCapture: function onClickCapture() {
|
11272
11289
|
setCurrentPlayerIndex(index);
|
11273
11290
|
}
|
11274
|
-
},
|
11291
|
+
}, urls[index] ? /*#__PURE__*/React.createElement(Xgplay$1, {
|
11275
11292
|
setRef: function setRef(ref) {
|
11276
11293
|
return setPlayers(function (players) {
|
11277
11294
|
players[index] = ref;
|
11278
11295
|
return players;
|
11279
11296
|
});
|
11280
11297
|
},
|
11281
|
-
type:
|
11298
|
+
type: urls[index],
|
11282
11299
|
config: _objectSpread2({
|
11283
|
-
url:
|
11300
|
+
url: urls[index],
|
11284
11301
|
fluid: true
|
11285
11302
|
}, config)
|
11286
11303
|
}) : /*#__PURE__*/React.createElement("div", {
|
@@ -11293,7 +11310,7 @@ function VideoPlayer(_ref, ref) {
|
|
11293
11310
|
}
|
11294
11311
|
}));
|
11295
11312
|
});
|
11296
|
-
}, [currentLayoutIndex, currentPlayerIndex, playerRef,
|
11313
|
+
}, [currentLayoutIndex, currentPlayerIndex, playerRef, urls]);
|
11297
11314
|
|
11298
11315
|
function exitFullscreen() {
|
11299
11316
|
if (document.exitFullscreen) {
|
@@ -11320,10 +11337,13 @@ function VideoPlayer(_ref, ref) {
|
|
11320
11337
|
var currentPlayer = players[currentPlayerIndex];
|
11321
11338
|
|
11322
11339
|
if (currentPlayer) {
|
11323
|
-
|
11324
|
-
currentPlayer.src = url; // debugger
|
11325
|
-
// currentPlayer.start(url)
|
11340
|
+
currentPlayer.src = url;
|
11326
11341
|
}
|
11342
|
+
|
11343
|
+
setUrls(function (urls) {
|
11344
|
+
urls[currentPlayerIndex] = url;
|
11345
|
+
return _toConsumableArray(urls);
|
11346
|
+
});
|
11327
11347
|
};
|
11328
11348
|
|
11329
11349
|
useImperativeHandle(ref, function () {
|
@@ -11331,14 +11351,16 @@ function VideoPlayer(_ref, ref) {
|
|
11331
11351
|
players: players,
|
11332
11352
|
currentLayoutIndex: currentLayoutIndex,
|
11333
11353
|
currentPlayerIndex: currentPlayerIndex,
|
11354
|
+
urls: urls,
|
11334
11355
|
loadCamera: loadCamera
|
11335
11356
|
};
|
11336
11357
|
});
|
11337
11358
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
11359
|
+
className: "videoContainer",
|
11338
11360
|
style: style
|
11339
11361
|
}, /*#__PURE__*/React.createElement("div", {
|
11340
11362
|
ref: domRef,
|
11341
|
-
className: "videoContainer",
|
11363
|
+
className: "videoContainer-grid",
|
11342
11364
|
style: layouts[currentLayoutIndex].style
|
11343
11365
|
}, renderDom), footer ? /*#__PURE__*/React.createElement("div", {
|
11344
11366
|
className: "tools"
|
package/dist/index.js
CHANGED
@@ -9677,8 +9677,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
|
|
9677
9677
|
};
|
9678
9678
|
|
9679
9679
|
function DialogModel(props, ref) {
|
9680
|
-
var
|
9681
|
-
width = _props$width === void 0 ? 600 : _props$width,
|
9680
|
+
var width = props.width,
|
9682
9681
|
visible = props.visible,
|
9683
9682
|
destroyOnClose = props.destroyOnClose,
|
9684
9683
|
closeCb = props.closeCb,
|
@@ -9740,8 +9739,7 @@ function DialogModel(props, ref) {
|
|
9740
9739
|
className: classnames__default['default']((_classNames = {}, _defineProperty(_classNames, className, true), _defineProperty(_classNames, 'model_container', true), _defineProperty(_classNames, "animate__animated", true), _defineProperty(_classNames, flag ? 'animate__bounceInDown' : 'animate__fadeOutRightBig', true), _classNames)),
|
9741
9740
|
style: _objectSpread2({
|
9742
9741
|
opacity: modelShowAync ? 1 : 0,
|
9743
|
-
width: typeof width == 'number' ? width + 'px' : width
|
9744
|
-
left: "calc(50% - ".concat(typeof width == 'number' ? width / 2 : width / 2, "px)")
|
9742
|
+
width: typeof width == 'number' ? width + 'px' : width
|
9745
9743
|
}, style)
|
9746
9744
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
9747
9745
|
className: 'model_wrap'
|
@@ -9770,6 +9768,13 @@ function DialogModel(props, ref) {
|
|
9770
9768
|
}
|
9771
9769
|
})), document.body);
|
9772
9770
|
}, [modelShowAync, modelShow, props, isDesChild]);
|
9771
|
+
React.useEffect(function () {
|
9772
|
+
var containerEl = containerRef.current;
|
9773
|
+
var containerElWidth = containerEl.offsetWidth;
|
9774
|
+
var containerElHeight = containerEl.offsetHeight;
|
9775
|
+
containerEl.style.left = "calc(50% - ".concat(containerElWidth / 2, "px)");
|
9776
|
+
containerEl.style.top = "calc(50% - ".concat(containerElHeight / 2, "px)");
|
9777
|
+
}, [modelShow]);
|
9773
9778
|
React.useEffect(function () {
|
9774
9779
|
var containerEl = containerRef.current;
|
9775
9780
|
var rEl = rRef.current;
|
@@ -10004,18 +10009,19 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
10004
10009
|
|
10005
10010
|
Modal.show = void 0;
|
10006
10011
|
Modal.hidden = void 0;
|
10012
|
+
Modal.destory = void 0;
|
10013
|
+
var Modals = {};
|
10007
10014
|
|
10008
10015
|
Modal.show = function (config) {
|
10009
|
-
var
|
10010
|
-
|
10011
|
-
if (ModalContainer) return;
|
10016
|
+
var modelSysbol = Math.random().toString(36).slice(2, 36);
|
10017
|
+
if (Modals[modelSysbol]) return;
|
10012
10018
|
|
10013
10019
|
var props = _objectSpread2(_objectSpread2({}, config), {}, {
|
10014
10020
|
visible: true
|
10015
10021
|
});
|
10016
10022
|
|
10017
|
-
var container =
|
10018
|
-
var manager = container[modelSysbol] = {
|
10023
|
+
var container = document.createElement('div');
|
10024
|
+
var manager = container[modelSysbol] = Modals[modelSysbol] = {
|
10019
10025
|
setShow: null,
|
10020
10026
|
mounted: false,
|
10021
10027
|
hidden: function hidden() {
|
@@ -10024,8 +10030,12 @@ Modal.show = function (config) {
|
|
10024
10030
|
},
|
10025
10031
|
destory: function destory() {
|
10026
10032
|
ReactDOM__default['default'].unmountComponentAtNode(container);
|
10027
|
-
|
10028
|
-
|
10033
|
+
|
10034
|
+
if (document.body.contains(container)) {
|
10035
|
+
document.body.removeChild(container);
|
10036
|
+
}
|
10037
|
+
|
10038
|
+
delete Modals[modelSysbol];
|
10029
10039
|
}
|
10030
10040
|
};
|
10031
10041
|
|
@@ -10057,8 +10067,20 @@ Modal.show = function (config) {
|
|
10057
10067
|
return manager;
|
10058
10068
|
};
|
10059
10069
|
|
10060
|
-
Modal.hidden = function () {
|
10061
|
-
|
10070
|
+
Modal.hidden = function () {
|
10071
|
+
if (Object.keys(Modals).length == 0) return;
|
10072
|
+
|
10073
|
+
for (var key in Modals) {
|
10074
|
+
Modals[key].hidden();
|
10075
|
+
}
|
10076
|
+
};
|
10077
|
+
|
10078
|
+
Modal.destory = function () {
|
10079
|
+
if (Object.keys(Modals).length == 0) return;
|
10080
|
+
|
10081
|
+
for (var key in Modals) {
|
10082
|
+
Modals[key].destory();
|
10083
|
+
}
|
10062
10084
|
};
|
10063
10085
|
|
10064
10086
|
var controlShow$1 = function controlShow(f1, f2, value, timer) {
|
@@ -11146,15 +11168,9 @@ function Xgplay(_ref, fRef) {
|
|
11146
11168
|
setRef = _ref.setRef;
|
11147
11169
|
var ref = React.useRef(null);
|
11148
11170
|
var playerRef = React.useRef(null);
|
11149
|
-
|
11150
|
-
var _useState = React.useState(null),
|
11151
|
-
_useState2 = _slicedToArray(_useState, 2),
|
11152
|
-
player = _useState2[0],
|
11153
|
-
setPlayer = _useState2[1];
|
11154
|
-
|
11155
11171
|
React.useEffect(function () {
|
11156
11172
|
if (ref.current) {
|
11157
|
-
if (type.indexOf('hls') !== -1) {
|
11173
|
+
if ((type === null || type === void 0 ? void 0 : type.indexOf('hls')) !== -1) {
|
11158
11174
|
playerRef.current = new HlsJsPlayer__default['default'](_objectSpread2({
|
11159
11175
|
el: ref.current,
|
11160
11176
|
width: '100%',
|
@@ -11163,7 +11179,7 @@ function Xgplay(_ref, fRef) {
|
|
11163
11179
|
isLive: true,
|
11164
11180
|
autoplayMuted: true
|
11165
11181
|
}, config));
|
11166
|
-
} else if (type.indexOf('flv') !== -1) {
|
11182
|
+
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('flv')) !== -1) {
|
11167
11183
|
playerRef.current = new FlvPlayer__default['default'](_objectSpread2({
|
11168
11184
|
el: ref.current,
|
11169
11185
|
width: '100%',
|
@@ -11172,7 +11188,7 @@ function Xgplay(_ref, fRef) {
|
|
11172
11188
|
isLive: true,
|
11173
11189
|
autoplayMuted: true
|
11174
11190
|
}, config));
|
11175
|
-
} else if (type.indexOf('mp4') !== -1) {
|
11191
|
+
} else if ((type === null || type === void 0 ? void 0 : type.indexOf('mp4')) !== -1) {
|
11176
11192
|
playerRef.current = new Player__default['default'](_objectSpread2({
|
11177
11193
|
el: ref.current,
|
11178
11194
|
width: '100%',
|
@@ -11237,11 +11253,7 @@ var IconFont = icons.createFromIconfontCN({
|
|
11237
11253
|
function VideoPlayer(_ref, ref) {
|
11238
11254
|
var _ref$footer = _ref.footer,
|
11239
11255
|
footer = _ref$footer === void 0 ? true : _ref$footer,
|
11240
|
-
|
11241
|
-
style = _ref$style === void 0 ? {
|
11242
|
-
width: 400,
|
11243
|
-
height: 400
|
11244
|
-
} : _ref$style,
|
11256
|
+
style = _ref.style,
|
11245
11257
|
_ref$config = _ref.config,
|
11246
11258
|
config = _ref$config === void 0 ? {} : _ref$config,
|
11247
11259
|
layoutIndex = _ref.layoutIndex,
|
@@ -11285,20 +11297,25 @@ function VideoPlayer(_ref, ref) {
|
|
11285
11297
|
currentLayoutIndex = _useState2[0],
|
11286
11298
|
setCurrentLayoutIndex = _useState2[1];
|
11287
11299
|
|
11300
|
+
var _useState3 = React.useState(url),
|
11301
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
11302
|
+
urls = _useState4[0],
|
11303
|
+
setUrls = _useState4[1];
|
11304
|
+
|
11288
11305
|
var initPlayerIndex = layouts[layoutIndex || 0].span >= url.length ? url.length - 1 >= 0 ? url.length - 1 : 0 : layouts[layoutIndex || 0].span - 1;
|
11289
11306
|
|
11290
|
-
var
|
11291
|
-
|
11292
|
-
currentPlayerIndex =
|
11293
|
-
setCurrentPlayerIndex =
|
11307
|
+
var _useState5 = React.useState(initPlayerIndex),
|
11308
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
11309
|
+
currentPlayerIndex = _useState6[0],
|
11310
|
+
setCurrentPlayerIndex = _useState6[1];
|
11294
11311
|
|
11295
11312
|
var domRef = React.useRef(null);
|
11296
11313
|
var playerRef = React.useRef({});
|
11297
11314
|
|
11298
|
-
var
|
11299
|
-
|
11300
|
-
players =
|
11301
|
-
setPlayers =
|
11315
|
+
var _useState7 = React.useState([]),
|
11316
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
11317
|
+
players = _useState8[0],
|
11318
|
+
setPlayers = _useState8[1];
|
11302
11319
|
|
11303
11320
|
var renderDom = React.useMemo(function () {
|
11304
11321
|
var arr = new Array(layouts[currentLayoutIndex].span).fill(0);
|
@@ -11309,16 +11326,16 @@ function VideoPlayer(_ref, ref) {
|
|
11309
11326
|
onClickCapture: function onClickCapture() {
|
11310
11327
|
setCurrentPlayerIndex(index);
|
11311
11328
|
}
|
11312
|
-
},
|
11329
|
+
}, urls[index] ? /*#__PURE__*/React__default['default'].createElement(Xgplay$1, {
|
11313
11330
|
setRef: function setRef(ref) {
|
11314
11331
|
return setPlayers(function (players) {
|
11315
11332
|
players[index] = ref;
|
11316
11333
|
return players;
|
11317
11334
|
});
|
11318
11335
|
},
|
11319
|
-
type:
|
11336
|
+
type: urls[index],
|
11320
11337
|
config: _objectSpread2({
|
11321
|
-
url:
|
11338
|
+
url: urls[index],
|
11322
11339
|
fluid: true
|
11323
11340
|
}, config)
|
11324
11341
|
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
@@ -11331,7 +11348,7 @@ function VideoPlayer(_ref, ref) {
|
|
11331
11348
|
}
|
11332
11349
|
}));
|
11333
11350
|
});
|
11334
|
-
}, [currentLayoutIndex, currentPlayerIndex, playerRef,
|
11351
|
+
}, [currentLayoutIndex, currentPlayerIndex, playerRef, urls]);
|
11335
11352
|
|
11336
11353
|
function exitFullscreen() {
|
11337
11354
|
if (document.exitFullscreen) {
|
@@ -11358,10 +11375,13 @@ function VideoPlayer(_ref, ref) {
|
|
11358
11375
|
var currentPlayer = players[currentPlayerIndex];
|
11359
11376
|
|
11360
11377
|
if (currentPlayer) {
|
11361
|
-
|
11362
|
-
currentPlayer.src = url; // debugger
|
11363
|
-
// currentPlayer.start(url)
|
11378
|
+
currentPlayer.src = url;
|
11364
11379
|
}
|
11380
|
+
|
11381
|
+
setUrls(function (urls) {
|
11382
|
+
urls[currentPlayerIndex] = url;
|
11383
|
+
return _toConsumableArray(urls);
|
11384
|
+
});
|
11365
11385
|
};
|
11366
11386
|
|
11367
11387
|
React.useImperativeHandle(ref, function () {
|
@@ -11369,14 +11389,16 @@ function VideoPlayer(_ref, ref) {
|
|
11369
11389
|
players: players,
|
11370
11390
|
currentLayoutIndex: currentLayoutIndex,
|
11371
11391
|
currentPlayerIndex: currentPlayerIndex,
|
11392
|
+
urls: urls,
|
11372
11393
|
loadCamera: loadCamera
|
11373
11394
|
};
|
11374
11395
|
});
|
11375
11396
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
11397
|
+
className: "videoContainer",
|
11376
11398
|
style: style
|
11377
11399
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
11378
11400
|
ref: domRef,
|
11379
|
-
className: "videoContainer",
|
11401
|
+
className: "videoContainer-grid",
|
11380
11402
|
style: layouts[currentLayoutIndex].style
|
11381
11403
|
}, renderDom), footer ? /*#__PURE__*/React__default['default'].createElement("div", {
|
11382
11404
|
className: "tools"
|