@cloud-app-dev/vidc 4.0.19 → 4.0.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/es/AppContext/Sync.d.ts +8 -0
- package/es/AppContext/Sync.js +42 -0
- package/es/AppContext/index.d.ts +10 -0
- package/es/AppContext/index.js +141 -0
- package/es/AppContext/interface.d.ts +41 -0
- package/es/AppContext/static.d.ts +8 -0
- package/es/AppContext/static.js +9 -0
- package/es/Auth/index.d.ts +8 -0
- package/es/Auth/index.js +14 -0
- package/es/AutoExit/index.d.ts +6 -0
- package/es/AutoExit/index.js +19 -0
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +22 -0
- package/es/CheckGroupFixed/index.d.ts +24 -0
- package/es/CheckGroupFixed/index.js +140 -0
- package/es/CheckGroupFixed/index.less +56 -0
- package/es/Config/index.d.ts +4 -0
- package/es/Config/index.js +77 -0
- package/es/Config/interface.d.ts +65 -0
- package/es/Config/utils.d.ts +4 -0
- package/es/Config/utils.js +33 -0
- package/es/ConfigContext/index.d.ts +17 -0
- package/es/ConfigContext/index.js +21 -0
- package/es/CustomRenderSelect/index.d.ts +12 -0
- package/es/CustomRenderSelect/index.js +73 -0
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DBTools/index.d.ts +25 -0
- package/es/DBTools/index.js +336 -0
- package/es/DisableMark/index.d.ts +9 -0
- package/es/DisableMark/index.js +19 -0
- package/es/DisableMark/index.less +9 -0
- package/es/DomMove/demo.d.ts +2 -0
- package/es/DomMove/demo.js +16 -0
- package/es/DomMove/index.d.ts +16 -0
- package/es/DomMove/index.js +139 -0
- package/es/DomMove/utils.d.ts +8 -0
- package/es/DomMove/utils.js +32 -0
- package/es/Drag/DragAndDropItem.d.ts +4 -0
- package/es/Drag/DragAndDropItem.js +134 -0
- package/es/Drag/DropItem.d.ts +4 -0
- package/es/Drag/DropItem.js +50 -0
- package/es/Drag/index.d.ts +7 -0
- package/es/Drag/index.js +7 -0
- package/es/Drag/interface.d.ts +16 -0
- package/es/DynamicGridList/Demo.d.ts +3 -0
- package/es/DynamicGridList/Demo.js +77 -0
- package/es/DynamicGridList/index.d.ts +24 -0
- package/es/DynamicGridList/index.js +67 -0
- package/es/DynamicList/demo.d.ts +2 -0
- package/es/DynamicList/demo.js +44 -0
- package/es/DynamicList/index.d.ts +22 -0
- package/es/DynamicList/index.js +86 -0
- package/es/DynamicList/index.less +17 -0
- package/es/DynamicList/interface.d.ts +19 -0
- package/es/DynamicList/utils.d.ts +4 -0
- package/es/DynamicList/utils.js +6 -0
- package/es/ErrorFallback/index.d.ts +9 -0
- package/es/ErrorFallback/index.js +31 -0
- package/es/ErrorFallback/inerface.d.ts +48 -0
- package/es/EventTools/index.d.ts +3 -0
- package/es/EventTools/index.js +12 -0
- package/es/FrontendPlayer/index.d.ts +4 -0
- package/es/FrontendPlayer/index.js +2 -0
- package/es/FullScreen/index.d.ts +22 -0
- package/es/FullScreen/index.js +33 -0
- package/es/FullScreen/index.less +18 -0
- package/es/GridList/Demo.d.ts +3 -0
- package/es/GridList/Demo.js +80 -0
- package/es/GridList/data.d.ts +16 -0
- package/es/GridList/data.js +609 -0
- package/es/GridList/hook.d.ts +13 -0
- package/es/GridList/hook.js +270 -0
- package/es/GridList/index.d.ts +15 -0
- package/es/GridList/index.js +44 -0
- package/es/GridList/index.less +8 -0
- package/es/GridList/interface.d.ts +59 -0
- package/es/GridList/utils.d.ts +9 -0
- package/es/GridList/utils.js +42 -0
- package/es/HightLevel/index.d.ts +9 -0
- package/es/HightLevel/index.js +18 -0
- package/es/HightLevel/index.less +3 -0
- package/es/IconFont/index.d.ts +12 -0
- package/es/IconFont/index.js +54 -0
- package/es/ImageView/index.d.ts +20 -0
- package/es/ImageView/index.js +51 -0
- package/es/ImageView/index.less +11 -0
- package/es/InstanceHistory/index.d.ts +3 -0
- package/es/InstanceHistory/index.js +7 -0
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +2 -0
- package/es/LabelPlayer/demo.js +115 -0
- package/es/LabelPlayer/index.d.ts +21 -0
- package/es/LabelPlayer/index.js +160 -0
- package/es/LabelPlayer/index.less +24 -0
- package/es/LabelValue/index.d.ts +15 -0
- package/es/LabelValue/index.js +27 -0
- package/es/LabelValue/index.less +23 -0
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +23 -0
- package/es/List/index.d.ts +28 -0
- package/es/List/index.js +28 -0
- package/es/List/index.less +20 -0
- package/es/ListWithSizeAnimate/demo.d.ts +2 -0
- package/es/ListWithSizeAnimate/demo.js +98 -0
- package/es/ListWithSizeAnimate/index.d.ts +14 -0
- package/es/ListWithSizeAnimate/index.js +85 -0
- package/es/ListWithSizeAnimate/index.less +23 -0
- package/es/LoaderScript/index.d.ts +47 -0
- package/es/LoaderScript/index.js +34 -0
- package/es/LoaderScript/utils.d.ts +13 -0
- package/es/LoaderScript/utils.js +179 -0
- package/es/Map/AMap.d.ts +7109 -0
- package/es/Map/BasicMap/AMapInstance.d.ts +19 -0
- package/es/Map/BasicMap/AMapInstance.js +98 -0
- package/es/Map/BasicMap/LeafletInstance.d.ts +18 -0
- package/es/Map/BasicMap/LeafletInstance.js +111 -0
- package/es/Map/BasicMap/index.d.ts +9 -0
- package/es/Map/BasicMap/index.js +90 -0
- package/es/Map/BasicMap/index.less +29 -0
- package/es/Map/ClusterLayer/demo.d.ts +3 -0
- package/es/Map/ClusterLayer/demo.js +18 -0
- package/es/Map/ClusterLayer/hook.d.ts +5 -0
- package/es/Map/ClusterLayer/hook.js +123 -0
- package/es/Map/ClusterLayer/index.d.ts +6 -0
- package/es/Map/ClusterLayer/index.js +28 -0
- package/es/Map/ClusterLayer/index.less +29 -0
- package/es/Map/ClusterLayer/props.d.ts +8 -0
- package/es/Map/Config/index.d.ts +9 -0
- package/es/Map/Config/index.js +48 -0
- package/es/Map/Config/utils.d.ts +2 -0
- package/es/Map/Config/utils.js +65 -0
- package/es/Map/Context/index.d.ts +11 -0
- package/es/Map/Context/index.js +51 -0
- package/es/Map/FindPio/index.d.ts +4 -0
- package/es/Map/FindPio/index.js +13 -0
- package/es/Map/FindPio/index.less +7 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +4 -0
- package/es/Map/InfoWindow/MakerLikeWindow.js +112 -0
- package/es/Map/InfoWindow/demo.d.ts +3 -0
- package/es/Map/InfoWindow/demo.js +70 -0
- package/es/Map/InfoWindow/index.d.ts +11 -0
- package/es/Map/InfoWindow/index.js +66 -0
- package/es/Map/LevelCenter/DragMarker/index.d.ts +10 -0
- package/es/Map/LevelCenter/DragMarker/index.js +42 -0
- package/es/Map/LevelCenter/demo.d.ts +3 -0
- package/es/Map/LevelCenter/demo.js +38 -0
- package/es/Map/LevelCenter/index.d.ts +15 -0
- package/es/Map/LevelCenter/index.js +66 -0
- package/es/Map/LoaderMap/index.d.ts +7 -0
- package/es/Map/LoaderMap/index.js +62 -0
- package/es/Map/MapDrawSelect/demo.d.ts +3 -0
- package/es/Map/MapDrawSelect/demo.js +71 -0
- package/es/Map/MapDrawSelect/index.d.ts +15 -0
- package/es/Map/MapDrawSelect/index.js +56 -0
- package/es/Map/MouseTool/index.d.ts +10 -0
- package/es/Map/MouseTool/index.js +40 -0
- package/es/Map/MouseTool/useMouseTools.d.ts +7 -0
- package/es/Map/MouseTool/useMouseTools.js +83 -0
- package/es/Map/ResetTools/index.d.ts +10 -0
- package/es/Map/ResetTools/index.js +57 -0
- package/es/Map/ResetTools/index.less +39 -0
- package/es/Map/SinglePoint/demo.d.ts +3 -0
- package/es/Map/SinglePoint/demo.js +14 -0
- package/es/Map/SinglePoint/index.d.ts +27 -0
- package/es/Map/SinglePoint/index.js +52 -0
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.d.ts +2 -0
- package/es/Map/hook/useMapEvent.js +19 -0
- package/es/Map/hook/useMapType.d.ts +4 -0
- package/es/Map/hook/useMapType.js +12 -0
- package/es/Map/icon.d.ts +2 -0
- package/es/Map/icon.js +10 -0
- package/es/Map/index.d.ts +24 -0
- package/es/Map/index.js +25 -0
- package/es/Map/interface.d.ts +74 -0
- package/es/Map/points.d.ts +50 -0
- package/es/Map/points.js +1 -0
- package/es/Map/useMarker/index.d.ts +10 -0
- package/es/Map/useMarker/index.js +71 -0
- package/es/Map/withMap/index.d.ts +3 -0
- package/es/Map/withMap/index.js +10 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +8 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +80 -0
- package/es/Picture/component/DefaultRects/index.d.ts +13 -0
- package/es/Picture/component/DefaultRects/index.js +52 -0
- package/es/Picture/component/DefaultRects/index.less +211 -0
- package/es/Picture/component/DefaultRects/utils.d.ts +2 -0
- package/es/Picture/component/DefaultRects/utils.js +11 -0
- package/es/Picture/component/DrawRect/index.d.ts +13 -0
- package/es/Picture/component/DrawRect/index.js +46 -0
- package/es/Picture/component/DrawRect/index.less +8 -0
- package/es/Picture/component/RectMenu/index.d.ts +12 -0
- package/es/Picture/component/RectMenu/index.js +76 -0
- package/es/Picture/component/RectMenu/index.less +36 -0
- package/es/Picture/component/RectMenu/utils.d.ts +12 -0
- package/es/Picture/component/RectMenu/utils.js +19 -0
- package/es/Picture/component/Tools/index.d.ts +12 -0
- package/es/Picture/component/Tools/index.js +73 -0
- package/es/Picture/component/Tools/index.less +49 -0
- package/es/Picture/component/WheelScale/index.d.ts +7 -0
- package/es/Picture/component/WheelScale/index.js +27 -0
- package/es/Picture/demo.d.ts +2 -0
- package/es/Picture/demo.js +105 -0
- package/es/Picture/index.d.ts +5 -0
- package/es/Picture/index.js +341 -0
- package/es/Picture/index.less +20 -0
- package/es/Picture/interface.d.ts +196 -0
- package/es/Picture/loadCaptureRectImage.d.ts +3 -0
- package/es/Picture/loadCaptureRectImage.js +99 -0
- package/es/Picture/useDraw.d.ts +1 -0
- package/es/Picture/useDraw.js +103 -0
- package/es/Picture/utils.d.ts +26 -0
- package/es/Picture/utils.js +143 -0
- package/es/Player/api/index.d.ts +68 -0
- package/es/Player/api/index.js +309 -0
- package/es/Player/context.d.ts +17 -0
- package/es/Player/context.js +24 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +20 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +6 -0
- package/es/Player/contraller_bar/contraller_event.js +50 -0
- package/es/Player/contraller_bar/index.d.ts +14 -0
- package/es/Player/contraller_bar/index.js +27 -0
- package/es/Player/contraller_bar/left_bar.d.ts +10 -0
- package/es/Player/contraller_bar/left_bar.js +83 -0
- package/es/Player/contraller_bar/right_bar.d.ts +8 -0
- package/es/Player/contraller_bar/right_bar.js +32 -0
- package/es/Player/contraller_bar/time.d.ts +3 -0
- package/es/Player/contraller_bar/time.js +19 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +2 -0
- package/es/Player/contraller_bar/useBarStatus.js +43 -0
- package/es/Player/contraller_bar/volume.d.ts +9 -0
- package/es/Player/contraller_bar/volume.js +62 -0
- package/es/Player/demo.d.ts +3 -0
- package/es/Player/demo.js +266 -0
- package/es/Player/empty.d.ts +2 -0
- package/es/Player/empty.js +4 -0
- package/es/Player/event/errorEvent.d.ts +14 -0
- package/es/Player/event/errorEvent.js +88 -0
- package/es/Player/event/eventName.d.ts +18 -0
- package/es/Player/event/eventName.js +29 -0
- package/es/Player/event/index.d.ts +24 -0
- package/es/Player/event/index.js +205 -0
- package/es/Player/fps_play.d.ts +11 -0
- package/es/Player/fps_play.js +83 -0
- package/es/Player/frontend_player.d.ts +8 -0
- package/es/Player/frontend_player.js +64 -0
- package/es/Player/frontend_timeline.d.ts +10 -0
- package/es/Player/frontend_timeline.js +132 -0
- package/es/Player/iconfont.d.ts +5 -0
- package/es/Player/iconfont.js +16 -0
- package/es/Player/index.d.ts +2 -0
- package/es/Player/index.js +2 -0
- package/es/Player/live_heart.d.ts +8 -0
- package/es/Player/live_heart.js +45 -0
- package/es/Player/message.d.ts +5 -0
- package/es/Player/message.js +137 -0
- package/es/Player/player.d.ts +233 -0
- package/es/Player/segment_player.d.ts +9 -0
- package/es/Player/segment_player.js +228 -0
- package/es/Player/segment_timeline.d.ts +12 -0
- package/es/Player/segment_timeline.js +173 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +262 -0
- package/es/Player/style/bar.less +43 -0
- package/es/Player/style/iconfont.js +43 -0
- package/es/Player/style/index.less +34 -0
- package/es/Player/style/message.less +56 -0
- package/es/Player/style/slider.less +106 -0
- package/es/Player/style/timeline.less +117 -0
- package/es/Player/style/volume.less +24 -0
- package/es/Player/timeline.d.ts +5 -0
- package/es/Player/timeline.js +95 -0
- package/es/Player/util.d.ts +43 -0
- package/es/Player/util.js +189 -0
- package/es/PlayerExt/demo.d.ts +3 -0
- package/es/PlayerExt/demo.js +154 -0
- package/es/PlayerExt/index.d.ts +48 -0
- package/es/PlayerExt/index.js +188 -0
- package/es/PlayerExt/index.less +10 -0
- package/es/Progress/index.d.ts +7 -0
- package/es/Progress/index.js +53 -0
- package/es/Progress/index.less +21 -0
- package/es/ROI/demo.d.ts +3 -0
- package/es/ROI/demo.js +16 -0
- package/es/ROI/index.d.ts +33 -0
- package/es/ROI/index.js +54 -0
- package/es/ROI/index.less +33 -0
- package/es/RefDrawer/Footer.d.ts +9 -0
- package/es/RefDrawer/Footer.js +22 -0
- package/es/RefDrawer/demo.d.ts +3 -0
- package/es/RefDrawer/demo.js +18 -0
- package/es/RefDrawer/index.d.ts +26 -0
- package/es/RefDrawer/index.js +71 -0
- package/es/RefModal/demo.d.ts +3 -0
- package/es/RefModal/demo.js +18 -0
- package/es/RefModal/index.d.ts +17 -0
- package/es/RefModal/index.js +70 -0
- package/es/ScreenPlayer/Live.d.ts +5 -0
- package/es/ScreenPlayer/Live.js +212 -0
- package/es/ScreenPlayer/LiveTools.d.ts +29 -0
- package/es/ScreenPlayer/LiveTools.js +151 -0
- package/es/ScreenPlayer/PlayerWithExt.d.ts +34 -0
- package/es/ScreenPlayer/PlayerWithExt.js +231 -0
- package/es/ScreenPlayer/RatePick.d.ts +8 -0
- package/es/ScreenPlayer/RatePick.js +29 -0
- package/es/ScreenPlayer/Record.d.ts +10 -0
- package/es/ScreenPlayer/Record.js +442 -0
- package/es/ScreenPlayer/RecordTools.d.ts +38 -0
- package/es/ScreenPlayer/RecordTools.js +197 -0
- package/es/ScreenPlayer/ScreenSelect.d.ts +7 -0
- package/es/ScreenPlayer/ScreenSelect.js +46 -0
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +17 -0
- package/es/ScreenPlayer/SegmentTimeLine.js +36 -0
- package/es/ScreenPlayer/TimeMode.d.ts +7 -0
- package/es/ScreenPlayer/TimeMode.js +26 -0
- package/es/ScreenPlayer/TimeSelect.d.ts +7 -0
- package/es/ScreenPlayer/TimeSelect.js +88 -0
- package/es/ScreenPlayer/demo.d.ts +2 -0
- package/es/ScreenPlayer/demo.js +21 -0
- package/es/ScreenPlayer/demo2.d.ts +2 -0
- package/es/ScreenPlayer/demo2.js +194 -0
- package/es/ScreenPlayer/index.d.ts +6 -0
- package/es/ScreenPlayer/index.js +9 -0
- package/es/ScreenPlayer/index.less +335 -0
- package/es/ScreenPlayer/interface.d.ts +216 -0
- package/es/ScreenPlayer/useTimeSlider.d.ts +25 -0
- package/es/ScreenPlayer/useTimeSlider.js +451 -0
- package/es/ScreenPlayer/useVideoFit.d.ts +5 -0
- package/es/ScreenPlayer/useVideoFit.js +35 -0
- package/es/ScreenPlayer/utils.d.ts +17 -0
- package/es/ScreenPlayer/utils.js +85 -0
- package/es/SegmentPlayer/index.d.ts +2 -0
- package/es/SegmentPlayer/index.js +2 -0
- package/es/Service/http.d.ts +6 -0
- package/es/Service/http.js +133 -0
- package/es/Service/index.d.ts +3 -0
- package/es/Service/index.js +11 -0
- package/es/Service/interface.d.ts +23 -0
- package/es/Service/middleware.d.ts +8 -0
- package/es/Service/middleware.js +22 -0
- package/es/SocketEmitter/eventEmitter.d.ts +27 -0
- package/es/SocketEmitter/eventEmitter.js +88 -0
- package/es/SocketEmitter/index.d.ts +24 -0
- package/es/SocketEmitter/index.js +125 -0
- package/es/SocketEmitter/interface.d.ts +4 -0
- package/es/TableLayout/index.d.ts +10 -0
- package/es/TableLayout/index.js +27 -0
- package/es/TableLayout/index.less +4 -0
- package/es/ThemeAntd/demo.d.ts +4 -0
- package/es/ThemeAntd/demo.js +81 -0
- package/es/ThemeAntd/demo.less +20 -0
- package/es/ThemeAntd/index.d.ts +7 -0
- package/es/ThemeAntd/index.js +21 -0
- package/es/ThemeAntd/index.less +4 -0
- package/es/Timeout/index.d.ts +26 -0
- package/es/Timeout/index.js +65 -0
- package/es/bigNumberTransformCN/index.d.ts +5 -0
- package/es/bigNumberTransformCN/index.js +58 -0
- package/es/cache/index.d.ts +34 -0
- package/es/cache/index.js +94 -0
- package/es/copy/index.d.ts +1 -0
- package/es/copy/index.js +9 -0
- package/es/core.d.ts +0 -0
- package/es/getThemeStyle/index.d.ts +2 -0
- package/es/getThemeStyle/index.js +5 -0
- package/es/index.d.ts +62 -0
- package/es/index.js +62 -0
- package/es/likeGo/index.d.ts +2 -0
- package/es/likeGo/index.js +31 -0
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +7 -0
- package/es/logger/index.js +30 -0
- package/es/nextTick/index.d.ts +1 -0
- package/es/nextTick/index.js +3 -0
- package/es/recorder/demo.d.ts +3 -0
- package/es/recorder/demo.js +181 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +992 -0
- package/es/submidstr/index.d.ts +5 -0
- package/es/submidstr/index.js +14 -0
- package/es/treeHelper/index.d.ts +11 -0
- package/es/treeHelper/index.js +188 -0
- package/es/typings.d.ts +2 -0
- package/es/useDrawROI/index.d.ts +16 -0
- package/es/useDrawROI/index.js +318 -0
- package/es/useEventEmitterHandle/index.d.ts +2 -0
- package/es/useEventEmitterHandle/index.js +17 -0
- package/es/useFullscreen/demo.d.ts +2 -0
- package/es/useFullscreen/demo.js +43 -0
- package/es/useFullscreen/index.d.ts +12 -0
- package/es/useFullscreen/index.js +76 -0
- package/es/useHistory/index.d.ts +3 -0
- package/es/useHistory/index.js +9 -0
- package/es/useHistory/interface.d.ts +3 -0
- package/es/useInfiniteScroll/index.d.ts +16 -0
- package/es/useInfiniteScroll/index.js +102 -0
- package/es/useRafInterval/index.d.ts +5 -0
- package/es/useRafInterval/index.js +71 -0
- package/es/useSimpleState/index.d.ts +3 -0
- package/es/useSimpleState/index.js +35 -0
- package/es/useVirtualList/index.d.ts +13 -0
- package/es/useVirtualList/index.js +136 -0
- package/es/utils.d.ts +14 -0
- package/es/utils.js +46 -0
- package/es/uuid/index.d.ts +5 -0
- package/es/uuid/index.js +6 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ModalProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IUseModalHookState {
|
|
4
|
+
content?: React.ReactNode;
|
|
5
|
+
visible?: boolean;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
onOk?: () => void;
|
|
8
|
+
width?: number | string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IRefModalMethodsProps {
|
|
12
|
+
open: (options: IUseModalHookState) => void;
|
|
13
|
+
close: () => void;
|
|
14
|
+
}
|
|
15
|
+
export type IModalProps = ModalProps;
|
|
16
|
+
declare const RefModal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<IRefModalMethodsProps>>;
|
|
17
|
+
export default RefModal;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
+
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
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
import { Modal } from 'antd';
|
|
15
|
+
import React, { useContext, useImperativeHandle, useMemo, useState } from 'react';
|
|
16
|
+
import ConfigContext from "../ConfigContext";
|
|
17
|
+
var RefModal = /*#__PURE__*/React.forwardRef(function RefModal(props, ref) {
|
|
18
|
+
var context = useContext(ConfigContext.Context);
|
|
19
|
+
var root = useMemo(function () {
|
|
20
|
+
return (context === null || context === void 0 ? void 0 : context.root) || document.body;
|
|
21
|
+
}, [context === null || context === void 0 ? void 0 : context.root]);
|
|
22
|
+
var _useState = useState({
|
|
23
|
+
content: null,
|
|
24
|
+
visible: false,
|
|
25
|
+
title: '',
|
|
26
|
+
onOk: undefined,
|
|
27
|
+
width: undefined,
|
|
28
|
+
className: undefined
|
|
29
|
+
}),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
state = _useState2[0],
|
|
32
|
+
setState = _useState2[1];
|
|
33
|
+
var open = function open(options) {
|
|
34
|
+
setState(function (old) {
|
|
35
|
+
return _objectSpread(_objectSpread(_objectSpread({}, old), options), {}, {
|
|
36
|
+
visible: true
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var close = function close() {
|
|
41
|
+
setState(function (old) {
|
|
42
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
43
|
+
visible: false
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
|
+
useImperativeHandle(ref, function () {
|
|
50
|
+
return {
|
|
51
|
+
open: open,
|
|
52
|
+
close: close
|
|
53
|
+
};
|
|
54
|
+
}, [state]);
|
|
55
|
+
return /*#__PURE__*/React.createElement(Modal, _extends({}, props, {
|
|
56
|
+
okText: "\u786E\u5B9A",
|
|
57
|
+
cancelText: "\u53D6\u6D88",
|
|
58
|
+
open: state.visible,
|
|
59
|
+
onOk: state.onOk,
|
|
60
|
+
onCancel: close,
|
|
61
|
+
destroyOnClose: true,
|
|
62
|
+
title: state.title,
|
|
63
|
+
width: state.width,
|
|
64
|
+
className: state.className,
|
|
65
|
+
getContainer: function getContainer() {
|
|
66
|
+
return root;
|
|
67
|
+
}
|
|
68
|
+
}), state.content);
|
|
69
|
+
});
|
|
70
|
+
export default RefModal;
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["list", "children", "oneWinExtTools", "allWinExtTools"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
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."); }
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
+
import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
18
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
+
import DisableMark from "../DisableMark";
|
|
20
|
+
import Tools from "./LiveTools";
|
|
21
|
+
import { LivePlayerWithExt } from "./PlayerWithExt";
|
|
22
|
+
import useVideoFit from "./useVideoFit";
|
|
23
|
+
import { ScreenType, mergeFill } from "./utils";
|
|
24
|
+
import "./index.less";
|
|
25
|
+
function LivePlayer(_ref) {
|
|
26
|
+
var _props$defaultScreen, _props$defaultSelectI;
|
|
27
|
+
var _ref$list = _ref.list,
|
|
28
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
29
|
+
children = _ref.children,
|
|
30
|
+
oneWinExtTools = _ref.oneWinExtTools,
|
|
31
|
+
allWinExtTools = _ref.allWinExtTools,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
var _useState = useState({
|
|
34
|
+
screenNum: (_props$defaultScreen = props.defaultScreen) !== null && _props$defaultScreen !== void 0 ? _props$defaultScreen : 4,
|
|
35
|
+
selectIndex: (_props$defaultSelectI = props.defaultSelectIndex) !== null && _props$defaultSelectI !== void 0 ? _props$defaultSelectI : 0,
|
|
36
|
+
modes: {}
|
|
37
|
+
}),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
state = _useState2[0],
|
|
40
|
+
setState = _useState2[1];
|
|
41
|
+
var domRef = useRef(null);
|
|
42
|
+
var _useVideoFit = useVideoFit(domRef, []),
|
|
43
|
+
fit = _useVideoFit.fit,
|
|
44
|
+
toggleFit = _useVideoFit.toggleFit;
|
|
45
|
+
|
|
46
|
+
// 若外部来控制screenNum 则由外部完全控制
|
|
47
|
+
var screenNum = useMemo(function () {
|
|
48
|
+
var _props$screenNum;
|
|
49
|
+
return (_props$screenNum = props.screenNum) !== null && _props$screenNum !== void 0 ? _props$screenNum : state.screenNum;
|
|
50
|
+
}, [props.screenNum, state.screenNum]);
|
|
51
|
+
|
|
52
|
+
// 缓存所有player对象
|
|
53
|
+
var playerRef = useRef({});
|
|
54
|
+
var screenType = useMemo(function () {
|
|
55
|
+
return ScreenType.find(function (v) {
|
|
56
|
+
return v.name === screenNum;
|
|
57
|
+
});
|
|
58
|
+
}, [screenNum]);
|
|
59
|
+
var screenList = useMemo(function () {
|
|
60
|
+
return mergeFill(screenNum, list, {});
|
|
61
|
+
}, [list, screenNum]);
|
|
62
|
+
|
|
63
|
+
// 获取选中player对象
|
|
64
|
+
var getPlayerItem = function getPlayerItem() {
|
|
65
|
+
var _playerRef$current;
|
|
66
|
+
var item = list ? list[state.selectIndex] : {};
|
|
67
|
+
var cid = item === null || item === void 0 ? void 0 : item.cid;
|
|
68
|
+
return cid ? (_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 || (_playerRef$current = _playerRef$current[cid]) === null || _playerRef$current === void 0 ? void 0 : _playerRef$current.current : undefined;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// 更新状态
|
|
72
|
+
var updateState = function updateState(newState) {
|
|
73
|
+
var obj = {};
|
|
74
|
+
if (newState.hasOwnProperty('screenNum')) {
|
|
75
|
+
if (props.screenNum) {
|
|
76
|
+
var _props$screenChange;
|
|
77
|
+
// 若外部控制,不需要update state
|
|
78
|
+
(_props$screenChange = props.screenChange) === null || _props$screenChange === void 0 || _props$screenChange.call(props, newState.screenNum);
|
|
79
|
+
} else {
|
|
80
|
+
obj.screenNum = newState.screenNum;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 修正选中索引
|
|
84
|
+
if (newState.screenNum && newState.screenNum < state.selectIndex) {
|
|
85
|
+
obj.selectIndex = 0;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (newState.hasOwnProperty('mode')) {
|
|
89
|
+
var item = list === null || list === void 0 ? void 0 : list[state.selectIndex];
|
|
90
|
+
var newModes = _objectSpread({}, state.modes);
|
|
91
|
+
var cid = item === null || item === void 0 ? void 0 : item.cid;
|
|
92
|
+
if (cid) {
|
|
93
|
+
newModes[cid] = newState.mode;
|
|
94
|
+
obj.modes = newModes;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
setState(function (old) {
|
|
98
|
+
return _objectSpread(_objectSpread({}, old), obj);
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// 当前窗口信息
|
|
103
|
+
var segmentItem = useMemo(function () {
|
|
104
|
+
return (list === null || list === void 0 ? void 0 : list[state.selectIndex]) || {};
|
|
105
|
+
}, [state.selectIndex, list]);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 同步外部的selectIndex变化
|
|
109
|
+
*/
|
|
110
|
+
useEffect(function () {
|
|
111
|
+
if (typeof props.defaultSelectIndex !== 'number') {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
setState(function (old) {
|
|
115
|
+
if (old.selectIndex !== props.defaultSelectIndex) {
|
|
116
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
117
|
+
selectIndex: props.defaultSelectIndex
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return old;
|
|
121
|
+
});
|
|
122
|
+
}, [props.defaultSelectIndex]);
|
|
123
|
+
|
|
124
|
+
// index变化同步到父组件
|
|
125
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
126
|
+
useUpdateEffect(function () {
|
|
127
|
+
var _props$onIndexChange;
|
|
128
|
+
return (_props$onIndexChange = props.onIndexChange) === null || _props$onIndexChange === void 0 ? void 0 : _props$onIndexChange.call(props, state.selectIndex);
|
|
129
|
+
}, [state.selectIndex]);
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 通知screenNum变化
|
|
133
|
+
*/
|
|
134
|
+
useUpdateEffect(function () {
|
|
135
|
+
var _props$screenChange2;
|
|
136
|
+
return (_props$screenChange2 = props.screenChange) === null || _props$screenChange2 === void 0 ? void 0 : _props$screenChange2.call(props, state.screenNum);
|
|
137
|
+
}, [state.screenNum]);
|
|
138
|
+
var onClose = useMemoizedFn(function () {
|
|
139
|
+
var _props$onClose;
|
|
140
|
+
setState(function (old) {
|
|
141
|
+
var item = screenList[old.selectIndex];
|
|
142
|
+
if (item && item.cid) {
|
|
143
|
+
var modes = _objectSpread({}, old.modes);
|
|
144
|
+
delete modes["".concat(item.cid)];
|
|
145
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
146
|
+
modes: modes
|
|
147
|
+
});
|
|
148
|
+
} else {
|
|
149
|
+
return old;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
153
|
+
});
|
|
154
|
+
var onCloseAll = useMemoizedFn(function () {
|
|
155
|
+
var _props$onCloseAll;
|
|
156
|
+
setState(function (old) {
|
|
157
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
158
|
+
modes: {},
|
|
159
|
+
currentTimes: {}
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
(_props$onCloseAll = props.onCloseAll) === null || _props$onCloseAll === void 0 || _props$onCloseAll.call(props);
|
|
163
|
+
});
|
|
164
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
165
|
+
className: "split-screen-player-wrapper split-screen-player-live-wrapper"
|
|
166
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
className: "player-layout container".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name),
|
|
168
|
+
ref: domRef
|
|
169
|
+
}, screenList.map(function (item, index) {
|
|
170
|
+
var _item$url;
|
|
171
|
+
var className = state.selectIndex === index ? "item".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name, "-").concat(index + 1, " player-current-index") : "item".concat(screenType === null || screenType === void 0 ? void 0 : screenType.name, "-").concat(index + 1);
|
|
172
|
+
var itemClick = function itemClick() {
|
|
173
|
+
return setState(function (old) {
|
|
174
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
175
|
+
selectIndex: index
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
return /*#__PURE__*/React.createElement(LivePlayerWithExt, _extends({}, item, {
|
|
180
|
+
mode: item.cid && state.modes[item.cid] ? state.modes[item.cid] : item.mode,
|
|
181
|
+
key: (_item$url = item.url) !== null && _item$url !== void 0 ? _item$url : "".concat(index),
|
|
182
|
+
updatePlayer: function updatePlayer(player) {
|
|
183
|
+
if (item.cid) {
|
|
184
|
+
playerRef.current[item.cid] = player;
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
className: className,
|
|
188
|
+
onClick: itemClick,
|
|
189
|
+
pluginDownloadUrl: props.pluginDownloadUrl
|
|
190
|
+
}));
|
|
191
|
+
})), /*#__PURE__*/React.createElement(DisableMark, {
|
|
192
|
+
disabled: !segmentItem.url,
|
|
193
|
+
width: "70%"
|
|
194
|
+
}, /*#__PURE__*/React.createElement(Tools, {
|
|
195
|
+
onClose: onClose,
|
|
196
|
+
onCloseAll: onCloseAll,
|
|
197
|
+
fit: fit,
|
|
198
|
+
toggleFit: toggleFit,
|
|
199
|
+
getPlayerItem: getPlayerItem,
|
|
200
|
+
screenNum: screenNum,
|
|
201
|
+
mode: segmentItem !== null && segmentItem !== void 0 && segmentItem.cid ? state.modes[segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.cid] : segmentItem === null || segmentItem === void 0 ? void 0 : segmentItem.mode,
|
|
202
|
+
containerRef: domRef,
|
|
203
|
+
updateState: updateState,
|
|
204
|
+
snapshot: props.snapshot,
|
|
205
|
+
oneWinExtTools: oneWinExtTools,
|
|
206
|
+
allWinExtTools: allWinExtTools,
|
|
207
|
+
hasPlugin: !!props.pluginDownloadUrl
|
|
208
|
+
}), children && /*#__PURE__*/React.cloneElement(children, {
|
|
209
|
+
selectIndex: state.selectIndex
|
|
210
|
+
})));
|
|
211
|
+
}
|
|
212
|
+
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): React.JSX.Element;
|
|
29
|
+
export default LiveTools;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var _excluded = ["containerRef", "oneWinExtTools", "allWinExtTools", "screenNum", "mode", "fit", "hasPlugin"];
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import { useInterval, useUpdate } from 'ahooks';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import Volume from "../Player/contraller_bar/volume";
|
|
13
|
+
import IconFont from "../Player/iconfont";
|
|
14
|
+
import useFullscreen from "../useFullscreen";
|
|
15
|
+
import ScreenSelect from "./ScreenSelect";
|
|
16
|
+
function LiveTools(_ref) {
|
|
17
|
+
var containerRef = _ref.containerRef,
|
|
18
|
+
oneWinExtTools = _ref.oneWinExtTools,
|
|
19
|
+
allWinExtTools = _ref.allWinExtTools,
|
|
20
|
+
screenNum = _ref.screenNum,
|
|
21
|
+
_ref$mode = _ref.mode,
|
|
22
|
+
mode = _ref$mode === void 0 ? 1 : _ref$mode,
|
|
23
|
+
fit = _ref.fit,
|
|
24
|
+
hasPlugin = _ref.hasPlugin,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
var _useFullscreen = useFullscreen(containerRef),
|
|
27
|
+
_useFullscreen2 = _slicedToArray(_useFullscreen, 2),
|
|
28
|
+
isFullscreen = _useFullscreen2[0],
|
|
29
|
+
toggleFullscreen = _useFullscreen2[1].toggleFullscreen;
|
|
30
|
+
var update = useUpdate();
|
|
31
|
+
// 播放状态控制
|
|
32
|
+
var playToggle = function playToggle() {
|
|
33
|
+
var player = props.getPlayerItem();
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
35
|
+
player ? player.video.paused ? player.api.play() : player.api.pause() : undefined;
|
|
36
|
+
update();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// 重连
|
|
40
|
+
var reload = function reload() {
|
|
41
|
+
var player = props.getPlayerItem();
|
|
42
|
+
player === null || player === void 0 || player.api.reload();
|
|
43
|
+
};
|
|
44
|
+
var snapshotaction = function snapshotaction() {
|
|
45
|
+
var player = props.getPlayerItem();
|
|
46
|
+
var base64 = player === null || player === void 0 ? void 0 : player.api.snapshot();
|
|
47
|
+
if (base64) {
|
|
48
|
+
var _props$snapshot;
|
|
49
|
+
(_props$snapshot = props.snapshot) === null || _props$snapshot === void 0 || _props$snapshot.call(props, base64);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var player = props.getPlayerItem();
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 定时获取play状态
|
|
56
|
+
*/
|
|
57
|
+
useInterval(function () {
|
|
58
|
+
return update();
|
|
59
|
+
}, 2000);
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: "player-tools"
|
|
62
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: "player-tools-left"
|
|
64
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
65
|
+
className: "player-tools-item"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Volume, {
|
|
67
|
+
api: player === null || player === void 0 ? void 0 : player.api
|
|
68
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
69
|
+
className: "player-tools-item"
|
|
70
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
71
|
+
type: "lm-player-xiangji1fill",
|
|
72
|
+
title: "\u622A\u56FE",
|
|
73
|
+
onClick: snapshotaction
|
|
74
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
75
|
+
className: "player-tools-item",
|
|
76
|
+
onClick: reload
|
|
77
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
78
|
+
type: "lm-player-Refresh_Main",
|
|
79
|
+
title: "\u91CD\u8F7D"
|
|
80
|
+
})), hasPlugin && /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
className: "player-tools-item",
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
return props.updateState({
|
|
84
|
+
mode: mode !== 2 ? 2 : 1
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
88
|
+
type: "lm-player-S_Device_shezhi",
|
|
89
|
+
className: "icon-chajian",
|
|
90
|
+
style: mode === 2 ? {
|
|
91
|
+
color: 'var(--primary)'
|
|
92
|
+
} : undefined,
|
|
93
|
+
title: "\u5207\u6362".concat(mode === 1 ? '插件' : '浏览器', "\u6A21\u5F0F")
|
|
94
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "player-tools-item",
|
|
96
|
+
onClick: props.onClose,
|
|
97
|
+
style: {
|
|
98
|
+
marginRight: 6
|
|
99
|
+
}
|
|
100
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
101
|
+
type: "lm-player-close",
|
|
102
|
+
title: "\u5173\u95ED"
|
|
103
|
+
})), oneWinExtTools), /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: "player-tools-mid"
|
|
105
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: "player-tools-item",
|
|
107
|
+
onClick: playToggle,
|
|
108
|
+
style: {
|
|
109
|
+
marginLeft: 6
|
|
110
|
+
}
|
|
111
|
+
}, player && !player.video.paused ? /*#__PURE__*/React.createElement(IconFont, {
|
|
112
|
+
type: "lm-player-Pause_Main",
|
|
113
|
+
title: "\u6682\u505C"
|
|
114
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
115
|
+
type: "lm-player-bofang",
|
|
116
|
+
title: "\u64AD\u653E"
|
|
117
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: "player-tools-right"
|
|
119
|
+
}, allWinExtTools, /*#__PURE__*/React.createElement("span", {
|
|
120
|
+
className: "player-tools-item",
|
|
121
|
+
onClick: props.onCloseAll
|
|
122
|
+
}, /*#__PURE__*/React.createElement(IconFont, {
|
|
123
|
+
type: "lm-player-quanbuguanbi",
|
|
124
|
+
title: "\u5173\u95ED\u6240\u6709"
|
|
125
|
+
})), /*#__PURE__*/React.createElement(ScreenSelect, {
|
|
126
|
+
screenNum: screenNum,
|
|
127
|
+
updateState: props.updateState
|
|
128
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
129
|
+
className: "player-tools-item",
|
|
130
|
+
onClick: props.toggleFit
|
|
131
|
+
}, fit === 'fill' ? /*#__PURE__*/React.createElement(IconFont, {
|
|
132
|
+
type: "lm-player-huamianshiying",
|
|
133
|
+
title: "\u81EA\u9002\u5E94"
|
|
134
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
135
|
+
type: "lm-player-huamianshiying",
|
|
136
|
+
title: "\u586B\u5145"
|
|
137
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
className: "player-tools-item",
|
|
139
|
+
onClick: toggleFullscreen,
|
|
140
|
+
style: {
|
|
141
|
+
marginRight: 0
|
|
142
|
+
}
|
|
143
|
+
}, isFullscreen ? /*#__PURE__*/React.createElement(IconFont, {
|
|
144
|
+
type: "lm-player-quanping",
|
|
145
|
+
title: "\u5168\u5C4F"
|
|
146
|
+
}) : /*#__PURE__*/React.createElement(IconFont, {
|
|
147
|
+
type: "lm-player-quanping",
|
|
148
|
+
title: "\u5168\u5C4F"
|
|
149
|
+
}))));
|
|
150
|
+
}
|
|
151
|
+
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): React.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): React.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): React.JSX.Element;
|
|
34
|
+
export {};
|