@cloud-app-dev/vidc 3.0.16 → 3.0.18
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/.umirc.ts +1 -1
- package/es/DisableMark/index.d.ts +2 -1
- package/es/DisableMark/index.js +6 -2
- package/es/Map/BasicMap/AMapInstance.d.ts +3 -0
- package/es/Map/BasicMap/AMapInstance.js +16 -1
- package/es/Map/BasicMap/LeafletInstance.d.ts +4 -1
- package/es/Map/BasicMap/LeafletInstance.js +17 -2
- package/es/Map/LevelCenter/index.d.ts +3 -0
- package/es/Map/LevelCenter/index.js +29 -9
- package/es/Map/SinglePoint/index.js +8 -5
- package/es/Map/hook/useMapEvent.d.ts +2 -0
- package/es/Map/hook/useMapEvent.js +23 -0
- package/es/Map/interface.d.ts +3 -0
- package/es/Player/api/index.d.ts +3 -1
- package/es/Player/api/index.js +27 -24
- package/es/Player/context.d.ts +21 -0
- package/es/Player/context.js +16 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +1 -4
- package/es/Player/contraller_bar/contraller_event.js +37 -28
- package/es/Player/contraller_bar/index.d.ts +2 -7
- package/es/Player/contraller_bar/index.js +4 -12
- package/es/Player/contraller_bar/left_bar.d.ts +2 -7
- package/es/Player/contraller_bar/left_bar.js +26 -23
- package/es/Player/contraller_bar/right_bar.d.ts +1 -6
- package/es/Player/contraller_bar/right_bar.js +6 -3
- package/es/Player/contraller_bar/useBarStatus.js +17 -24
- package/es/Player/demo.js +5 -1
- package/es/Player/event/errorEvent.d.ts +3 -3
- package/es/Player/event/errorEvent.js +39 -40
- package/es/Player/event/eventName.d.ts +17 -2
- package/es/Player/event/eventName.js +5 -1
- package/es/Player/event/index.d.ts +2 -0
- package/es/Player/event/index.js +55 -3
- package/es/Player/fps_play.d.ts +10 -0
- package/es/Player/fps_play.js +80 -0
- package/es/Player/frontend_player.js +0 -2
- package/es/Player/frontend_timeline.d.ts +1 -5
- package/es/Player/frontend_timeline.js +8 -4
- package/es/Player/live_heart.d.ts +4 -4
- package/es/Player/live_heart.js +10 -7
- package/es/Player/message.js +69 -84
- package/es/Player/player.d.ts +10 -15
- package/es/Player/segment_player.js +13 -29
- package/es/Player/segment_timeline.d.ts +1 -6
- package/es/Player/segment_timeline.js +11 -7
- package/es/Player/single_player.js +94 -49
- package/es/Player/style/bar.css +1 -0
- package/es/Player/style/index.css +8 -0
- package/es/Player/timeline.d.ts +1 -1
- package/es/Player/timeline.js +26 -37
- package/es/Player/util.d.ts +1 -1
- package/es/Player/util.js +2 -5
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +6 -3
- package/es/ScreenPlayer/LiveTools.d.ts +9 -1
- package/es/ScreenPlayer/LiveTools.js +6 -3
- package/es/ScreenPlayer/PlayerWithExt.d.ts +1 -1
- package/es/ScreenPlayer/PlayerWithExt.js +2 -4
- package/es/ScreenPlayer/Record.d.ts +1 -1
- package/es/ScreenPlayer/Record.js +8 -4
- package/es/ScreenPlayer/RecordTools.d.ts +9 -1
- package/es/ScreenPlayer/RecordTools.js +5 -3
- package/es/ScreenPlayer/demo2.js +1 -1
- package/es/ScreenPlayer/interface.d.ts +51 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useRafInterval/index.js +94 -0
- package/package.json +1 -1
- package/es/Player/event/browserTabEvent.d.ts +0 -9
- package/es/Player/event/browserTabEvent.js +0 -57
package/.umirc.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
4
|
const token =
|
|
5
|
-
'eyJhbGciOiJIUzI1NiJ9.
|
|
5
|
+
'eyJhbGciOiJIUzI1NiJ9.eyJvcmdhbml6YXRpb25JZCI6IjEwMDEwMTAwMDQ0NSIsImV4dCI6MTY2MzQwNTM5ODYzOCwidWlkIjoiMTAxMDAwMDAwNjk5IiwidmFsaWRTdGF0ZSI6MTA0NDA2LCJyb2xlSWQiOlsxMDAwMDAxMTA1MTgsMTAwMDAwMTEwNzI4XSwidmFsaWRUaW1lIjoxNzA0MzgzOTk5MDAwLCJvcHRDZW50ZXJJZCI6IjEwMDEwMDAwMDIzMyIsInVzZXJUeXBlIjoxMDA3MDQsImlhdCI6MTY2MzE0NjE5ODYzOH0.EPh_1eNPNFl-fmLODbHo0mu5R_1kKdt3UUu_0qfBGFY';
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
title: 'CloudApp VIDC',
|
|
@@ -3,6 +3,7 @@ import './index.less';
|
|
|
3
3
|
interface IDisableMarkProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
disabled: boolean;
|
|
6
|
+
width?: string | number;
|
|
6
7
|
}
|
|
7
|
-
export default function DisableMark({ children, disabled }: IDisableMarkProps): JSX.Element;
|
|
8
|
+
export default function DisableMark({ children, disabled, width }: IDisableMarkProps): JSX.Element;
|
|
8
9
|
export {};
|
package/es/DisableMark/index.js
CHANGED
|
@@ -2,8 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import "./index.css";
|
|
3
3
|
export default function DisableMark(_ref) {
|
|
4
4
|
var children = _ref.children,
|
|
5
|
-
disabled = _ref.disabled
|
|
5
|
+
disabled = _ref.disabled,
|
|
6
|
+
width = _ref.width;
|
|
6
7
|
return /*#__PURE__*/React.createElement(React.Fragment, null, disabled ? /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: "disable-mark"
|
|
8
|
+
className: "disable-mark",
|
|
9
|
+
style: {
|
|
10
|
+
width: width
|
|
11
|
+
}
|
|
8
12
|
}) : null, children);
|
|
9
13
|
}
|
|
@@ -12,5 +12,8 @@ declare class AMapInstance implements IMapInstance {
|
|
|
12
12
|
getZoom(): number;
|
|
13
13
|
setCenter(center: [number, number]): void;
|
|
14
14
|
setZoomAndCenter(zoom: number, center: [number, number]): void;
|
|
15
|
+
on(type: string, fn: (e: any) => void): void;
|
|
16
|
+
off(type: string, fn: (e: any) => void): void;
|
|
17
|
+
setCursor(cursor: string): void;
|
|
15
18
|
}
|
|
16
19
|
export default AMapInstance;
|
|
@@ -66,13 +66,28 @@ var AMapInstance = /*#__PURE__*/function () {
|
|
|
66
66
|
}, {
|
|
67
67
|
key: "setCenter",
|
|
68
68
|
value: function setCenter(center) {
|
|
69
|
-
|
|
69
|
+
this.map.setCenter(center);
|
|
70
70
|
}
|
|
71
71
|
}, {
|
|
72
72
|
key: "setZoomAndCenter",
|
|
73
73
|
value: function setZoomAndCenter(zoom, center) {
|
|
74
74
|
this.map.setZoomAndCenter(zoom, center);
|
|
75
75
|
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "on",
|
|
78
|
+
value: function on(type, fn) {
|
|
79
|
+
this.map.on(type, fn);
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
82
|
+
key: "off",
|
|
83
|
+
value: function off(type, fn) {
|
|
84
|
+
this.map.off(type, fn);
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "setCursor",
|
|
88
|
+
value: function setCursor(cursor) {
|
|
89
|
+
this.map.setDefaultCursor(cursor);
|
|
90
|
+
}
|
|
76
91
|
}]);
|
|
77
92
|
|
|
78
93
|
return AMapInstance;
|
|
@@ -8,8 +8,11 @@ declare class LeafletInstance implements IMapInstance {
|
|
|
8
8
|
destoryMap(): void;
|
|
9
9
|
setZoomAndCenter(zoom: number, center: [number, number] | LatLng): void;
|
|
10
10
|
mapReset(): void;
|
|
11
|
-
setZoom(zoom: number):
|
|
11
|
+
setZoom(zoom: number): void;
|
|
12
12
|
setCenter(center: [number, number] | LatLng): void;
|
|
13
13
|
getZoom(): number;
|
|
14
|
+
on(type: string, fn: (event: any) => void): void;
|
|
15
|
+
off(type: string, fn: (event: any) => void): void;
|
|
16
|
+
setCursor(cursor: string): void;
|
|
14
17
|
}
|
|
15
18
|
export default LeafletInstance;
|
|
@@ -78,18 +78,33 @@ var LeafletInstance = /*#__PURE__*/function () {
|
|
|
78
78
|
}, {
|
|
79
79
|
key: "setZoom",
|
|
80
80
|
value: function setZoom(zoom) {
|
|
81
|
-
|
|
81
|
+
this.map.setZoom(zoom);
|
|
82
82
|
}
|
|
83
83
|
}, {
|
|
84
84
|
key: "setCenter",
|
|
85
85
|
value: function setCenter(center) {
|
|
86
|
-
|
|
86
|
+
this.map.setCenter(center);
|
|
87
87
|
}
|
|
88
88
|
}, {
|
|
89
89
|
key: "getZoom",
|
|
90
90
|
value: function getZoom() {
|
|
91
91
|
return this.map.getZoom();
|
|
92
92
|
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "on",
|
|
95
|
+
value: function on(type, fn) {
|
|
96
|
+
this.map.on(type, fn);
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "off",
|
|
100
|
+
value: function off(type, fn) {
|
|
101
|
+
this.map.off(type, fn);
|
|
102
|
+
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "setCursor",
|
|
105
|
+
value: function setCursor(cursor) {
|
|
106
|
+
this.map.setDefaultCursor(cursor);
|
|
107
|
+
}
|
|
93
108
|
}]);
|
|
94
109
|
|
|
95
110
|
return LeafletInstance;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { LatLng, MapPoint } from '../interface';
|
|
2
3
|
import './index.less';
|
|
3
4
|
export interface ILevelCenter {
|
|
4
5
|
center?: [number, number];
|
|
5
6
|
zoom?: number;
|
|
6
7
|
points: MapPoint[];
|
|
8
|
+
enableClick?: boolean;
|
|
7
9
|
onLevelCenterChange?: (options: {
|
|
8
10
|
center: [number, number] | LatLng;
|
|
9
11
|
zoom: number;
|
|
10
12
|
}) => void;
|
|
13
|
+
children?: React.ReactNode;
|
|
11
14
|
}
|
|
12
15
|
declare const _default: (props: ILevelCenter) => JSX.Element;
|
|
13
16
|
export default _default;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _useMount from "ahooks/es/useMount";
|
|
2
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
|
2
3
|
import ClusterLayer from '../ClusterLayer';
|
|
3
|
-
import FindPio from '../FindPio';
|
|
4
4
|
import ResetTools from '../ResetTools';
|
|
5
5
|
import DragMarker from './DragMarker';
|
|
6
6
|
import withMap from '../withMap';
|
|
7
7
|
import { mapContext } from '../Context';
|
|
8
|
+
import useMapEvent from '../hook/useMapEvent';
|
|
8
9
|
import "./index.css";
|
|
9
10
|
|
|
10
11
|
function LevelCenter(_ref) {
|
|
11
12
|
var center = _ref.center,
|
|
12
13
|
zoom = _ref.zoom,
|
|
13
14
|
points = _ref.points,
|
|
14
|
-
onLevelCenterChange = _ref.onLevelCenterChange
|
|
15
|
+
onLevelCenterChange = _ref.onLevelCenterChange,
|
|
16
|
+
enableClick = _ref.enableClick,
|
|
17
|
+
children = _ref.children;
|
|
15
18
|
|
|
16
19
|
var _useContext = useContext(mapContext),
|
|
17
20
|
instance = _useContext.instance;
|
|
@@ -21,22 +24,39 @@ function LevelCenter(_ref) {
|
|
|
21
24
|
}, [center, instance]);
|
|
22
25
|
var defaultZoom = useMemo(function () {
|
|
23
26
|
return zoom || instance.config.zoom;
|
|
24
|
-
}, [zoom, instance]);
|
|
27
|
+
}, [zoom, instance]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
|
|
25
29
|
var mapRest = useCallback(function () {
|
|
26
30
|
return instance.setZoomAndCenter(defaultZoom, defaultCenter);
|
|
27
31
|
}, [defaultZoom, defaultCenter]);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
|
|
33
|
+
_useMount(function () {
|
|
34
|
+
if (enableClick) {
|
|
35
|
+
instance.setCursor('pointer');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
mapRest();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
useMapEvent('click', function (event) {
|
|
42
|
+
if (enableClick) {
|
|
43
|
+
var _center = [event.lnglat.lng, event.lnglat.lat];
|
|
44
|
+
instance.setCenter(_center);
|
|
45
|
+
onLevelCenterChange === null || onLevelCenterChange === void 0 ? void 0 : onLevelCenterChange({
|
|
46
|
+
center: _center,
|
|
47
|
+
zoom: defaultZoom
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
31
51
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ClusterLayer, {
|
|
32
52
|
points: points
|
|
33
|
-
}), /*#__PURE__*/React.createElement(
|
|
53
|
+
}), /*#__PURE__*/React.createElement(ResetTools, {
|
|
34
54
|
onMapReset: mapRest
|
|
35
55
|
}), /*#__PURE__*/React.createElement(DragMarker, {
|
|
36
56
|
center: defaultCenter,
|
|
37
57
|
zoom: defaultZoom,
|
|
38
58
|
onChange: onLevelCenterChange
|
|
39
|
-
}));
|
|
59
|
+
}), children);
|
|
40
60
|
}
|
|
41
61
|
|
|
42
62
|
export default withMap(LevelCenter, 'lv-center-map-container');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _useMount from "ahooks/es/useMount";
|
|
2
|
+
import React, { useCallback, useContext, useMemo } from 'react';
|
|
2
3
|
import ResetTools from '../ResetTools';
|
|
3
4
|
import Marker from './Marker';
|
|
4
5
|
import withMap from '../withMap';
|
|
@@ -15,13 +16,15 @@ function SinglePoint(_ref) {
|
|
|
15
16
|
var type = useMapType();
|
|
16
17
|
var defaultCenter = useMemo(function () {
|
|
17
18
|
return type.AMap ? [point.longitude, point.latitude] : [point.latitude, point.longitude];
|
|
18
|
-
}, [
|
|
19
|
+
}, [type.AMap, point.longitude, point.latitude]);
|
|
19
20
|
var mapRest = useCallback(function () {
|
|
20
21
|
return instance.setZoomAndCenter(instance.config.zoom, defaultCenter);
|
|
21
|
-
}, [defaultCenter]);
|
|
22
|
-
|
|
22
|
+
}, [defaultCenter, instance]);
|
|
23
|
+
|
|
24
|
+
_useMount(function () {
|
|
23
25
|
return mapRest();
|
|
24
|
-
}
|
|
26
|
+
});
|
|
27
|
+
|
|
25
28
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResetTools, {
|
|
26
29
|
onMapReset: mapRest
|
|
27
30
|
}), /*#__PURE__*/React.createElement(Marker, {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _useLatest from "ahooks/es/useLatest";
|
|
2
|
+
import { useContext, useEffect } from 'react';
|
|
3
|
+
import { mapContext } from '../Context';
|
|
4
|
+
|
|
5
|
+
function useMapEvent(type, fn) {
|
|
6
|
+
var fnRef = _useLatest(fn);
|
|
7
|
+
|
|
8
|
+
var _useContext = useContext(mapContext),
|
|
9
|
+
instance = _useContext.instance;
|
|
10
|
+
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
var eventAction = function eventAction(event) {
|
|
13
|
+
fnRef.current(event);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
instance.on(type, eventAction);
|
|
17
|
+
return function () {
|
|
18
|
+
return instance.off(type, eventAction);
|
|
19
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
+
}, [instance, type]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default useMapEvent;
|
package/es/Map/interface.d.ts
CHANGED
|
@@ -32,6 +32,9 @@ export class IMapInstance {
|
|
|
32
32
|
setCenter(center: [number, number] | LatLng): void;
|
|
33
33
|
getZoom(): number;
|
|
34
34
|
setZoomAndCenter(zoom: number, center: [number, number] | LatLng): void;
|
|
35
|
+
on(type: string, fn: (e: any) => void): void;
|
|
36
|
+
off(type: string, fn: (e: any) => void): void;
|
|
37
|
+
setCursor(cursor: string);
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
export interface MapPoint {
|
package/es/Player/api/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare class Api {
|
|
|
7
7
|
get video(): HTMLVideoElement;
|
|
8
8
|
play: () => void;
|
|
9
9
|
pause: () => void;
|
|
10
|
+
get paused(): boolean;
|
|
10
11
|
/**
|
|
11
12
|
* 设置currentTime实现seek
|
|
12
13
|
* @param {*} seconds
|
|
@@ -51,7 +52,8 @@ declare class Api {
|
|
|
51
52
|
unload: () => void;
|
|
52
53
|
reload: () => void;
|
|
53
54
|
toggleFit: () => void;
|
|
54
|
-
|
|
55
|
+
openFpsPlay: () => void;
|
|
56
|
+
closeFpsPlay: () => void;
|
|
55
57
|
destroy: () => void;
|
|
56
58
|
}
|
|
57
59
|
export declare type TypeAndPlay = {
|
package/es/Player/api/index.js
CHANGED
|
@@ -164,7 +164,9 @@ var Api = /*#__PURE__*/function () {
|
|
|
164
164
|
|
|
165
165
|
this.toggleFit = function () {};
|
|
166
166
|
|
|
167
|
-
this.
|
|
167
|
+
this.openFpsPlay = function () {};
|
|
168
|
+
|
|
169
|
+
this.closeFpsPlay = function () {};
|
|
168
170
|
|
|
169
171
|
this.destroy = function () {
|
|
170
172
|
_this.container = null;
|
|
@@ -178,6 +180,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
178
180
|
get: function get() {
|
|
179
181
|
return this.container.querySelector('video');
|
|
180
182
|
}
|
|
183
|
+
}, {
|
|
184
|
+
key: "paused",
|
|
185
|
+
get: function get() {
|
|
186
|
+
return this.video.paused;
|
|
187
|
+
}
|
|
181
188
|
}]);
|
|
182
189
|
|
|
183
190
|
return Api;
|
|
@@ -195,37 +202,33 @@ export function useTypeAndPlay(url, type, isLive, container, segments, flvConfig
|
|
|
195
202
|
setState = _useState2[1];
|
|
196
203
|
|
|
197
204
|
useEffect(function () {
|
|
198
|
-
|
|
205
|
+
var isReady = container && (url || type === 'flv' && segments);
|
|
206
|
+
|
|
207
|
+
if (!isReady) {
|
|
199
208
|
return undefined;
|
|
200
209
|
}
|
|
201
210
|
|
|
202
211
|
var video = container.querySelector('video');
|
|
203
212
|
var options = {};
|
|
204
213
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
options.hls = createHlsPlayer(video, url, hlsConfig);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (url && type === 'native') {
|
|
224
|
-
options.type = 'native';
|
|
225
|
-
video.setAttribute('src', url);
|
|
214
|
+
switch (type) {
|
|
215
|
+
case 'flv':
|
|
216
|
+
options.type = 'flv';
|
|
217
|
+
options.flv = createFlvPlayer(video, url, isLive, flvConfig);
|
|
218
|
+
break;
|
|
219
|
+
|
|
220
|
+
case 'hls':
|
|
221
|
+
options.type = 'hls';
|
|
222
|
+
options.hls = createHlsPlayer(video, url, isLive, hlsConfig);
|
|
223
|
+
break;
|
|
224
|
+
|
|
225
|
+
default:
|
|
226
|
+
options.type = 'native';
|
|
227
|
+
video.setAttribute('src', url);
|
|
228
|
+
break;
|
|
226
229
|
}
|
|
227
230
|
|
|
228
|
-
|
|
231
|
+
video.paused && tryCatch(function () {
|
|
229
232
|
return video.play();
|
|
230
233
|
});
|
|
231
234
|
setState(options);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type Api from './api';
|
|
3
|
+
import type VideoEventInstance from './event';
|
|
4
|
+
export interface IPlayerContextProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description 用于获取微应用顶层的dom节点
|
|
7
|
+
*/
|
|
8
|
+
container: HTMLElement;
|
|
9
|
+
api: Api;
|
|
10
|
+
event: VideoEventInstance;
|
|
11
|
+
isLive: boolean;
|
|
12
|
+
isFpsPlay: boolean;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const Context: React.Context<Omit<IPlayerContextProps, "children">>;
|
|
16
|
+
export declare function Provider({ children, ...props }: IPlayerContextProps): JSX.Element;
|
|
17
|
+
export declare namespace Provider {
|
|
18
|
+
var defaultProps: {
|
|
19
|
+
getContainer: () => HTMLElement;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var Context = /*#__PURE__*/React.createContext(null);
|
|
4
|
+
export function Provider(_a) {
|
|
5
|
+
var children = _a.children,
|
|
6
|
+
props = __rest(_a, ["children"]);
|
|
7
|
+
|
|
8
|
+
return /*#__PURE__*/React.createElement(Context.Provider, {
|
|
9
|
+
value: Object.assign({}, props)
|
|
10
|
+
}, children);
|
|
11
|
+
}
|
|
12
|
+
Provider.defaultProps = {
|
|
13
|
+
getContainer: function getContainer() {
|
|
14
|
+
return document.body;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import VideoEventInstance from '../event';
|
|
3
2
|
interface IContrallerEventProps {
|
|
4
|
-
event?: VideoEventInstance;
|
|
5
|
-
container?: HTMLElement;
|
|
6
3
|
children?: React.ReactNode;
|
|
7
4
|
}
|
|
8
|
-
declare function ContrallerEvent({
|
|
5
|
+
declare function ContrallerEvent({ children }: IContrallerEventProps): JSX.Element;
|
|
9
6
|
export default ContrallerEvent;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _useEventListener from "ahooks/es/useEventListener";
|
|
2
|
+
import _useMount from "ahooks/es/useMount";
|
|
3
|
+
|
|
1
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
5
|
|
|
3
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -10,13 +13,17 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
10
13
|
|
|
11
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
15
|
|
|
13
|
-
import React, {
|
|
16
|
+
import React, { useState, useRef, useContext } from 'react';
|
|
17
|
+
import { Context } from '../context';
|
|
14
18
|
import EventName from '../event/eventName';
|
|
15
19
|
|
|
16
20
|
function ContrallerEvent(_ref) {
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
var children = _ref.children;
|
|
22
|
+
|
|
23
|
+
var _useContext = useContext(Context),
|
|
24
|
+
event = _useContext.event,
|
|
25
|
+
container = _useContext.container;
|
|
26
|
+
|
|
20
27
|
var timer = useRef(null);
|
|
21
28
|
|
|
22
29
|
var _useState = useState(true),
|
|
@@ -24,30 +31,32 @@ function ContrallerEvent(_ref) {
|
|
|
24
31
|
visibel = _useState2[0],
|
|
25
32
|
setVisibel = _useState2[1];
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
var showContraller = function showContraller() {
|
|
35
|
+
clearTimeout(timer.current);
|
|
36
|
+
setVisibel(true);
|
|
37
|
+
event.emit(EventName.SHOW_CONTRALLER);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var hideContraller = function hideContraller() {
|
|
41
|
+
clearTimeout(timer.current);
|
|
42
|
+
timer.current = setTimeout(function () {
|
|
43
|
+
setVisibel(false);
|
|
44
|
+
event.emit(EventName.HIDE_CONTRALLER);
|
|
45
|
+
}, 3 * 1000);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
_useMount(function () {
|
|
49
|
+
return hideContraller();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
_useEventListener('mouseenter', showContraller, {
|
|
53
|
+
target: container
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
_useEventListener('mouseleave', hideContraller, {
|
|
57
|
+
target: container
|
|
58
|
+
});
|
|
59
|
+
|
|
51
60
|
return /*#__PURE__*/React.createElement(React.Fragment, null, React.Children.map(children, function (child) {
|
|
52
61
|
return /*#__PURE__*/React.isValidElement(child) ? /*#__PURE__*/React.cloneElement(child, {
|
|
53
62
|
visibel: visibel
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type Api from '../api';
|
|
3
|
-
import type VideoEventInstance from '../event';
|
|
4
2
|
import '../style/bar.less';
|
|
5
3
|
interface IContrallerBarProps {
|
|
6
|
-
container?: HTMLElement;
|
|
7
4
|
rightExtContents: React.ReactNode;
|
|
8
5
|
rightMidExtContents: React.ReactNode;
|
|
9
6
|
visibel?: boolean;
|
|
10
|
-
api: Api;
|
|
11
|
-
event: VideoEventInstance;
|
|
12
|
-
isLive?: boolean;
|
|
13
7
|
leftExtContents: React.ReactNode;
|
|
14
8
|
leftMidExtContents: React.ReactNode;
|
|
15
9
|
reload: () => void;
|
|
16
10
|
hideTimeProgress?: boolean;
|
|
11
|
+
oneFpsPlay?: boolean;
|
|
17
12
|
}
|
|
18
|
-
declare function ContrallerBar({
|
|
13
|
+
declare function ContrallerBar({ rightExtContents, rightMidExtContents, visibel, leftExtContents, leftMidExtContents, reload, hideTimeProgress, oneFpsPlay, }: IContrallerBarProps): JSX.Element;
|
|
19
14
|
export default ContrallerBar;
|
|
@@ -4,31 +4,23 @@ import RightBar from './right_bar';
|
|
|
4
4
|
import "../style/bar.css";
|
|
5
5
|
|
|
6
6
|
function ContrallerBar(_ref) {
|
|
7
|
-
var
|
|
8
|
-
rightExtContents = _ref.rightExtContents,
|
|
7
|
+
var rightExtContents = _ref.rightExtContents,
|
|
9
8
|
rightMidExtContents = _ref.rightMidExtContents,
|
|
10
9
|
visibel = _ref.visibel,
|
|
11
|
-
api = _ref.api,
|
|
12
|
-
event = _ref.event,
|
|
13
|
-
isLive = _ref.isLive,
|
|
14
10
|
leftExtContents = _ref.leftExtContents,
|
|
15
11
|
leftMidExtContents = _ref.leftMidExtContents,
|
|
16
12
|
reload = _ref.reload,
|
|
17
|
-
hideTimeProgress = _ref.hideTimeProgress
|
|
13
|
+
hideTimeProgress = _ref.hideTimeProgress,
|
|
14
|
+
oneFpsPlay = _ref.oneFpsPlay;
|
|
18
15
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
19
16
|
className: "contraller-bar-layout ".concat(!visibel ? 'hide-contraller-bar' : '')
|
|
20
17
|
}, /*#__PURE__*/React.createElement(LeftBar, {
|
|
18
|
+
oneFpsPlay: oneFpsPlay,
|
|
21
19
|
hideTimeProgress: hideTimeProgress,
|
|
22
|
-
api: api,
|
|
23
20
|
reload: reload,
|
|
24
|
-
event: event,
|
|
25
|
-
container: container,
|
|
26
|
-
isLive: isLive,
|
|
27
21
|
leftMidExtContents: leftMidExtContents,
|
|
28
22
|
leftExtContents: leftExtContents
|
|
29
23
|
}), /*#__PURE__*/React.createElement(RightBar, {
|
|
30
|
-
api: api,
|
|
31
|
-
container: container,
|
|
32
24
|
rightExtContents: rightExtContents,
|
|
33
25
|
rightMidExtContents: rightMidExtContents
|
|
34
26
|
})));
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Api from '../api';
|
|
3
|
-
import VideoEventInstance from '../event';
|
|
4
2
|
interface ILeftBarProps {
|
|
5
|
-
api: Api;
|
|
6
|
-
event: VideoEventInstance;
|
|
7
|
-
container: HTMLElement;
|
|
8
|
-
isLive: boolean;
|
|
9
3
|
leftExtContents?: React.ReactNode;
|
|
10
4
|
leftMidExtContents?: React.ReactNode;
|
|
11
5
|
reload: () => void;
|
|
12
6
|
hideTimeProgress?: boolean;
|
|
7
|
+
oneFpsPlay?: boolean;
|
|
13
8
|
}
|
|
14
|
-
declare function LeftBar({
|
|
9
|
+
declare function LeftBar({ reload, leftExtContents, leftMidExtContents, hideTimeProgress, oneFpsPlay }: ILeftBarProps): JSX.Element;
|
|
15
10
|
export default LeftBar;
|