@cloud-app-dev/vidc 3.2.11 → 3.2.13
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/.dumi/tmp/core/EmptyRoute.tsx +9 -0
- package/.dumi/tmp/core/defineApp.ts +16 -0
- package/.dumi/tmp/core/history.ts +61 -0
- package/.dumi/tmp/core/plugin.ts +42 -0
- package/.dumi/tmp/core/pluginConfig.d.ts +276 -0
- package/.dumi/tmp/core/polyfill.ts +202 -0
- package/.dumi/tmp/core/route.tsx +38 -0
- package/.dumi/tmp/core/terminal.ts +38 -0
- package/.dumi/tmp/dumi/exports.ts +5 -0
- package/.dumi/tmp/dumi/locales/config.ts +56 -0
- package/.dumi/tmp/dumi/locales/runtime.tsx +38 -0
- package/.dumi/tmp/dumi/meta/atoms.ts +4 -0
- package/.dumi/tmp/dumi/meta/index.ts +186 -0
- package/.dumi/tmp/dumi/meta/runtime.ts +18 -0
- package/.dumi/tmp/dumi/meta/tabs.ts +8 -0
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +41 -0
- package/.dumi/tmp/dumi/theme/builtins/API.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +4 -0
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +4 -0
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Content.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Features.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Header.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +4 -0
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +4 -0
- package/.dumi/tmp/exports.ts +15 -0
- package/.dumi/tmp/testBrowser.tsx +82 -0
- package/.dumi/tmp/tsconfig.json +35 -0
- package/.dumi/tmp/typings.d.ts +136 -0
- package/.dumi/tmp/umi.ts +77 -0
- package/.dumi/tmp-production/core/EmptyRoute.tsx +9 -0
- package/.dumi/tmp-production/core/defineApp.ts +16 -0
- package/.dumi/tmp-production/core/history.ts +61 -0
- package/.dumi/tmp-production/core/plugin.ts +42 -0
- package/.dumi/tmp-production/core/pluginConfig.d.ts +276 -0
- package/.dumi/tmp-production/core/polyfill.ts +202 -0
- package/.dumi/tmp-production/core/route.tsx +38 -0
- package/.dumi/tmp-production/core/terminal.ts +38 -0
- package/.dumi/tmp-production/dumi/exports.ts +5 -0
- package/.dumi/tmp-production/dumi/locales/config.ts +56 -0
- package/.dumi/tmp-production/dumi/locales/runtime.tsx +38 -0
- package/.dumi/tmp-production/dumi/meta/atoms.ts +4 -0
- package/.dumi/tmp-production/dumi/meta/index.ts +178 -0
- package/.dumi/tmp-production/dumi/meta/runtime.ts +18 -0
- package/.dumi/tmp-production/dumi/meta/tabs.ts +5 -0
- package/.dumi/tmp-production/dumi/theme/ContextWrapper.tsx +41 -0
- package/.dumi/tmp-production/dumi/theme/builtins/API.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/builtins/Badge.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/builtins/Container.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/builtins/Previewer.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/builtins/SourceCode.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/builtins/Table.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/layouts/DocLayout.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Content.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/ContentTabs.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Features.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Footer.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Header.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Hero.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/HeroTitle.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/LangSwitch.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Logo.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Navbar.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/NotFound.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/PreviewerActions.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/PreviewerActionsExtra.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/RtlSwitch.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/SearchBar.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/SearchResult.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Sidebar.ts +4 -0
- package/.dumi/tmp-production/dumi/theme/slots/Toc.ts +4 -0
- package/.dumi/tmp-production/exports.ts +14 -0
- package/.dumi/tmp-production/testBrowser.tsx +82 -0
- package/.dumi/tmp-production/tsconfig.json +35 -0
- package/.dumi/tmp-production/typings.d.ts +136 -0
- package/.dumi/tmp-production/umi.ts +77 -0
- package/.dumirc.ts +71 -0
- package/.editorconfig +0 -3
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +19 -0
- package/.husky/commit-msg +5 -0
- package/.husky/pre-commit +4 -0
- package/.prettierrc.js +16 -0
- package/.stylelintrc +3 -0
- package/README.md +14 -26
- package/es/Api/index.js +100 -30
- package/es/AppContext/Sync.js +19 -3
- package/es/AppContext/index.js +86 -42
- package/es/AppContext/static.js +7 -0
- package/es/Auth/index.js +11 -4
- package/es/AutoExit/index.js +11 -3
- package/es/Box/BetweenBox/index.js +19 -10
- package/es/Box/BetweenBox/{index.css → index.less} +0 -0
- package/es/Box/InfoBox/index.js +24 -18
- package/es/Box/InfoBox/index.less +22 -0
- package/es/Box/TwoColumnBox/index.js +42 -25
- package/es/Box/TwoColumnBox/index.less +70 -0
- package/es/Box/deps/grid-factory.d.ts +2 -2
- package/es/Box/deps/grid-factory.js +12 -0
- package/es/Box/index.js +29 -16
- package/es/Box/{index.css → index.less} +5 -4
- package/es/CheckGroupFixed/demo.d.ts +3 -0
- package/es/CheckGroupFixed/demo.js +28 -0
- package/es/CheckGroupFixed/index.js +117 -82
- package/es/CheckGroupFixed/index.less +50 -0
- package/es/Config/index.js +5 -1
- package/es/Config/utils.js +18 -3
- package/es/ConfigContext/index.js +8 -4
- package/es/CustomRenderSelect/index.js +71 -36
- package/es/CustomRenderSelect/index.less +25 -0
- package/es/DisableMark/index.js +14 -11
- package/es/DisableMark/{index.css → index.less} +0 -0
- package/es/DomMove/demo.js +14 -10
- package/es/DomMove/index.js +52 -30
- package/es/DomMove/utils.js +8 -3
- package/es/Drag/DragAndDropItem.js +44 -20
- package/es/Drag/DropItem.js +22 -6
- package/es/Drag/index.js +2 -2
- package/es/Drag/{index.css → index.less} +0 -0
- package/es/Drawer/Footer.js +22 -15
- package/es/Drawer/{Demo.d.ts → demo.d.ts} +0 -0
- package/es/Drawer/demo.js +109 -0
- package/es/Drawer/index.js +98 -60
- package/es/Drawer/index.less +42 -0
- package/es/ErrorFallback/index.js +23 -14
- package/es/FrontendPlayer/index.js +1 -1
- package/es/FullScreen/index.js +30 -17
- package/es/FullScreen/index.less +16 -0
- package/es/HightLevel/index.js +11 -4
- package/es/HightLevel/{index.css → index.less} +0 -0
- package/es/IconFont/index.js +39 -18
- package/es/ImageView/index.js +37 -13
- package/es/ImageView/index.less +10 -0
- package/es/Input/demo.d.ts +3 -0
- package/es/Input/demo.js +16 -0
- package/es/Input/index.js +46 -22
- package/es/Input/index.less +12 -0
- package/es/InstanceHistory/index.js +2 -0
- package/es/LabelValue/index.js +25 -18
- package/es/LabelValue/index.less +20 -0
- package/es/List/DynamicGridList/Demo.d.ts +1 -0
- package/es/List/DynamicGridList/Demo.js +52 -32
- package/es/List/DynamicGridList/index.js +37 -22
- package/es/List/DynamicList/index.js +76 -56
- package/es/List/DynamicList/index.less +15 -0
- package/es/List/GridList/Demo.d.ts +1 -0
- package/es/List/GridList/Demo.js +60 -38
- package/es/List/GridList/hook.d.ts +1 -1
- package/es/List/GridList/hook.js +66 -35
- package/es/List/GridList/index.js +33 -29
- package/es/List/GridList/{index.css → index.less} +0 -0
- package/es/List/GridList/utils.d.ts +2 -2
- package/es/List/GridList/utils.js +1 -0
- package/es/List/VList/index.d.ts +1 -1
- package/es/List/VList/index.js +32 -19
- package/es/List/VList/{index.css → index.less} +0 -0
- package/es/List/VList/utils.d.ts +2 -2
- package/es/List/VList/utils.js +8 -6
- package/es/List/demo.d.ts +3 -0
- package/es/List/demo.js +26 -0
- package/es/List/index.d.ts +1 -1
- package/es/List/index.js +31 -23
- package/es/List/{index.css → index.less} +5 -4
- package/es/LoaderApp/index.js +59 -25
- package/es/LoaderApp/{index.css → index.less} +0 -0
- package/es/LoaderApp/loader.js +40 -23
- package/es/LoaderApp/sandbox.back.js +101 -24
- package/es/LoaderApp/sandbox.js +26 -9
- package/es/LoaderApp/utils.d.ts +1 -1
- package/es/LoaderApp/utils.js +68 -25
- package/es/LoaderScript/index.js +25 -10
- package/es/LoaderScript/utils.js +151 -87
- package/es/Map/BasicMap/AMapInstance.d.ts +1 -1
- package/es/Map/BasicMap/AMapInstance.js +25 -3
- package/es/Map/BasicMap/LeafletInstance.js +28 -11
- package/es/Map/BasicMap/index.js +67 -27
- package/es/Map/BasicMap/index.less +24 -0
- package/es/Map/ClusterLayer/hook.d.ts +2 -2
- package/es/Map/ClusterLayer/hook.js +51 -23
- package/es/Map/ClusterLayer/index.d.ts +1 -1
- package/es/Map/ClusterLayer/index.js +14 -6
- package/es/Map/ClusterLayer/index.less +27 -0
- package/es/Map/Config/index.js +44 -16
- package/es/Map/Config/utils.js +17 -3
- package/es/Map/Context/index.js +43 -9
- package/es/Map/FindPio/index.js +5 -2
- package/es/Map/FindPio/{index.css → index.less} +0 -0
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +1 -1
- package/es/Map/InfoWindow/MakerLikeWindow.js +41 -18
- package/es/Map/InfoWindow/demo.d.ts +1 -0
- package/es/Map/InfoWindow/demo.js +51 -29
- package/es/Map/InfoWindow/index.d.ts +1 -1
- package/es/Map/InfoWindow/index.js +39 -18
- package/es/Map/LevelCenter/DragMarker/index.js +16 -10
- package/es/Map/LevelCenter/demo.d.ts +1 -0
- package/es/Map/LevelCenter/demo.js +41 -22
- package/es/Map/LevelCenter/index.js +41 -29
- package/es/Map/LevelCenter/index.less +2 -0
- package/es/Map/LoaderMap/index.js +38 -22
- package/es/Map/MapDrawSelect/demo.d.ts +1 -0
- package/es/Map/MapDrawSelect/demo.js +65 -46
- package/es/Map/MapDrawSelect/index.js +43 -31
- package/es/Map/MapDrawSelect/index.less +2 -0
- package/es/Map/MouseTool/index.js +32 -18
- package/es/Map/MouseTool/useMouseTools.js +37 -8
- package/es/Map/ResetTools/index.js +58 -44
- package/es/Map/ResetTools/index.less +35 -0
- package/es/Map/SinglePoint/index.js +39 -27
- package/es/Map/SinglePoint/index.less +41 -0
- package/es/Map/hook/useMapEvent.js +8 -4
- package/es/Map/hook/useMapType.js +3 -2
- package/es/Map/index.d.ts +1 -0
- package/es/Map/index.js +11 -11
- package/es/Map/useMarker/index.d.ts +1 -1
- package/es/Map/useMarker/index.js +33 -13
- package/es/Map/{LevelCenter/index.css → useMarker/index.less} +0 -0
- package/es/Map/withMap/index.d.ts +1 -0
- package/es/Map/withMap/index.js +14 -4
- package/es/Modal/demo.d.ts +3 -0
- package/es/Modal/demo.js +106 -0
- package/es/Modal/index.js +94 -57
- package/es/Modal/index.less +45 -0
- package/es/Picture/component/DefaultRects/RectInfo.js +59 -37
- package/es/Picture/component/DefaultRects/index.js +46 -32
- package/es/Picture/component/DefaultRects/index.less +188 -0
- package/es/Picture/component/DrawRect/index.js +37 -24
- package/es/Picture/component/DrawRect/{index.css → index.less} +0 -0
- package/es/Picture/component/RectMenu/index.js +35 -26
- package/es/Picture/component/RectMenu/index.less +31 -0
- package/es/Picture/component/RectMenu/utils.js +6 -3
- package/es/Picture/component/Tools/index.js +91 -69
- package/es/Picture/component/Tools/index.less +43 -0
- package/es/Picture/component/WheelScale/index.js +9 -4
- package/es/Picture/demo.js +14 -11
- package/es/Picture/dragBound.d.ts +1 -1
- package/es/Picture/dragBound.js +17 -4
- package/es/Picture/index.d.ts +2 -2
- package/es/Picture/index.js +201 -137
- package/es/Picture/index.less +14 -0
- package/es/Picture/loadCaptureRectImage.d.ts +1 -1
- package/es/Picture/loadCaptureRectImage.js +39 -14
- package/es/Picture/useDraw.js +40 -20
- package/es/Picture/utils.d.ts +9 -9
- package/es/Picture/utils.js +18 -3
- package/es/Player/api/index.d.ts +3 -3
- package/es/Player/api/index.js +117 -82
- package/es/Player/context.js +21 -7
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/bar.js +28 -10
- package/es/Player/contraller_bar/contraller_event.js +34 -12
- package/es/Player/contraller_bar/index.js +30 -22
- package/es/Player/contraller_bar/left_bar.js +62 -39
- package/es/Player/contraller_bar/right_bar.js +34 -18
- package/es/Player/contraller_bar/time.js +19 -8
- package/es/Player/contraller_bar/useBarStatus.js +29 -11
- package/es/Player/contraller_bar/volume.js +43 -21
- package/es/Player/demo.d.ts +1 -0
- package/es/Player/demo.js +258 -215
- package/es/Player/event/errorEvent.js +41 -16
- package/es/Player/event/eventName.js +12 -1
- package/es/Player/event/index.js +66 -24
- package/es/Player/fps_play.js +33 -15
- package/es/Player/frontend_player.js +42 -20
- package/es/Player/frontend_timeline.js +95 -55
- package/es/Player/iconfont.js +23 -8
- package/es/Player/index.js +1 -1
- package/es/Player/live_heart.js +15 -3
- package/es/Player/message.js +68 -37
- package/es/Player/segment_player.js +113 -62
- package/es/Player/segment_timeline.js +145 -97
- package/es/Player/single_player.js +153 -111
- package/es/Player/style/bar.less +39 -0
- package/es/Player/style/iconfont.js +17 -10
- package/es/Player/style/index.less +30 -0
- package/es/Player/style/message.less +50 -0
- package/es/Player/style/slider.less +103 -0
- package/es/Player/style/timeline.less +106 -0
- package/es/Player/style/volume.less +21 -0
- package/es/Player/timeline.d.ts +1 -1
- package/es/Player/timeline.js +59 -32
- package/es/Player/util.js +46 -7
- package/es/PlayerExt/demo.d.ts +1 -0
- package/es/PlayerExt/demo.js +145 -112
- package/es/PlayerExt/index.d.ts +1 -1
- package/es/PlayerExt/index.js +135 -82
- package/es/PlayerExt/{index.css → index.less} +0 -0
- package/es/Progress/index.js +18 -5
- package/es/Progress/index.less +20 -0
- package/es/ROI/demo.d.ts +1 -0
- package/es/ROI/demo.js +12 -8
- package/es/ROI/index.js +45 -35
- package/es/ROI/index.less +29 -0
- package/es/ScreenPlayer/Live.d.ts +1 -1
- package/es/ScreenPlayer/Live.js +159 -103
- package/es/ScreenPlayer/LiveTools.js +153 -116
- package/es/ScreenPlayer/PlayerWithExt.js +168 -113
- package/es/ScreenPlayer/RatePick.js +35 -22
- package/es/ScreenPlayer/Record.js +291 -185
- package/es/ScreenPlayer/RecordTools.js +192 -148
- package/es/ScreenPlayer/ScreenSelect.js +33 -26
- package/es/ScreenPlayer/SegmentTimeLine.js +23 -16
- package/es/ScreenPlayer/TimeMode.js +22 -16
- package/es/ScreenPlayer/TimeSelect.js +84 -63
- package/es/ScreenPlayer/demo.js +16 -18
- package/es/ScreenPlayer/demo2.js +192 -177
- package/es/ScreenPlayer/index.d.ts +1 -0
- package/es/ScreenPlayer/index.js +3 -3
- package/es/ScreenPlayer/index.less +178 -0
- package/es/ScreenPlayer/useTimeSlider.js +148 -49
- package/es/ScreenPlayer/useVideoFit.js +18 -5
- package/es/ScreenPlayer/utils.js +6 -0
- package/es/SegmentPlayer/index.js +1 -1
- package/es/Service/fetch-adapter.d.ts +1 -1
- package/es/Service/fetch-adapter.js +48 -5
- package/es/Service/http.js +46 -16
- package/es/Service/index.js +2 -2
- package/es/TableLayout/index.js +18 -12
- package/es/TableLayout/{index.css → index.less} +0 -0
- package/es/ThemeAntd/demo.d.ts +1 -0
- package/es/ThemeAntd/demo.js +126 -76
- package/es/ThemeAntd/{demo.css → demo.less} +4 -3
- package/es/ThemeAntd/index.js +6 -2
- package/es/ThemeAntd/index.less +16 -0
- package/es/ThemeAntd/style/button.less +67 -0
- package/es/ThemeAntd/style/checkbox.less +72 -0
- package/es/ThemeAntd/style/form.less +12 -0
- package/es/ThemeAntd/style/input.less +83 -0
- package/es/ThemeAntd/style/pagination.less +95 -0
- package/es/ThemeAntd/style/picker.less +106 -0
- package/es/ThemeAntd/style/popover.less +5 -0
- package/es/ThemeAntd/style/radio.less +87 -0
- package/es/ThemeAntd/style/{scrollbar.css → scrollbar.less} +4 -2
- package/es/ThemeAntd/style/select.less +81 -0
- package/es/ThemeAntd/style/table.less +57 -0
- package/es/ThemeAntd/style/tree.less +18 -0
- package/es/Timeout/index.js +36 -12
- package/es/Tree/demo.js +26 -21
- package/es/Tree/index.js +51 -30
- package/es/Tree/index.less +59 -0
- package/es/index.js +47 -47
- package/es/useDrawROI/index.js +130 -65
- package/es/useEventEmitterHandle/index.js +6 -2
- package/es/useFullscreen/demo.js +44 -27
- package/es/useFullscreen/index.js +30 -8
- package/es/useHistory/index.js +3 -1
- package/es/useInfiniteScroll/index.js +50 -19
- package/es/useRafInterval/index.js +28 -4
- package/es/useSimpleState/index.js +23 -6
- package/es/useVirtualList/index.js +58 -20
- package/es/utils.d.ts +1 -1
- package/es/utils.js +53 -14
- package/package.json +42 -32
- package/tsconfig.json +8 -32
- package/.eslintrc +0 -4
- package/.fatherrc.js +0 -25
- package/.prettierrc +0 -11
- package/.umirc.ts +0 -55
- package/es/Box/InfoBox/index.css +0 -22
- package/es/Box/TwoColumnBox/index.css +0 -70
- package/es/CheckGroupFixed/index.css +0 -49
- package/es/CustomRenderSelect/index.css +0 -20
- package/es/Drawer/Demo.js +0 -59
- package/es/Drawer/index.css +0 -40
- package/es/FullScreen/index.css +0 -16
- package/es/ImageView/index.css +0 -10
- package/es/Input/index.css +0 -8
- package/es/LabelValue/index.css +0 -18
- package/es/List/DynamicList/index.css +0 -15
- package/es/Map/BasicMap/index.css +0 -24
- package/es/Map/ClusterLayer/index.css +0 -26
- package/es/Map/MapDrawSelect/index.css +0 -0
- package/es/Map/ResetTools/index.css +0 -32
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Hover.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OnLine_Normal.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Hover.svg +0 -15
- package/es/Map/SinglePoint/icon/Place_icon_OutLine_Normal.svg +0 -15
- package/es/Map/SinglePoint/index.css +0 -29
- package/es/Map/useMarker/index.css +0 -0
- package/es/Modal/index.css +0 -43
- package/es/Picture/component/DefaultRects/index.css +0 -247
- package/es/Picture/component/RectMenu/index.css +0 -31
- package/es/Picture/component/Tools/index.css +0 -42
- package/es/Picture/index.css +0 -12
- package/es/Player/style/bar.css +0 -38
- package/es/Player/style/index.css +0 -30
- package/es/Player/style/message.css +0 -49
- package/es/Player/style/slider.css +0 -96
- package/es/Player/style/timeline.css +0 -99
- package/es/Player/style/volume.css +0 -19
- package/es/Progress/index.css +0 -20
- package/es/ROI/index.css +0 -29
- package/es/ScreenPlayer/index.css +0 -166
- package/es/ThemeAntd/index.css +0 -620
- package/es/ThemeAntd/style/button.css +0 -55
- package/es/ThemeAntd/style/checkbox.css +0 -64
- package/es/ThemeAntd/style/form.css +0 -10
- package/es/ThemeAntd/style/input.css +0 -68
- package/es/ThemeAntd/style/pagination.css +0 -82
- package/es/ThemeAntd/style/picker.css +0 -98
- package/es/ThemeAntd/style/popover.css +0 -3
- package/es/ThemeAntd/style/radio.css +0 -80
- package/es/ThemeAntd/style/select.css +0 -76
- package/es/ThemeAntd/style/table.css +0 -46
- package/es/ThemeAntd/style/tree.css +0 -16
- package/es/Tree/index.css +0 -64
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
var Events = {
|
|
2
2
|
RELOAD: 'reload',
|
|
3
|
+
//手动视频重载
|
|
3
4
|
RELOAD_FAIL: 'reloadFail',
|
|
5
|
+
// 视频出错,重连失败
|
|
4
6
|
RELOAD_SUCCESS: 'reloadSuccess',
|
|
7
|
+
//视频出错,重连成功
|
|
5
8
|
ERROR: 'error',
|
|
9
|
+
//视频出错
|
|
6
10
|
ERROR_RELOAD: 'errorRload',
|
|
11
|
+
//视频出错,自动重连
|
|
7
12
|
HISTORY_PLAY_END: 'historyPlayEnd',
|
|
13
|
+
//历史视频列表播放结束
|
|
8
14
|
PLAY_ENDED: 'play_ended',
|
|
15
|
+
//单个片断播放完毕
|
|
9
16
|
SEEK: 'seek',
|
|
17
|
+
//跳跃播放时间
|
|
10
18
|
TRANSFORM: 'transform',
|
|
19
|
+
//视频容器缩放
|
|
11
20
|
CHANGE_PLAY_INDEX: 'changePlayIndex',
|
|
21
|
+
//历史视频列表播放索引改变
|
|
12
22
|
HIDE_CONTRALLER: 'hideContraller',
|
|
13
23
|
SHOW_CONTRALLER: 'showContraller',
|
|
14
24
|
CLEAR_ERROR_TIMER: 'clearErrorTimer',
|
|
15
25
|
CANVAS_PAUSE: 'canvasPause',
|
|
26
|
+
// 逐帧暂停
|
|
16
27
|
CANVAS_PLAY: 'canvasPlay' //逐帧播放
|
|
17
|
-
};
|
|
18
28
|
|
|
29
|
+
};
|
|
19
30
|
export default Events;
|
package/es/Player/event/index.js
CHANGED
|
@@ -1,23 +1,44 @@
|
|
|
1
1
|
import _useLatest from "ahooks/es/useLatest";
|
|
2
2
|
import _nextTick from "@cloud-app-dev/utils/es/nextTick";
|
|
3
|
+
|
|
3
4
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
|
|
4
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."); }
|
|
7
|
+
|
|
5
8
|
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); }
|
|
9
|
+
|
|
6
10
|
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; }
|
|
11
|
+
|
|
7
12
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
13
|
+
|
|
8
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
|
|
9
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
|
|
10
18
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
19
|
+
|
|
11
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
12
24
|
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
13
|
-
import { Context } from
|
|
25
|
+
import { Context } from "../context";
|
|
26
|
+
|
|
14
27
|
var VideoEventInstance = /*#__PURE__*/function () {
|
|
15
28
|
function VideoEventInstance(video) {
|
|
16
29
|
_classCallCheck(this, VideoEventInstance);
|
|
30
|
+
|
|
31
|
+
_defineProperty(this, "video", void 0);
|
|
32
|
+
|
|
33
|
+
_defineProperty(this, "events", void 0);
|
|
34
|
+
|
|
35
|
+
_defineProperty(this, "playerEvents", void 0);
|
|
36
|
+
|
|
17
37
|
this.video = video;
|
|
18
38
|
this.events = {};
|
|
19
39
|
this.playerEvents = {};
|
|
20
40
|
}
|
|
41
|
+
|
|
21
42
|
_createClass(VideoEventInstance, [{
|
|
22
43
|
key: "on",
|
|
23
44
|
value: function on(eventName, handle) {
|
|
@@ -41,6 +62,7 @@ var VideoEventInstance = /*#__PURE__*/function () {
|
|
|
41
62
|
if (!this.playerEvents || !this.playerEvents[eventName]) {
|
|
42
63
|
return;
|
|
43
64
|
}
|
|
65
|
+
|
|
44
66
|
var index = this.playerEvents[eventName].findIndex(function (v) {
|
|
45
67
|
return v === handle;
|
|
46
68
|
});
|
|
@@ -54,9 +76,11 @@ var VideoEventInstance = /*#__PURE__*/function () {
|
|
|
54
76
|
for (var _len = arguments.length, data = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
55
77
|
data[_key - 1] = arguments[_key];
|
|
56
78
|
}
|
|
79
|
+
|
|
57
80
|
if (!this.events || !this.events[eventName]) {
|
|
58
81
|
return;
|
|
59
82
|
}
|
|
83
|
+
|
|
60
84
|
this.events[eventName].listener.forEach(function (v) {
|
|
61
85
|
v.apply(void 0, data);
|
|
62
86
|
});
|
|
@@ -67,6 +91,7 @@ var VideoEventInstance = /*#__PURE__*/function () {
|
|
|
67
91
|
if (!this.events || !this.events.eventName) {
|
|
68
92
|
return;
|
|
69
93
|
}
|
|
94
|
+
|
|
70
95
|
var index = this.events[eventName].listener.findIndex(function (v) {
|
|
71
96
|
return v === handle;
|
|
72
97
|
});
|
|
@@ -76,6 +101,7 @@ var VideoEventInstance = /*#__PURE__*/function () {
|
|
|
76
101
|
key: "destroy",
|
|
77
102
|
value: function destroy() {
|
|
78
103
|
var _this = this;
|
|
104
|
+
|
|
79
105
|
Object.keys(this.playerEvents).forEach(function (key) {
|
|
80
106
|
_this.playerEvents[key].forEach(function (fn) {
|
|
81
107
|
_this.removeEventListener(key, fn);
|
|
@@ -86,18 +112,22 @@ var VideoEventInstance = /*#__PURE__*/function () {
|
|
|
86
112
|
this.video = null;
|
|
87
113
|
}
|
|
88
114
|
}]);
|
|
115
|
+
|
|
89
116
|
return VideoEventInstance;
|
|
90
117
|
}();
|
|
118
|
+
|
|
91
119
|
export function usePlayerEvent(video) {
|
|
92
120
|
var _useState = useState(null),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
121
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
122
|
+
event = _useState2[0],
|
|
123
|
+
setEvent = _useState2[1];
|
|
124
|
+
|
|
96
125
|
useEffect(function () {
|
|
97
126
|
if (!video) {
|
|
98
127
|
console.debug('wait create event...');
|
|
99
128
|
return undefined;
|
|
100
129
|
}
|
|
130
|
+
|
|
101
131
|
var event = new VideoEventInstance(video);
|
|
102
132
|
setEvent(event);
|
|
103
133
|
return function () {
|
|
@@ -111,43 +141,51 @@ export function usePlayerEvent(video) {
|
|
|
111
141
|
export function useVideoEvent(eventName, handle, context) {
|
|
112
142
|
var ctx = useContext(Context);
|
|
113
143
|
var event = useMemo(function () {
|
|
114
|
-
var
|
|
115
|
-
|
|
144
|
+
var _ctx$event;
|
|
145
|
+
|
|
146
|
+
return (_ctx$event = ctx === null || ctx === void 0 ? void 0 : ctx.event) !== null && _ctx$event !== void 0 ? _ctx$event : context;
|
|
116
147
|
}, [context, ctx === null || ctx === void 0 ? void 0 : ctx.event]);
|
|
148
|
+
|
|
117
149
|
var handlerRef = _useLatest(handle);
|
|
150
|
+
|
|
118
151
|
useEffect(function () {
|
|
119
152
|
if (!event) {
|
|
120
153
|
return undefined;
|
|
121
154
|
}
|
|
155
|
+
|
|
122
156
|
var eventListener = function eventListener(event) {
|
|
123
157
|
return handlerRef.current(event);
|
|
124
158
|
};
|
|
159
|
+
|
|
125
160
|
event.addEventListener(eventName, eventListener);
|
|
126
161
|
return function () {
|
|
127
162
|
event.removeEventListener(eventName, eventListener);
|
|
128
|
-
};
|
|
129
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
163
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
164
|
}, [event, eventName]);
|
|
131
165
|
}
|
|
132
166
|
export function useRegisterPlayerEvent(eventName, handle, context) {
|
|
133
167
|
var ctx = useContext(Context);
|
|
134
168
|
var event = useMemo(function () {
|
|
135
|
-
var
|
|
136
|
-
|
|
169
|
+
var _ctx$event2;
|
|
170
|
+
|
|
171
|
+
return (_ctx$event2 = ctx === null || ctx === void 0 ? void 0 : ctx.event) !== null && _ctx$event2 !== void 0 ? _ctx$event2 : context;
|
|
137
172
|
}, [context, ctx === null || ctx === void 0 ? void 0 : ctx.event]);
|
|
173
|
+
|
|
138
174
|
var handlerRef = _useLatest(handle);
|
|
175
|
+
|
|
139
176
|
useEffect(function () {
|
|
140
177
|
if (!event) {
|
|
141
178
|
return undefined;
|
|
142
179
|
}
|
|
180
|
+
|
|
143
181
|
var eventListener = function eventListener(event) {
|
|
144
182
|
return handlerRef.current(event);
|
|
145
183
|
};
|
|
184
|
+
|
|
146
185
|
event.on(eventName, eventListener);
|
|
147
186
|
return function () {
|
|
148
187
|
event.off(eventName, eventListener);
|
|
149
|
-
};
|
|
150
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
188
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
151
189
|
}, [event, eventName]);
|
|
152
190
|
}
|
|
153
191
|
export function useVideoEvents(event, events) {
|
|
@@ -155,21 +193,23 @@ export function useVideoEvents(event, events) {
|
|
|
155
193
|
if (!event || !events) {
|
|
156
194
|
return undefined;
|
|
157
195
|
}
|
|
196
|
+
|
|
158
197
|
events.forEach(function (_ref) {
|
|
159
198
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
160
|
-
|
|
161
|
-
|
|
199
|
+
eventName = _ref2[0],
|
|
200
|
+
handle = _ref2[1];
|
|
201
|
+
|
|
162
202
|
event.addEventListener(eventName, handle);
|
|
163
203
|
});
|
|
164
204
|
return function () {
|
|
165
205
|
events.forEach(function (_ref3) {
|
|
166
206
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
167
|
-
|
|
168
|
-
|
|
207
|
+
eventName = _ref4[0],
|
|
208
|
+
handle = _ref4[1];
|
|
209
|
+
|
|
169
210
|
event.removeEventListener(eventName, handle);
|
|
170
211
|
});
|
|
171
|
-
};
|
|
172
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
212
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
173
213
|
}, [event]);
|
|
174
214
|
}
|
|
175
215
|
export function useRegisterPlayerEvents(event, events) {
|
|
@@ -177,21 +217,23 @@ export function useRegisterPlayerEvents(event, events) {
|
|
|
177
217
|
if (!event || !events) {
|
|
178
218
|
return undefined;
|
|
179
219
|
}
|
|
220
|
+
|
|
180
221
|
events.forEach(function (_ref5) {
|
|
181
222
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
182
|
-
|
|
183
|
-
|
|
223
|
+
eventName = _ref6[0],
|
|
224
|
+
handle = _ref6[1];
|
|
225
|
+
|
|
184
226
|
event.on(eventName, handle);
|
|
185
227
|
});
|
|
186
228
|
return function () {
|
|
187
229
|
events.forEach(function (_ref7) {
|
|
188
230
|
var _ref8 = _slicedToArray(_ref7, 2),
|
|
189
|
-
|
|
190
|
-
|
|
231
|
+
eventName = _ref8[0],
|
|
232
|
+
handle = _ref8[1];
|
|
233
|
+
|
|
191
234
|
event.off(eventName, handle);
|
|
192
235
|
});
|
|
193
|
-
};
|
|
194
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
236
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
195
237
|
}, [event]);
|
|
196
238
|
}
|
|
197
239
|
export default VideoEventInstance;
|
package/es/Player/fps_play.js
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
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
|
+
|
|
3
5
|
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); }
|
|
6
|
+
|
|
4
7
|
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; }
|
|
8
|
+
|
|
5
9
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
|
-
import Events from
|
|
9
|
-
import useRafInterval from
|
|
10
|
-
import { useRegisterPlayerEvent } from
|
|
11
|
-
import { getDomStyleValue } from
|
|
14
|
+
import Events from "./event/eventName";
|
|
15
|
+
import useRafInterval from "../useRafInterval";
|
|
16
|
+
import { useRegisterPlayerEvent } from "./event";
|
|
17
|
+
import { getDomStyleValue } from "./util";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
19
|
var oneFps = 1 / 30;
|
|
20
|
+
|
|
13
21
|
function FPSPlay(_ref) {
|
|
14
22
|
var api = _ref.api,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
event = _ref.event,
|
|
24
|
+
fpsDelay = _ref.fpsDelay,
|
|
25
|
+
fps = _ref.fps;
|
|
26
|
+
|
|
18
27
|
var _useState = useState(Date.now()),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
forceKey = _useState2[0],
|
|
30
|
+
update = _useState2[1];
|
|
31
|
+
|
|
22
32
|
var ref = useRef(null);
|
|
23
33
|
var timerRef = useRef(null);
|
|
24
34
|
var fps_second = useMemo(function () {
|
|
@@ -29,22 +39,28 @@ function FPSPlay(_ref) {
|
|
|
29
39
|
if (!ref.current || !event.video) {
|
|
30
40
|
return;
|
|
31
41
|
}
|
|
42
|
+
|
|
32
43
|
var video = event.video;
|
|
33
44
|
var fpsTime = api.getCurrentTime() + fps_second;
|
|
34
45
|
video.currentTime = fpsTime;
|
|
46
|
+
|
|
35
47
|
if (video.currentTime >= api.getDuration()) {
|
|
36
48
|
clearInterval(timerRef.current);
|
|
37
49
|
video.currentTime = 0;
|
|
38
50
|
event.emit(Events.PLAY_ENDED);
|
|
39
51
|
}
|
|
52
|
+
|
|
40
53
|
var canvas = ref.current;
|
|
41
54
|
var ctx = canvas.getContext('2d');
|
|
55
|
+
|
|
42
56
|
var _video$getBoundingCli = video.getBoundingClientRect(),
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
width = _video$getBoundingCli.width,
|
|
58
|
+
height = _video$getBoundingCli.height;
|
|
59
|
+
|
|
45
60
|
canvas.width = width;
|
|
46
61
|
canvas.height = height;
|
|
47
62
|
var fit = getDomStyleValue(video, 'object-fit');
|
|
63
|
+
|
|
48
64
|
if (fit === 'fill') {
|
|
49
65
|
//全画面绘制,存在拉伸
|
|
50
66
|
ctx.drawImage(video, 0, 0, width, height);
|
|
@@ -58,6 +74,7 @@ function FPSPlay(_ref) {
|
|
|
58
74
|
ctx.drawImage(video, paddingSize, 0, s_vw, height);
|
|
59
75
|
}
|
|
60
76
|
};
|
|
77
|
+
|
|
61
78
|
fpsCapture();
|
|
62
79
|
timerRef.current = setInterval(fpsCapture, fpsDelay);
|
|
63
80
|
return function () {
|
|
@@ -69,14 +86,15 @@ function FPSPlay(_ref) {
|
|
|
69
86
|
});
|
|
70
87
|
useRegisterPlayerEvent(Events.CANVAS_PLAY, function () {
|
|
71
88
|
update(Date.now());
|
|
72
|
-
});
|
|
73
|
-
|
|
89
|
+
}); // TODO: 未知情况,video会自动播放,轮训检测并暂停零时解决
|
|
90
|
+
|
|
74
91
|
useRafInterval(function () {
|
|
75
92
|
return !api.paused ? api.pause() : null;
|
|
76
93
|
}, 10);
|
|
77
|
-
return /*#__PURE__*/
|
|
94
|
+
return /*#__PURE__*/_jsx("canvas", {
|
|
78
95
|
className: "fps-play-canvas",
|
|
79
96
|
ref: ref
|
|
80
97
|
});
|
|
81
98
|
}
|
|
99
|
+
|
|
82
100
|
export default FPSPlay;
|
|
@@ -1,58 +1,80 @@
|
|
|
1
1
|
import _useMemoizedFn from "ahooks/es/useMemoizedFn";
|
|
2
2
|
import _useUpdate from "ahooks/es/useUpdate";
|
|
3
|
-
|
|
3
|
+
var _excluded = ["url", "begin", "end", "onSeek", "forwordRef", "customTimeLine", "onCanPlayerInit"];
|
|
4
|
+
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
4
15
|
import React, { useMemo, useRef } from 'react';
|
|
5
|
-
import SinglePlayer from
|
|
6
|
-
import FrontendTimeLine from
|
|
7
|
-
import Events from
|
|
16
|
+
import SinglePlayer from "./single_player";
|
|
17
|
+
import FrontendTimeLine from "./frontend_timeline";
|
|
18
|
+
import Events from "./event/eventName";
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
|
+
|
|
8
22
|
/**
|
|
9
23
|
* @desc 主组件,负责片段整体逻辑控制
|
|
10
24
|
* @return JSX.Element
|
|
11
25
|
*/
|
|
12
|
-
function FrontendPlayer(
|
|
13
|
-
var url =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
function FrontendPlayer(_ref) {
|
|
27
|
+
var url = _ref.url,
|
|
28
|
+
begin = _ref.begin,
|
|
29
|
+
end = _ref.end,
|
|
30
|
+
onSeek = _ref.onSeek,
|
|
31
|
+
forwordRef = _ref.forwordRef,
|
|
32
|
+
customTimeLine = _ref.customTimeLine,
|
|
33
|
+
onCanPlayerInit = _ref.onCanPlayerInit,
|
|
34
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
|
|
21
36
|
var update = _useUpdate();
|
|
37
|
+
|
|
22
38
|
var ref = useRef(null);
|
|
23
39
|
var playRef = forwordRef ? forwordRef : ref;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
40
|
+
|
|
41
|
+
var _ref2 = playRef.current || {},
|
|
42
|
+
api = _ref2.api,
|
|
43
|
+
event = _ref2.event; // 转换毫秒
|
|
44
|
+
|
|
45
|
+
|
|
28
46
|
var duration = useMemo(function () {
|
|
29
47
|
return (end - begin) / 1000;
|
|
30
48
|
}, [begin, end]); //单位s 秒
|
|
31
49
|
// 重置reload
|
|
50
|
+
|
|
32
51
|
var reload = _useMemoizedFn(function () {
|
|
33
52
|
playRef.current.event.emit(Events.RELOAD);
|
|
34
53
|
onSeek === null || onSeek === void 0 ? void 0 : onSeek(begin);
|
|
35
54
|
playRef.current.api.reload();
|
|
36
55
|
});
|
|
56
|
+
|
|
37
57
|
var onInit = _useMemoizedFn(function () {
|
|
38
58
|
update();
|
|
39
59
|
onCanPlayerInit === null || onCanPlayerInit === void 0 ? void 0 : onCanPlayerInit();
|
|
40
60
|
});
|
|
61
|
+
|
|
41
62
|
var hasReady = api && event;
|
|
42
|
-
var timeline = customTimeLine !== null && customTimeLine !== void 0 ? customTimeLine : /*#__PURE__*/
|
|
63
|
+
var timeline = customTimeLine !== null && customTimeLine !== void 0 ? customTimeLine : /*#__PURE__*/_jsx(FrontendTimeLine, {
|
|
43
64
|
end: end,
|
|
44
65
|
onSeek: onSeek,
|
|
45
66
|
begin: begin,
|
|
46
67
|
duration: duration
|
|
47
68
|
});
|
|
48
|
-
return /*#__PURE__*/
|
|
69
|
+
return /*#__PURE__*/_jsx(SinglePlayer, _objectSpread({
|
|
49
70
|
ref: playRef,
|
|
50
71
|
url: url,
|
|
51
72
|
reload: reload,
|
|
52
73
|
onCanPlayerInit: onInit,
|
|
53
74
|
isLive: false,
|
|
54
75
|
type: "flv",
|
|
55
|
-
customTimeLine: hasReady ? timeline : /*#__PURE__*/
|
|
76
|
+
customTimeLine: hasReady ? timeline : /*#__PURE__*/_jsx(_Fragment, {})
|
|
56
77
|
}, props));
|
|
57
78
|
}
|
|
79
|
+
|
|
58
80
|
export default FrontendPlayer;
|