wargerm 0.6.19 → 0.6.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/VideoPlayer/index.d.ts +1 -2
- package/dist/index.esm.js +27 -16
- package/dist/index.js +27 -16
- package/dist/utils/event.d.ts +1 -1
- package/package.json +1 -1
@@ -7,9 +7,8 @@ declare type propsType = {
|
|
7
7
|
};
|
8
8
|
layouts?: Array<any>;
|
9
9
|
layoutIndex?: number;
|
10
|
-
config?:
|
10
|
+
config?: Record<any, any>;
|
11
11
|
url?: string[];
|
12
|
-
onDoubleClickCapture?: any;
|
13
12
|
};
|
14
13
|
declare const _default: React.ForwardRefExoticComponent<propsType & React.RefAttributes<unknown>>;
|
15
14
|
export default _default;
|
package/dist/index.esm.js
CHANGED
@@ -464,11 +464,12 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
464
464
|
|
465
465
|
this.subscriptions = new Map();
|
466
466
|
|
467
|
-
this.useSubscription = function (event, listener) {
|
467
|
+
this.useSubscription = function (event, listener, deps) {
|
468
468
|
var callbackRef = useRef();
|
469
469
|
useEffect(function () {
|
470
470
|
callbackRef.current = listener;
|
471
|
-
|
471
|
+
}, [deps]);
|
472
|
+
useEffect(function () {
|
472
473
|
function subscription(val) {
|
473
474
|
if (callbackRef.current) {
|
474
475
|
callbackRef.current(val);
|
@@ -6920,7 +6921,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6920
6921
|
|
6921
6922
|
var ModalForm$1 = /*#__PURE__*/React.forwardRef(ModalForm);
|
6922
6923
|
|
6923
|
-
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
|
6924
|
+
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
|
6924
6925
|
|
6925
6926
|
var TabelCard = function TabelCard(props, ref) {
|
6926
6927
|
var columns = props.columns,
|
@@ -6931,6 +6932,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
6931
6932
|
tableAction = props.tableAction,
|
6932
6933
|
fliterAction = props.fliterAction,
|
6933
6934
|
renderTableBar = props.renderTableBar,
|
6935
|
+
renderTableBarDeps = props.renderTableBarDeps,
|
6934
6936
|
className = props.className,
|
6935
6937
|
style = props.style,
|
6936
6938
|
onFormChange = props.onFormChange,
|
@@ -7350,7 +7352,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7350
7352
|
});
|
7351
7353
|
}
|
7352
7354
|
});
|
7353
|
-
}, [actionRef]);
|
7355
|
+
}, [actionRef, renderTableBarDeps]);
|
7354
7356
|
|
7355
7357
|
var onSubmit = function onSubmit(values) {
|
7356
7358
|
var _actionRef$current6;
|
@@ -8144,6 +8146,10 @@ function Xgplay(_ref, fRef) {
|
|
8144
8146
|
var ref = useRef(null);
|
8145
8147
|
var playerRef = useRef(null);
|
8146
8148
|
useEffect(function () {
|
8149
|
+
var onRequestFullscreen = function onRequestFullscreen() {
|
8150
|
+
config.onRequestFullscreen && config.onRequestFullscreen();
|
8151
|
+
};
|
8152
|
+
|
8147
8153
|
if (ref.current) {
|
8148
8154
|
if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
|
8149
8155
|
playerRef.current = new HlsJsPlayer(_objectSpread2({
|
@@ -8188,15 +8194,18 @@ function Xgplay(_ref, fRef) {
|
|
8188
8194
|
}, config));
|
8189
8195
|
setRef(playerRef.current);
|
8190
8196
|
}
|
8197
|
+
|
8198
|
+
playerRef.current.on('requestFullscreen', onRequestFullscreen);
|
8191
8199
|
}
|
8192
8200
|
|
8193
8201
|
return function () {
|
8194
|
-
var _playerRef$current, _playerRef$current2, _playerRef$
|
8202
|
+
var _playerRef$current, _playerRef$current2, _playerRef$current3, _playerRef$current3$h, _playerRef$current4, _playerRef$current4$f, _playerRef$current5;
|
8195
8203
|
|
8196
|
-
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.
|
8197
|
-
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 :
|
8198
|
-
(_playerRef$current3 = playerRef.current) === null || _playerRef$current3 === void 0 ? void 0 : (_playerRef$current3$
|
8199
|
-
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : _playerRef$current4.destroy(
|
8204
|
+
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.off('requestFullscreen', onRequestFullscreen);
|
8205
|
+
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 : _playerRef$current2.pause();
|
8206
|
+
(_playerRef$current3 = playerRef.current) === null || _playerRef$current3 === void 0 ? void 0 : (_playerRef$current3$h = _playerRef$current3.hls) === null || _playerRef$current3$h === void 0 ? void 0 : _playerRef$current3$h.destroy();
|
8207
|
+
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : (_playerRef$current4$f = _playerRef$current4.flv) === null || _playerRef$current4$f === void 0 ? void 0 : _playerRef$current4$f.destroy();
|
8208
|
+
(_playerRef$current5 = playerRef.current) === null || _playerRef$current5 === void 0 ? void 0 : _playerRef$current5.destroy(true);
|
8200
8209
|
setRef(null);
|
8201
8210
|
playerRef.current = null;
|
8202
8211
|
};
|
@@ -8242,7 +8251,6 @@ function VideoPlayer(_ref, ref) {
|
|
8242
8251
|
_ref$config = _ref.config,
|
8243
8252
|
config = _ref$config === void 0 ? {} : _ref$config,
|
8244
8253
|
layoutIndex = _ref.layoutIndex,
|
8245
|
-
_onDoubleClickCapture = _ref.onDoubleClickCapture,
|
8246
8254
|
_ref$url = _ref.url,
|
8247
8255
|
url = _ref$url === void 0 ? [] : _ref$url,
|
8248
8256
|
_ref$layouts = _ref.layouts,
|
@@ -8317,9 +8325,6 @@ function VideoPlayer(_ref, ref) {
|
|
8317
8325
|
className: "camera ".concat(currentPlayerIndex == index && arr.length > 1 ? 'activeCamera' : 'noneborder'),
|
8318
8326
|
onClickCapture: function onClickCapture() {
|
8319
8327
|
setCurrentPlayerIndex(index);
|
8320
|
-
},
|
8321
|
-
onDoubleClickCapture: function onDoubleClickCapture() {
|
8322
|
-
_onDoubleClickCapture && _onDoubleClickCapture(index, !document.fullscreenElement);
|
8323
8328
|
}
|
8324
8329
|
}, urls[index] ? /*#__PURE__*/React.createElement(Xgplay$1, {
|
8325
8330
|
setRef: function setRef(ref) {
|
@@ -8329,10 +8334,16 @@ function VideoPlayer(_ref, ref) {
|
|
8329
8334
|
});
|
8330
8335
|
},
|
8331
8336
|
type: urls[index],
|
8332
|
-
config: _objectSpread2({
|
8337
|
+
config: _objectSpread2(_objectSpread2({
|
8333
8338
|
url: urls[index],
|
8334
|
-
fluid: true
|
8335
|
-
|
8339
|
+
fluid: true,
|
8340
|
+
// cssFullscreen: true,
|
8341
|
+
closeVideoClick: true
|
8342
|
+
}, config), {}, {
|
8343
|
+
onRequestFullscreen: function onRequestFullscreen() {
|
8344
|
+
config.onRequestFullscreen && config.onRequestFullscreen(index);
|
8345
|
+
}
|
8346
|
+
})
|
8336
8347
|
}) : /*#__PURE__*/React.createElement("div", {
|
8337
8348
|
className: "empty",
|
8338
8349
|
onDoubleClick: function onDoubleClick() {
|
package/dist/index.js
CHANGED
@@ -529,11 +529,12 @@ var EventEmitter = /*#__PURE__*/_createClass(function EventEmitter() {
|
|
529
529
|
|
530
530
|
this.subscriptions = new Map();
|
531
531
|
|
532
|
-
this.useSubscription = function (event, listener) {
|
532
|
+
this.useSubscription = function (event, listener, deps) {
|
533
533
|
var callbackRef = React.useRef();
|
534
534
|
React.useEffect(function () {
|
535
535
|
callbackRef.current = listener;
|
536
|
-
|
536
|
+
}, [deps]);
|
537
|
+
React.useEffect(function () {
|
537
538
|
function subscription(val) {
|
538
539
|
if (callbackRef.current) {
|
539
540
|
callbackRef.current(val);
|
@@ -6985,7 +6986,7 @@ var ModalForm = function ModalForm(props, ref) {
|
|
6985
6986
|
|
6986
6987
|
var ModalForm$1 = /*#__PURE__*/React__default['default'].forwardRef(ModalForm);
|
6987
6988
|
|
6988
|
-
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
|
6989
|
+
var _excluded$l = ["columns", "extraColumns", "request", "modalFormSearch", "search", "tableAction", "fliterAction", "renderTableBar", "renderTableBarDeps", "className", "style", "onFormChange", "modalConfig", "searchFormConfig", "optionColumnConfig", "pagination", "noBordered"];
|
6989
6990
|
|
6990
6991
|
var TabelCard = function TabelCard(props, ref) {
|
6991
6992
|
var columns = props.columns,
|
@@ -6996,6 +6997,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
6996
6997
|
tableAction = props.tableAction,
|
6997
6998
|
fliterAction = props.fliterAction,
|
6998
6999
|
renderTableBar = props.renderTableBar,
|
7000
|
+
renderTableBarDeps = props.renderTableBarDeps,
|
6999
7001
|
className = props.className,
|
7000
7002
|
style = props.style,
|
7001
7003
|
onFormChange = props.onFormChange,
|
@@ -7415,7 +7417,7 @@ var TabelCard = function TabelCard(props, ref) {
|
|
7415
7417
|
});
|
7416
7418
|
}
|
7417
7419
|
});
|
7418
|
-
}, [actionRef]);
|
7420
|
+
}, [actionRef, renderTableBarDeps]);
|
7419
7421
|
|
7420
7422
|
var onSubmit = function onSubmit(values) {
|
7421
7423
|
var _actionRef$current6;
|
@@ -8209,6 +8211,10 @@ function Xgplay(_ref, fRef) {
|
|
8209
8211
|
var ref = React.useRef(null);
|
8210
8212
|
var playerRef = React.useRef(null);
|
8211
8213
|
React.useEffect(function () {
|
8214
|
+
var onRequestFullscreen = function onRequestFullscreen() {
|
8215
|
+
config.onRequestFullscreen && config.onRequestFullscreen();
|
8216
|
+
};
|
8217
|
+
|
8212
8218
|
if (ref.current) {
|
8213
8219
|
if ((type === null || type === void 0 ? void 0 : type.indexOf('m3u8')) !== -1) {
|
8214
8220
|
playerRef.current = new HlsJsPlayer__default['default'](_objectSpread2({
|
@@ -8253,15 +8259,18 @@ function Xgplay(_ref, fRef) {
|
|
8253
8259
|
}, config));
|
8254
8260
|
setRef(playerRef.current);
|
8255
8261
|
}
|
8262
|
+
|
8263
|
+
playerRef.current.on('requestFullscreen', onRequestFullscreen);
|
8256
8264
|
}
|
8257
8265
|
|
8258
8266
|
return function () {
|
8259
|
-
var _playerRef$current, _playerRef$current2, _playerRef$
|
8267
|
+
var _playerRef$current, _playerRef$current2, _playerRef$current3, _playerRef$current3$h, _playerRef$current4, _playerRef$current4$f, _playerRef$current5;
|
8260
8268
|
|
8261
|
-
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.
|
8262
|
-
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 :
|
8263
|
-
(_playerRef$current3 = playerRef.current) === null || _playerRef$current3 === void 0 ? void 0 : (_playerRef$current3$
|
8264
|
-
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : _playerRef$current4.destroy(
|
8269
|
+
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.off('requestFullscreen', onRequestFullscreen);
|
8270
|
+
(_playerRef$current2 = playerRef.current) === null || _playerRef$current2 === void 0 ? void 0 : _playerRef$current2.pause();
|
8271
|
+
(_playerRef$current3 = playerRef.current) === null || _playerRef$current3 === void 0 ? void 0 : (_playerRef$current3$h = _playerRef$current3.hls) === null || _playerRef$current3$h === void 0 ? void 0 : _playerRef$current3$h.destroy();
|
8272
|
+
(_playerRef$current4 = playerRef.current) === null || _playerRef$current4 === void 0 ? void 0 : (_playerRef$current4$f = _playerRef$current4.flv) === null || _playerRef$current4$f === void 0 ? void 0 : _playerRef$current4$f.destroy();
|
8273
|
+
(_playerRef$current5 = playerRef.current) === null || _playerRef$current5 === void 0 ? void 0 : _playerRef$current5.destroy(true);
|
8265
8274
|
setRef(null);
|
8266
8275
|
playerRef.current = null;
|
8267
8276
|
};
|
@@ -8307,7 +8316,6 @@ function VideoPlayer(_ref, ref) {
|
|
8307
8316
|
_ref$config = _ref.config,
|
8308
8317
|
config = _ref$config === void 0 ? {} : _ref$config,
|
8309
8318
|
layoutIndex = _ref.layoutIndex,
|
8310
|
-
_onDoubleClickCapture = _ref.onDoubleClickCapture,
|
8311
8319
|
_ref$url = _ref.url,
|
8312
8320
|
url = _ref$url === void 0 ? [] : _ref$url,
|
8313
8321
|
_ref$layouts = _ref.layouts,
|
@@ -8382,9 +8390,6 @@ function VideoPlayer(_ref, ref) {
|
|
8382
8390
|
className: "camera ".concat(currentPlayerIndex == index && arr.length > 1 ? 'activeCamera' : 'noneborder'),
|
8383
8391
|
onClickCapture: function onClickCapture() {
|
8384
8392
|
setCurrentPlayerIndex(index);
|
8385
|
-
},
|
8386
|
-
onDoubleClickCapture: function onDoubleClickCapture() {
|
8387
|
-
_onDoubleClickCapture && _onDoubleClickCapture(index, !document.fullscreenElement);
|
8388
8393
|
}
|
8389
8394
|
}, urls[index] ? /*#__PURE__*/React__default['default'].createElement(Xgplay$1, {
|
8390
8395
|
setRef: function setRef(ref) {
|
@@ -8394,10 +8399,16 @@ function VideoPlayer(_ref, ref) {
|
|
8394
8399
|
});
|
8395
8400
|
},
|
8396
8401
|
type: urls[index],
|
8397
|
-
config: _objectSpread2({
|
8402
|
+
config: _objectSpread2(_objectSpread2({
|
8398
8403
|
url: urls[index],
|
8399
|
-
fluid: true
|
8400
|
-
|
8404
|
+
fluid: true,
|
8405
|
+
// cssFullscreen: true,
|
8406
|
+
closeVideoClick: true
|
8407
|
+
}, config), {}, {
|
8408
|
+
onRequestFullscreen: function onRequestFullscreen() {
|
8409
|
+
config.onRequestFullscreen && config.onRequestFullscreen(index);
|
8410
|
+
}
|
8411
|
+
})
|
8401
8412
|
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
8402
8413
|
className: "empty",
|
8403
8414
|
onDoubleClick: function onDoubleClick() {
|
package/dist/utils/event.d.ts
CHANGED
@@ -6,7 +6,7 @@ declare type Subscription<T> = ({ params, event }: SubscriptionParams<T>) => voi
|
|
6
6
|
declare class EventEmitter<T> {
|
7
7
|
private subscriptions;
|
8
8
|
constructor();
|
9
|
-
useSubscription: (event: string, listener?: Subscription<T> | undefined) => void;
|
9
|
+
useSubscription: (event: string, listener?: Subscription<T> | undefined, deps?: any) => void;
|
10
10
|
emit: (event: string | number, ...args: T extends any[] ? any[] : any) => void;
|
11
11
|
removeListener: (event: string) => void;
|
12
12
|
clear: () => void;
|