@cloud-app-dev/vidc 3.0.44 → 3.0.45
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.
|
@@ -25,10 +25,22 @@ var App = function App() {
|
|
|
25
25
|
type = _useState4[0],
|
|
26
26
|
setType = _useState4[1];
|
|
27
27
|
|
|
28
|
+
var _useState5 = useState({
|
|
29
|
+
zoom: null,
|
|
30
|
+
center: null
|
|
31
|
+
}),
|
|
32
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
33
|
+
state = _useState6[0],
|
|
34
|
+
setState = _useState6[1];
|
|
35
|
+
|
|
28
36
|
useEffect(function () {
|
|
29
37
|
setTimeout(function () {
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
setPoints(deviceList);
|
|
39
|
+
setState({
|
|
40
|
+
center: [116.397392, 39.918206],
|
|
41
|
+
zoom: 13.74
|
|
42
|
+
});
|
|
43
|
+
}, 1000);
|
|
32
44
|
}, []);
|
|
33
45
|
return /*#__PURE__*/React.createElement("div", {
|
|
34
46
|
style: {
|
|
@@ -36,6 +48,8 @@ var App = function App() {
|
|
|
36
48
|
height: 800
|
|
37
49
|
}
|
|
38
50
|
}, /*#__PURE__*/React.createElement(MapDrawSelect, {
|
|
51
|
+
zoom: state.zoom,
|
|
52
|
+
center: state.center,
|
|
39
53
|
points: points,
|
|
40
54
|
drawEnd: console.log,
|
|
41
55
|
drawType: type,
|
|
@@ -20,14 +20,16 @@ function MapDrawSelect(_ref) {
|
|
|
20
20
|
onPointClick = _ref.onPointClick;
|
|
21
21
|
|
|
22
22
|
var _useContext = useContext(mapContext),
|
|
23
|
-
instance = _useContext.instance;
|
|
23
|
+
instance = _useContext.instance; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
+
|
|
24
25
|
|
|
25
26
|
var defaultCenter = useMemo(function () {
|
|
26
27
|
return center || instance.config.center;
|
|
27
|
-
}, [center
|
|
28
|
+
}, [center]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
|
|
28
30
|
var defaultZoom = useMemo(function () {
|
|
29
31
|
return zoom || instance.config.zoom;
|
|
30
|
-
}, [zoom
|
|
32
|
+
}, [zoom]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
31
33
|
|
|
32
34
|
var mapRest = useCallback(function () {
|
|
33
35
|
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
@@ -159,13 +159,27 @@ function SegmentPlayer(_a) {
|
|
|
159
159
|
}, [segments, index]); // 重置reload
|
|
160
160
|
|
|
161
161
|
var reload = function reload() {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
|
|
164
|
+
var _ref2 = (_b = (_a = playRef.current) === null || _a === void 0 ? void 0 : _a.plugins) !== null && _b !== void 0 ? _b : [],
|
|
165
|
+
_ref3 = _slicedToArray(_ref2, 2),
|
|
166
|
+
hls = _ref3[1];
|
|
167
|
+
|
|
168
|
+
if (hls) {
|
|
169
|
+
hls.swapAudioCodec();
|
|
170
|
+
hls.recoverMediaError();
|
|
171
|
+
}
|
|
172
|
+
|
|
162
173
|
playRef.current.event.emit(Events.RELOAD);
|
|
174
|
+
playRef.current.event.emit(Events.CLEAR_ERROR_TIMER);
|
|
163
175
|
setIndex(0);
|
|
164
176
|
playRef.current.api.reload();
|
|
165
177
|
}; // time 毫秒的时间戳
|
|
166
178
|
|
|
167
179
|
|
|
168
180
|
var seekTo = function seekTo(time) {
|
|
181
|
+
var _a, _b;
|
|
182
|
+
|
|
169
183
|
var index = latestSegmentsRef.current.findIndex(function (v) {
|
|
170
184
|
return time >= v.beginTime && time < v.endTime;
|
|
171
185
|
});
|
|
@@ -174,6 +188,15 @@ function SegmentPlayer(_a) {
|
|
|
174
188
|
return;
|
|
175
189
|
}
|
|
176
190
|
|
|
191
|
+
var _ref4 = (_b = (_a = playRef.current) === null || _a === void 0 ? void 0 : _a.plugins) !== null && _b !== void 0 ? _b : [],
|
|
192
|
+
_ref5 = _slicedToArray(_ref4, 2),
|
|
193
|
+
hls = _ref5[1];
|
|
194
|
+
|
|
195
|
+
if (hls) {
|
|
196
|
+
hls.swapAudioCodec();
|
|
197
|
+
hls.recoverMediaError();
|
|
198
|
+
}
|
|
199
|
+
|
|
177
200
|
var currentTime = time - latestSegmentsRef.current[index].beginTime;
|
|
178
201
|
setIndex(index);
|
|
179
202
|
setState(function (old) {
|