@cloud-app-dev/vidc 3.2.18 → 3.2.19
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/es/Api/index.d.ts +12 -0
- package/es/AppContext/Sync.d.ts +7 -0
- package/es/AppContext/index.d.ts +10 -0
- package/es/AppContext/static.d.ts +8 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/AutoExit/index.d.ts +6 -0
- package/es/Box/BetweenBox/index.d.ts +12 -0
- package/es/Box/InfoBox/index.d.ts +12 -0
- package/es/Box/TwoColumnBox/index.d.ts +10 -0
- package/es/Box/deps/content-grid.d.ts +9 -0
- package/es/Box/deps/grid-factory.d.ts +10 -0
- package/es/Box/deps/simple-grid.d.ts +9 -0
- package/es/Box/index.d.ts +14 -0
- package/es/CheckGroupFixed/demo.d.ts +2 -0
- package/es/CheckGroupFixed/index.d.ts +17 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/utils.d.ts +4 -0
- package/es/ConfigContext/index.d.ts +22 -0
- package/es/CustomRenderSelect/index.d.ts +12 -0
- package/es/DisableMark/index.d.ts +9 -0
- package/es/DomMove/demo.d.ts +1 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/index.d.ts +7 -9
- package/es/Drawer/Footer.d.ts +4 -0
- package/es/Drawer/demo.d.ts +3 -0
- package/es/Drawer/index.d.ts +38 -0
- package/es/DynamicGridList/Demo.d.ts +2 -0
- package/es/DynamicGridList/index.d.ts +27 -0
- package/es/DynamicList/demo.d.ts +1 -0
- package/es/DynamicList/index.d.ts +30 -0
- package/es/DynamicList/utils.d.ts +4 -0
- package/es/ErrorFallback/index.d.ts +8 -0
- package/es/FrontendPlayer/index.d.ts +2 -0
- package/es/FullScreen/index.d.ts +21 -0
- package/es/GridList/Demo.d.ts +2 -0
- package/es/GridList/data.d.ts +16 -0
- package/es/GridList/hook.d.ts +13 -0
- package/es/GridList/index.d.ts +15 -0
- package/es/GridList/utils.d.ts +9 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/ImageView/index.d.ts +17 -0
- package/es/Input/demo.d.ts +2 -0
- package/es/Input/index.d.ts +18 -0
- package/es/InstanceHistory/index.d.ts +2 -0
- package/es/LabelValue/index.d.ts +23 -0
- package/es/List/demo.d.ts +2 -0
- package/es/List/index.d.ts +41 -0
- package/es/ListWithSizeAnimate/demo.d.ts +1 -0
- package/es/ListWithSizeAnimate/index.d.ts +14 -0
- package/es/LoaderApp/index.d.ts +31 -0
- package/es/LoaderApp/loader.d.ts +19 -0
- package/es/LoaderApp/sandbox.back.d.ts +18 -0
- package/es/LoaderApp/sandbox.d.ts +12 -0
- package/es/LoaderApp/utils.d.ts +19 -0
- package/es/LoaderScript/index.d.ts +26 -0
- package/es/LoaderScript/utils.d.ts +14 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +19 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +18 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/index.d.ts +5 -0
- package/es/Map/Config/index.d.ts +7 -0
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/FindPio/index.d.ts +3 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +3 -0
- package/es/Map/InfoWindow/demo.d.ts +2 -0
- package/es/Map/InfoWindow/index.d.ts +9 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +9 -0
- package/es/Map/LevelCenter/demo.d.ts +2 -0
- package/es/Map/LevelCenter/index.d.ts +15 -0
- package/es/Map/LoaderMap/index.d.ts +12 -0
- package/es/Map/MapDrawSelect/demo.d.ts +2 -0
- package/es/Map/MapDrawSelect/index.d.ts +15 -0
- package/es/Map/MouseTool/index.d.ts +10 -0
- package/es/Map/MouseTool/useMouseTools.d.ts +7 -0
- package/es/Map/ResetTools/index.d.ts +9 -0
- package/es/Map/SinglePoint/index.d.ts +27 -0
- package/es/Map/hook/useMapEvent.d.ts +2 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/index.d.ts +14 -0
- package/es/Map/useMarker/index.d.ts +10 -0
- package/es/Map/withMap/index.d.ts +2 -0
- package/es/Modal/demo.d.ts +2 -0
- package/es/Modal/index.d.ts +44 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +7 -0
- package/es/Picture/component/DefaultRects/index.d.ts +12 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DrawRect/index.d.ts +12 -0
- package/es/Picture/component/RectMenu/index.d.ts +11 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/Tools/index.d.ts +13 -0
- package/es/Picture/component/WheelScale/index.d.ts +6 -0
- package/es/Picture/demo.d.ts +1 -0
- package/es/Picture/dragBound.d.ts +5 -0
- package/es/Picture/index.d.ts +18 -0
- package/es/Picture/loadCaptureRectImage.d.ts +8 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/utils.d.ts +21 -0
- package/es/Player/api/index.d.ts +68 -0
- package/es/Player/context.d.ts +21 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
- package/es/Player/contraller_bar/index.d.ts +14 -0
- package/es/Player/contraller_bar/left_bar.d.ts +10 -0
- package/es/Player/contraller_bar/right_bar.d.ts +8 -0
- package/es/Player/contraller_bar/time.d.ts +2 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
- package/es/Player/contraller_bar/volume.d.ts +9 -0
- package/es/Player/demo.d.ts +2 -0
- package/es/Player/empty.d.ts +1 -0
- package/es/Player/event/errorEvent.d.ts +14 -0
- package/es/Player/event/eventName.d.ts +18 -0
- package/es/Player/event/index.d.ts +24 -0
- package/es/Player/fps_play.d.ts +10 -0
- package/es/Player/frontend_player.d.ts +7 -0
- package/es/Player/frontend_timeline.d.ts +9 -0
- package/es/Player/iconfont.d.ts +4 -0
- package/es/Player/index.d.ts +2 -0
- package/es/Player/live_heart.d.ts +8 -0
- package/es/Player/message.d.ts +4 -0
- package/es/Player/segment_player.d.ts +8 -0
- package/es/Player/segment_timeline.d.ts +11 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/timeline.d.ts +4 -0
- package/es/Player/util.d.ts +42 -0
- package/es/PlayerExt/demo.d.ts +2 -0
- package/es/PlayerExt/index.d.ts +47 -0
- package/es/Progress/index.d.ts +10 -8
- package/es/ROI/demo.d.ts +2 -0
- package/es/ROI/index.d.ts +39 -0
- package/es/ROI/utils.d.ts +1 -0
- package/es/ScreenPlayer/Live.d.ts +9 -0
- package/es/ScreenPlayer/LiveTools.d.ts +29 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
- package/es/ScreenPlayer/RatePick.d.ts +6 -0
- package/es/ScreenPlayer/Record.d.ts +9 -0
- package/es/ScreenPlayer/RecordTools.d.ts +37 -0
- package/es/ScreenPlayer/ScreenSelect.d.ts +6 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +16 -0
- package/es/ScreenPlayer/TimeMode.d.ts +6 -0
- package/es/ScreenPlayer/TimeSelect.d.ts +6 -0
- package/es/ScreenPlayer/demo.d.ts +1 -0
- package/es/ScreenPlayer/demo2.d.ts +1 -0
- package/es/ScreenPlayer/index.d.ts +5 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +24 -0
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/utils.d.ts +19 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/Service/fetch-adapter.d.ts +12 -0
- package/es/Service/http.d.ts +6 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/middleware.d.ts +5 -0
- package/es/TableLayout/index.d.ts +13 -0
- package/es/ThemeAntd/demo.d.ts +3 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/Timeout/index.d.ts +31 -0
- package/es/Tree/demo.d.ts +2 -0
- package/es/Tree/index.d.ts +24 -0
- package/es/VList/index.d.ts +17 -12
- package/es/VList/utils.d.ts +14 -0
- package/es/index.d.ts +52 -0
- package/es/useDrawROI/index.d.ts +16 -0
- package/es/useEventEmitterHandle/index.d.ts +2 -0
- package/es/useFullscreen/demo.d.ts +1 -0
- package/es/useFullscreen/index.d.ts +11 -0
- package/es/useHistory/index.d.ts +2 -0
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useSimpleState/index.d.ts +3 -0
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/utils.d.ts +25 -0
- package/package.json +1 -1
- package/tsconfig.json +0 -11
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IPictureProps } from './interface';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare function Picture({ className, width, height, minHeight, disabledDrag, imagePath, rects, isOpenSelect, disabledDrawMenu, menus, hasTool, fullScreenEle, ...props }: IPictureProps): JSX.Element;
|
|
4
|
+
declare namespace Picture {
|
|
5
|
+
var defaultProps: {
|
|
6
|
+
width: string;
|
|
7
|
+
height: string;
|
|
8
|
+
className: string;
|
|
9
|
+
minHeight: number;
|
|
10
|
+
disabledDrag: boolean;
|
|
11
|
+
isOpenSelect: boolean;
|
|
12
|
+
disabledDrawMenu: boolean;
|
|
13
|
+
menus: never[];
|
|
14
|
+
rects: never[];
|
|
15
|
+
hasTool: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export default Picture;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ImageType } from './interface';
|
|
2
|
+
export declare function loadCaptureRectImage(image: HTMLImageElement, rect: number[], imageType: ImageType): Promise<string>;
|
|
3
|
+
export declare function getRectImagePath(sourceImage: HTMLImageElement, cuurentImage: HTMLImageElement, rect: number[], options?: {
|
|
4
|
+
scale: number;
|
|
5
|
+
rotate: number;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useDraw(dom: HTMLElement, open?: boolean): [number[], boolean];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ImageType, RectType } from './interface';
|
|
2
|
+
export declare function customContextMenu(e: any): boolean;
|
|
3
|
+
export declare function cloneImageNode(image: HTMLImageElement): Promise<Node>;
|
|
4
|
+
export declare function getCaptureRect(rect: number[], type: ImageType): number[];
|
|
5
|
+
export declare function computedRectScale({ imageSource, domImg, rects }: {
|
|
6
|
+
imageSource: HTMLImageElement;
|
|
7
|
+
domImg: HTMLImageElement;
|
|
8
|
+
rects: RectType[];
|
|
9
|
+
}): {
|
|
10
|
+
rect: any;
|
|
11
|
+
type: ImageType;
|
|
12
|
+
needExpand?: boolean | undefined;
|
|
13
|
+
imgId?: string | undefined;
|
|
14
|
+
area?: number | undefined;
|
|
15
|
+
tags?: import("./interface").TagItemType[] | undefined;
|
|
16
|
+
imgUrl?: string | undefined;
|
|
17
|
+
isDefault?: boolean | undefined;
|
|
18
|
+
dupId?: string | undefined;
|
|
19
|
+
lowQuality?: boolean | undefined;
|
|
20
|
+
base64?: string | undefined;
|
|
21
|
+
}[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Flvjs from '@cloud-app-dev/flv.js';
|
|
2
|
+
import Hls, { HlsConfig } from 'hls.js';
|
|
3
|
+
import type { FlvPlayerConfig } from '../player';
|
|
4
|
+
declare class Api {
|
|
5
|
+
container: HTMLElement;
|
|
6
|
+
constructor(container: HTMLElement);
|
|
7
|
+
get video(): HTMLVideoElement | null;
|
|
8
|
+
play: () => void;
|
|
9
|
+
pause: () => void;
|
|
10
|
+
get paused(): boolean | undefined;
|
|
11
|
+
get muted(): boolean | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* 设置currentTime实现seek
|
|
14
|
+
* @param {*} seconds
|
|
15
|
+
*/
|
|
16
|
+
seekTo: (seconds: number) => void;
|
|
17
|
+
setVolume: (fraction: number) => void;
|
|
18
|
+
getVolume: () => number | undefined;
|
|
19
|
+
mute: () => void;
|
|
20
|
+
unmute: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* 开启画中画功能
|
|
23
|
+
*/
|
|
24
|
+
requestPictureInPicture: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* 关闭画中画功能
|
|
27
|
+
*/
|
|
28
|
+
exitPictureInPicture: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* 设置播放速率
|
|
31
|
+
* @param {*} rate
|
|
32
|
+
*/
|
|
33
|
+
setPlaybackRate: (rate: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* 获取视频总时长
|
|
36
|
+
*/
|
|
37
|
+
getDuration: () => number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* 获取当前播放时间
|
|
40
|
+
*/
|
|
41
|
+
getCurrentTime: () => number | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* 获取缓存时间
|
|
44
|
+
*/
|
|
45
|
+
getSecondsLoaded: () => number;
|
|
46
|
+
/**
|
|
47
|
+
* 获取当前视频缓存的起止时间
|
|
48
|
+
*/
|
|
49
|
+
getBufferedTime: () => number[];
|
|
50
|
+
/**
|
|
51
|
+
* 视频截屏方法
|
|
52
|
+
*/
|
|
53
|
+
snapshot: () => string;
|
|
54
|
+
unload: () => void;
|
|
55
|
+
reload: () => void;
|
|
56
|
+
toggleFit: () => void;
|
|
57
|
+
openFpsPlay: () => void;
|
|
58
|
+
closeFpsPlay: () => void;
|
|
59
|
+
destroy: () => void;
|
|
60
|
+
}
|
|
61
|
+
export declare type TypeAndPlay = {
|
|
62
|
+
type?: string;
|
|
63
|
+
flv?: Flvjs.Player;
|
|
64
|
+
hls?: Hls;
|
|
65
|
+
};
|
|
66
|
+
export declare function useTypeAndPlay(url?: string, type?: string, isLive?: boolean, container?: HTMLElement, segments?: Flvjs.MediaSegment[], flvConfig?: FlvPlayerConfig, hlsConfig?: HlsConfig): [string, Flvjs.Player, Hls];
|
|
67
|
+
export declare function usePlayerApi(url?: string, type?: string, isLive?: boolean, container?: HTMLElement, segments?: Flvjs.MediaSegment[], flvConfig?: FlvPlayerConfig, hlsConfig?: HlsConfig): [Api | undefined, [string, Flvjs.Player, Hls]];
|
|
68
|
+
export default Api;
|
|
@@ -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,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IBarProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
visibel?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function Bar({ visibel, className, children, ...props }: IBarProps): JSX.Element | null;
|
|
8
|
+
export default Bar;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../style/bar.less';
|
|
3
|
+
interface IContrallerBarProps {
|
|
4
|
+
rightExtContents: React.ReactNode;
|
|
5
|
+
rightMidExtContents: React.ReactNode;
|
|
6
|
+
visibel?: boolean;
|
|
7
|
+
leftExtContents: React.ReactNode;
|
|
8
|
+
leftMidExtContents: React.ReactNode;
|
|
9
|
+
reload: () => void;
|
|
10
|
+
hideTimeProgress?: boolean;
|
|
11
|
+
oneFpsPlay?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function ContrallerBar({ rightExtContents, rightMidExtContents, visibel, leftExtContents, leftMidExtContents, reload, hideTimeProgress, oneFpsPlay, }: IContrallerBarProps): JSX.Element;
|
|
14
|
+
export default ContrallerBar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ILeftBarProps {
|
|
3
|
+
leftExtContents?: React.ReactNode;
|
|
4
|
+
leftMidExtContents?: React.ReactNode;
|
|
5
|
+
reload: () => void;
|
|
6
|
+
hideTimeProgress?: boolean;
|
|
7
|
+
oneFpsPlay?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function LeftBar({ reload, leftExtContents, leftMidExtContents, hideTimeProgress, oneFpsPlay }: ILeftBarProps): JSX.Element;
|
|
10
|
+
export default LeftBar;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IRightBarProps {
|
|
3
|
+
visibel?: boolean;
|
|
4
|
+
rightExtContents: React.ReactNode;
|
|
5
|
+
rightMidExtContents: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function RightBar({ rightExtContents, rightMidExtContents }: IRightBarProps): JSX.Element;
|
|
8
|
+
export default RightBar;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type Api from '../api';
|
|
3
|
+
import '../style/volume.less';
|
|
4
|
+
declare function Volume({ api, style }: {
|
|
5
|
+
api?: Api;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
declare const _default: React.MemoExoticComponent<typeof Volume>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Empty(): JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Flvjs from '@cloud-app-dev/flv.js';
|
|
2
|
+
import Hls from 'hls.js';
|
|
3
|
+
import type VideoEventInstance from '.';
|
|
4
|
+
interface IErrorEventProps {
|
|
5
|
+
event?: VideoEventInstance;
|
|
6
|
+
errorReloadTimer: number;
|
|
7
|
+
flv: Flvjs.Player;
|
|
8
|
+
hls: Hls;
|
|
9
|
+
reload: () => void;
|
|
10
|
+
unload: () => void;
|
|
11
|
+
errorHandleAdapter?: (errorInfo: any) => boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function useErrorEvent({ event, reload, unload, errorReloadTimer, flv, hls, errorHandleAdapter }: IErrorEventProps): void;
|
|
14
|
+
export default useErrorEvent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const Events: {
|
|
2
|
+
RELOAD: string;
|
|
3
|
+
RELOAD_FAIL: string;
|
|
4
|
+
RELOAD_SUCCESS: string;
|
|
5
|
+
ERROR: string;
|
|
6
|
+
ERROR_RELOAD: string;
|
|
7
|
+
HISTORY_PLAY_END: string;
|
|
8
|
+
PLAY_ENDED: string;
|
|
9
|
+
SEEK: string;
|
|
10
|
+
TRANSFORM: string;
|
|
11
|
+
CHANGE_PLAY_INDEX: string;
|
|
12
|
+
HIDE_CONTRALLER: string;
|
|
13
|
+
SHOW_CONTRALLER: string;
|
|
14
|
+
CLEAR_ERROR_TIMER: string;
|
|
15
|
+
CANVAS_PAUSE: string;
|
|
16
|
+
CANVAS_PLAY: string;
|
|
17
|
+
};
|
|
18
|
+
export default Events;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CustomEvent, EventInfo } from '../player';
|
|
2
|
+
declare class VideoEventInstance {
|
|
3
|
+
video: HTMLVideoElement;
|
|
4
|
+
events: {
|
|
5
|
+
[key: string]: EventInfo;
|
|
6
|
+
};
|
|
7
|
+
playerEvents: {
|
|
8
|
+
[key: string]: (() => void)[];
|
|
9
|
+
};
|
|
10
|
+
constructor(video: HTMLVideoElement);
|
|
11
|
+
on(eventName: string, handle: () => void): void;
|
|
12
|
+
addEventListener(eventName: string, handle: () => void): void;
|
|
13
|
+
removeEventListener(eventName: string, handle: () => void): void;
|
|
14
|
+
emit(eventName: string, ...data: any): void;
|
|
15
|
+
off(eventName: string, handle: () => void): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
declare type PlayEvent = VideoEventInstance;
|
|
19
|
+
export declare function usePlayerEvent(video?: HTMLVideoElement): PlayEvent | undefined;
|
|
20
|
+
export declare function useVideoEvent(eventName: string, handle: (event: any) => void, context?: VideoEventInstance): void;
|
|
21
|
+
export declare function useRegisterPlayerEvent(eventName: string, handle: (event: any) => void, context?: VideoEventInstance): void;
|
|
22
|
+
export declare function useVideoEvents(event?: VideoEventInstance, events?: CustomEvent[]): void;
|
|
23
|
+
export declare function useRegisterPlayerEvents(event?: VideoEventInstance, events?: CustomEvent[]): void;
|
|
24
|
+
export default VideoEventInstance;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type Api from './api';
|
|
2
|
+
import type VideoEventInstance from './event';
|
|
3
|
+
interface IFPSPlay {
|
|
4
|
+
api?: Api;
|
|
5
|
+
event?: VideoEventInstance;
|
|
6
|
+
fpsDelay?: number;
|
|
7
|
+
fps?: number;
|
|
8
|
+
}
|
|
9
|
+
declare function FPSPlay({ api, event, fpsDelay, fps }: IFPSPlay): JSX.Element;
|
|
10
|
+
export default FPSPlay;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IFrontendPlayerProps } from './player';
|
|
2
|
+
/**
|
|
3
|
+
* @desc 主组件,负责片段整体逻辑控制
|
|
4
|
+
* @return JSX.Element
|
|
5
|
+
*/
|
|
6
|
+
declare function FrontendPlayer({ url, begin, end, onSeek, forwordRef, customTimeLine, onCanPlayerInit, ...props }: IFrontendPlayerProps): JSX.Element;
|
|
7
|
+
export default FrontendPlayer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './style/timeline.less';
|
|
2
|
+
interface ITimeLineProps {
|
|
3
|
+
duration: number;
|
|
4
|
+
begin: number;
|
|
5
|
+
end: number;
|
|
6
|
+
onSeek?: (time: number) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function FrontendTimeLine({ duration, begin, end, onSeek }: ITimeLineProps): JSX.Element;
|
|
9
|
+
export default FrontendTimeLine;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ISegmentPlayerProps } from './player';
|
|
2
|
+
/**
|
|
3
|
+
* @desc 主组件,负责片段整体逻辑控制
|
|
4
|
+
* @param param0
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
declare function SegmentPlayer({ segments, begin, forwordRef, defaultIndex, onCanPlayerInit, customTimeLine, ...props }: ISegmentPlayerProps): JSX.Element;
|
|
8
|
+
export default SegmentPlayer;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ISegmentType } from './player';
|
|
2
|
+
import './style/timeline.less';
|
|
3
|
+
interface ITimeLineProps {
|
|
4
|
+
index: number;
|
|
5
|
+
segments: ISegmentType[];
|
|
6
|
+
duration: number;
|
|
7
|
+
begin: number;
|
|
8
|
+
seekTo: (time: number) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function SegmentTimeLine({ index, segments, duration, begin, seekTo }: ITimeLineProps): JSX.Element;
|
|
11
|
+
export default SegmentTimeLine;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExportPlayerType, ISinglePlayerProps } from './player';
|
|
3
|
+
import './style/index.less';
|
|
4
|
+
declare const SinglePlayer: React.ForwardRefExoticComponent<ISinglePlayerProps & React.RefAttributes<ExportPlayerType>>;
|
|
5
|
+
export default SinglePlayer;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Flvjs from '@cloud-app-dev/flv.js';
|
|
2
|
+
import Hls, { HlsConfig } from 'hls.js';
|
|
3
|
+
import type { FlvPlayerConfig } from './player';
|
|
4
|
+
export declare function tryCatch(fn: () => void | Promise<any>): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* 创建HLS对象
|
|
7
|
+
* @param {*} video
|
|
8
|
+
* @param {*} URL
|
|
9
|
+
*/
|
|
10
|
+
export declare function createHlsPlayer(video: HTMLVideoElement, url?: string, isLive?: boolean, hlsConfig?: HlsConfig): Hls | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* 创建FLV对象
|
|
13
|
+
* @param {*} video
|
|
14
|
+
* @param {*} options
|
|
15
|
+
*/
|
|
16
|
+
export declare function createFlvPlayer(video: HTMLVideoElement, url?: string, isLive?: boolean, flvConfig?: FlvPlayerConfig): Flvjs.Player | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* video unload
|
|
19
|
+
* @param video
|
|
20
|
+
* @param flv
|
|
21
|
+
* @param hls
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const playUnload: (video?: HTMLVideoElement, flv?: any, hls?: any) => void;
|
|
25
|
+
/**
|
|
26
|
+
* reload
|
|
27
|
+
* @param video
|
|
28
|
+
* @param event
|
|
29
|
+
* @param flv
|
|
30
|
+
* @param hls
|
|
31
|
+
* @param url
|
|
32
|
+
*/
|
|
33
|
+
export declare const playReload: (video?: HTMLVideoElement, event?: any, flv?: any, hls?: any, url?: string) => undefined;
|
|
34
|
+
/**
|
|
35
|
+
* 获取播放文件类型
|
|
36
|
+
* @param {*} url
|
|
37
|
+
*/
|
|
38
|
+
export declare function getVideoType(url?: string): "flv" | "native" | "hls";
|
|
39
|
+
export declare function timeStamp(second: number): string;
|
|
40
|
+
export declare function getRandom(): string;
|
|
41
|
+
export declare const FMT = "YYYY-MM-DD HH:mm:ss";
|
|
42
|
+
export declare function getDomStyleValue(dom: HTMLElement, styleKey: string): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ISegmentType } from "../Player/player";
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type PlayModeType = 1 | 2;
|
|
4
|
+
export interface IPluginProps {
|
|
5
|
+
url?: string;
|
|
6
|
+
children: JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* @description 模式1浏览器模式,2插件模式
|
|
9
|
+
* @default 1
|
|
10
|
+
*/
|
|
11
|
+
mode?: PlayModeType;
|
|
12
|
+
/**
|
|
13
|
+
* @description 插件下载地址
|
|
14
|
+
*/
|
|
15
|
+
pluginDownloadUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description 插件模式下传递的参数 ’&’开头
|
|
18
|
+
* @default ''
|
|
19
|
+
*/
|
|
20
|
+
pluginParams?: string;
|
|
21
|
+
segments?: ISegmentType[];
|
|
22
|
+
/**
|
|
23
|
+
* 正在获取视频数据
|
|
24
|
+
*/
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* 客户端插件模式,随机端口
|
|
29
|
+
*/
|
|
30
|
+
export declare const LOCAL_PORT: string[];
|
|
31
|
+
/**
|
|
32
|
+
* 随机获取端口号
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
export declare function getLocalPort(): string;
|
|
36
|
+
/**
|
|
37
|
+
* @desc 转码插件模式下的url
|
|
38
|
+
* @param url
|
|
39
|
+
* @param params
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
export declare function getLocalPlayPath(url: string, params?: string): string;
|
|
43
|
+
export declare function usePlugin(mode?: PlayModeType, key?: any): {
|
|
44
|
+
needInstall: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare function ExtModel({ url, children, mode, pluginDownloadUrl, pluginParams, loading, segments }: IPluginProps): JSX.Element;
|
|
47
|
+
export { ExtModel as default };
|
package/es/Progress/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
status: 'over' | 'error' | 'loading';
|
|
1
|
+
import './index.less';
|
|
2
|
+
interface IProgressComponentProps {
|
|
3
|
+
status: 'over' | 'error' | 'loading';
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
declare function ProgressComponent({ status }: IProgressComponentProps): JSX.Element;
|
|
6
|
+
declare namespace ProgressComponent {
|
|
7
|
+
var defaultProps: {
|
|
8
|
+
status: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export default ProgressComponent;
|
package/es/ROI/demo.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IRIOProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* 调试模式,开启回绘制具体网格
|
|
7
|
+
*/
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 绘制数据变化
|
|
11
|
+
*/
|
|
12
|
+
onChange?: (rio: number[][], areas: [number, number][][]) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 开启/关闭 标识
|
|
15
|
+
*/
|
|
16
|
+
isOpen?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* key变化回清楚画布
|
|
19
|
+
*/
|
|
20
|
+
renderKey?: React.Key;
|
|
21
|
+
/**
|
|
22
|
+
* rio共多少行
|
|
23
|
+
* @default 18
|
|
24
|
+
*/
|
|
25
|
+
row?: number;
|
|
26
|
+
/**
|
|
27
|
+
* rio 一行有多少个位置
|
|
28
|
+
* @default 32
|
|
29
|
+
*/
|
|
30
|
+
rowItems?: number;
|
|
31
|
+
}
|
|
32
|
+
declare function RIO({ children, debug, renderKey, onChange, isOpen, row, rowItems }: IRIOProps): JSX.Element;
|
|
33
|
+
declare namespace RIO {
|
|
34
|
+
var defaultProps: {
|
|
35
|
+
row: number;
|
|
36
|
+
rowItems: number;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export default RIO;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function drawMark(ctx: CanvasRenderingContext2D, x: number, y: number): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import type { ILivePlayerProps } from './interface';
|
|
3
|
+
declare function LivePlayer({ list, children, oneWinExtTools, allWinExtTools, ...props }: ILivePlayerProps): JSX.Element;
|
|
4
|
+
declare namespace LivePlayer {
|
|
5
|
+
var defaultProps: {
|
|
6
|
+
list: never[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export default LivePlayer;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExportPlayerType } from '../Player/player';
|
|
3
|
+
import { PlayModeType } from '../PlayerExt';
|
|
4
|
+
interface IToolsProps {
|
|
5
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
6
|
+
updateState: (state: {
|
|
7
|
+
screenNum?: number;
|
|
8
|
+
mode?: PlayModeType;
|
|
9
|
+
}) => void;
|
|
10
|
+
screenNum: number;
|
|
11
|
+
mode?: PlayModeType;
|
|
12
|
+
getPlayerItem: () => ExportPlayerType | undefined;
|
|
13
|
+
fit?: string;
|
|
14
|
+
toggleFit?: () => void;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
onCloseAll?: () => void;
|
|
17
|
+
snapshot?: (base64: string) => void;
|
|
18
|
+
/**
|
|
19
|
+
* 单窗口拓展工具条,左侧
|
|
20
|
+
*/
|
|
21
|
+
oneWinExtTools?: JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* 全局窗口工具条,右侧
|
|
24
|
+
*/
|
|
25
|
+
allWinExtTools?: JSX.Element;
|
|
26
|
+
hasPlugin?: boolean;
|
|
27
|
+
}
|
|
28
|
+
declare function LiveTools({ containerRef, oneWinExtTools, allWinExtTools, screenNum, mode, fit, hasPlugin, ...props }: IToolsProps): JSX.Element;
|
|
29
|
+
export default LiveTools;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExportPlayerType, ISegmentType, ISinglePlayerProps } from '../Player/player';
|
|
3
|
+
import type { PlayModeType } from '../PlayerExt';
|
|
4
|
+
interface ILivePlayerWithExtProps extends ISinglePlayerProps {
|
|
5
|
+
mode?: PlayModeType;
|
|
6
|
+
style: React.CSSProperties;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
updatePlayer: (obj: React.MutableRefObject<ExportPlayerType>) => void;
|
|
9
|
+
pluginDownloadUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function LivePlayerWithExt({ mode, url, type, style, className, updatePlayer, onClick, pluginDownloadUrl, ...props }: ILivePlayerWithExtProps): JSX.Element;
|
|
12
|
+
interface ISegmentPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'> {
|
|
13
|
+
segments?: ISegmentType[];
|
|
14
|
+
begin?: number;
|
|
15
|
+
fpsDelay?: number;
|
|
16
|
+
fps?: number;
|
|
17
|
+
httpLoading: boolean;
|
|
18
|
+
screenIndex?: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function SegmentPlayerWithExt({ begin, style, className, segments, mode, fpsDelay, fps, httpLoading, ...props }: ISegmentPlayerWithExtProps): JSX.Element;
|
|
21
|
+
interface IFrontendPlayerWithExtProps extends Omit<ILivePlayerWithExtProps, 'url'> {
|
|
22
|
+
segments?: ISegmentType[];
|
|
23
|
+
begin?: number;
|
|
24
|
+
httpLoading: boolean;
|
|
25
|
+
getLocalRecordUrl?: (options: {
|
|
26
|
+
url: URL;
|
|
27
|
+
begin: number;
|
|
28
|
+
end: number;
|
|
29
|
+
screenIndex: number;
|
|
30
|
+
}) => Promise<string>;
|
|
31
|
+
screenIndex: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function FrontendPlayerWithExt({ mode, style, className, segments, pluginDownloadUrl, screenIndex, httpLoading, ...props }: IFrontendPlayerWithExtProps): JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import type { IRecordPlayerProps } from './interface';
|
|
3
|
+
/**
|
|
4
|
+
* @desc 录像设计的时间全部需要到毫秒
|
|
5
|
+
* @param param0
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
declare function RecordPlayer({ list, children, oneWinExtTools, allWinExtTools, fpsDelay, fps, seekLoading, ...props }: IRecordPlayerProps): JSX.Element;
|
|
9
|
+
export default RecordPlayer;
|