@cloud-app-dev/vidc 3.2.6 → 3.2.8
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.
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type Api from './api';
|
|
2
|
+
import type VideoEventInstance from './event';
|
|
3
|
+
declare function useLiveHeart({ api, event, isLive }: {
|
|
4
|
+
api: Api;
|
|
5
|
+
event: VideoEventInstance;
|
|
2
6
|
isLive: boolean;
|
|
3
7
|
}): void;
|
|
4
8
|
export default useLiveHeart;
|
package/es/Player/live_heart.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import _useRafInterval from "ahooks/es/useRafInterval";
|
|
2
2
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
3
3
|
import _useDocumentVisibility from "ahooks/es/useDocumentVisibility";
|
|
4
|
-
import {
|
|
5
|
-
import { Context } from './context';
|
|
4
|
+
import { useRef } from 'react';
|
|
6
5
|
import Events from './event/eventName';
|
|
7
6
|
function useLiveHeart(_ref) {
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
event = _useContext.event;
|
|
7
|
+
var api = _ref.api,
|
|
8
|
+
event = _ref.event,
|
|
9
|
+
isLive = _ref.isLive;
|
|
12
10
|
var documentVisibility = _useDocumentVisibility();
|
|
13
11
|
var cTimeRef = useRef(null);
|
|
14
12
|
var run = function run() {
|
|
@@ -80,7 +80,7 @@ export interface IRecordPlayerProps {
|
|
|
80
80
|
/**
|
|
81
81
|
* 自定义合成前端录像
|
|
82
82
|
*/
|
|
83
|
-
getLocalRecordUrl?: (options: { url: URL; begin: number; end: number }) => Promise<string>;
|
|
83
|
+
getLocalRecordUrl?: (options: { url: URL; begin: number; end: number; screenIndex: number }) => Promise<string>;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* 插件下载地址
|
package/es/useDrawROI/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _useEventListener from "ahooks/es/useEventListener";
|
|
2
2
|
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
3
|
+
import _usePrevious from "ahooks/es/usePrevious";
|
|
3
4
|
import _useSize from "ahooks/es/useSize";
|
|
4
5
|
import _useLatest from "ahooks/es/useLatest";
|
|
5
6
|
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
@@ -36,16 +37,28 @@ function useDrawROI(target, _ref) {
|
|
|
36
37
|
setState = _useSimpleState2[2];
|
|
37
38
|
var isOpenRef = _useLatest(state.isOpen);
|
|
38
39
|
var size = _useSize(target);
|
|
40
|
+
var oldSize = _usePrevious(size);
|
|
39
41
|
useEffect(function () {
|
|
42
|
+
if (!(size === null || size === void 0 ? void 0 : size.width)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
40
45
|
var canvas = getTargetElement(target);
|
|
41
46
|
canvas.width = size === null || size === void 0 ? void 0 : size.width;
|
|
42
47
|
canvas.height = size === null || size === void 0 ? void 0 : size.height;
|
|
43
|
-
console.warn('canvas,size
|
|
48
|
+
console.warn('canvas,size变化!');
|
|
49
|
+
if (!(oldSize === null || oldSize === void 0 ? void 0 : oldSize.width)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
var scale = size.width / oldSize.width;
|
|
44
53
|
setState(function (old) {
|
|
45
54
|
return Object.assign(Object.assign({}, old), {
|
|
46
55
|
pos: [],
|
|
47
56
|
tempPos: [],
|
|
48
|
-
saveArea:
|
|
57
|
+
saveArea: old.saveArea.map(function (area) {
|
|
58
|
+
return area.map(function (v) {
|
|
59
|
+
return [v[0] * scale, v[1] * scale];
|
|
60
|
+
});
|
|
61
|
+
})
|
|
49
62
|
});
|
|
50
63
|
});
|
|
51
64
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|