@cloud-app-dev/vidc 3.2.10 → 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 +202 -139
- 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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.lm-player-message-mask {
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0;
|
|
4
|
+
top: 0;
|
|
5
|
+
z-index: -1;
|
|
6
|
+
background: transparent;
|
|
7
|
+
opacity: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
transition: all 0.5s;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
&.lm-player-mask-loading-animation {
|
|
17
|
+
opacity: 1;
|
|
18
|
+
background: rgba(0, 0, 0, 0.6);
|
|
19
|
+
z-index: 1;
|
|
20
|
+
}
|
|
21
|
+
.lm-player-loading-icon {
|
|
22
|
+
position: relative;
|
|
23
|
+
font-size: 48px;
|
|
24
|
+
z-index: -1;
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
&.lm-player-loading-animation {
|
|
27
|
+
visibility: visible;
|
|
28
|
+
z-index: 9;
|
|
29
|
+
animation: loadingAnimation 1s linear infinite;
|
|
30
|
+
}
|
|
31
|
+
&.lm-player-loadfail {
|
|
32
|
+
visibility: visible;
|
|
33
|
+
z-index: 9;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.lm-player-message {
|
|
37
|
+
color: #fff;
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
padding: 10px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes loadingAnimation {
|
|
44
|
+
form {
|
|
45
|
+
transform: rotate(0deg);
|
|
46
|
+
}
|
|
47
|
+
to {
|
|
48
|
+
transform: rotate(360deg);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
.slider-layout {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
user-select: none;
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
position: relative;
|
|
9
|
+
.slider-content {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 2px;
|
|
12
|
+
position: relative;
|
|
13
|
+
transition: height 0.2s;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
}
|
|
17
|
+
.slider-other-content {
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 2px;
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 0;
|
|
22
|
+
top: 50%;
|
|
23
|
+
transform: translateY(-50%);
|
|
24
|
+
transition: height 0.2s;
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
z-index: 9;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.slider-max-line {
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
background-color: #000;
|
|
34
|
+
position: absolute;
|
|
35
|
+
left: 0;
|
|
36
|
+
top: 0;
|
|
37
|
+
z-index: 1;
|
|
38
|
+
border-radius: 4px;
|
|
39
|
+
}
|
|
40
|
+
.slider-visibel-line {
|
|
41
|
+
position: absolute;
|
|
42
|
+
height: 100%;
|
|
43
|
+
background: #5b7eac;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
left: 0;
|
|
47
|
+
top: 0;
|
|
48
|
+
z-index: 3;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
border-radius: 4px;
|
|
51
|
+
}
|
|
52
|
+
.slider-current-line {
|
|
53
|
+
position: absolute;
|
|
54
|
+
height: 100%;
|
|
55
|
+
background-color: #ffaa00;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
left: 0;
|
|
59
|
+
top: 0;
|
|
60
|
+
z-index: 3;
|
|
61
|
+
border-radius: 4px;
|
|
62
|
+
}
|
|
63
|
+
.drag-change-icon {
|
|
64
|
+
position: absolute;
|
|
65
|
+
width: 6px;
|
|
66
|
+
height: 6px;
|
|
67
|
+
border-radius: 50%;
|
|
68
|
+
margin-left: -3px;
|
|
69
|
+
border: 1px solid #fff;
|
|
70
|
+
background-color: #ffaa00;
|
|
71
|
+
top: -3px;
|
|
72
|
+
pointer-events: all;
|
|
73
|
+
box-sizing: content-box;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&:hover {
|
|
77
|
+
.slider-content,
|
|
78
|
+
.slider-other-content {
|
|
79
|
+
height: 4px;
|
|
80
|
+
}
|
|
81
|
+
.drag-change-icon {
|
|
82
|
+
width: 10px;
|
|
83
|
+
height: 10px;
|
|
84
|
+
top: -4px;
|
|
85
|
+
margin-left: -5px;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.lm-player-slide-tips {
|
|
91
|
+
background: rgba(0, 0, 0, 0.6);
|
|
92
|
+
position: absolute;
|
|
93
|
+
left: 0;
|
|
94
|
+
top: -26px;
|
|
95
|
+
transform: translate(-50%,-100%);
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
color: #fff;
|
|
98
|
+
border-radius: 4px;
|
|
99
|
+
z-index: 6;
|
|
100
|
+
padding: 2px 4px;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
z-index: 99;
|
|
103
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
.player-timeline-layout {
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0;
|
|
4
|
+
bottom: 28px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 20px;
|
|
7
|
+
background: rgba(0, 0, 0, 1);
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
z-index: 9;
|
|
12
|
+
opacity: 0.8;
|
|
13
|
+
transition: all 0.1s;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
&.hide-time-line {
|
|
16
|
+
bottom: 0;
|
|
17
|
+
height: 4px;
|
|
18
|
+
}
|
|
19
|
+
.buffer-line {
|
|
20
|
+
position: absolute;
|
|
21
|
+
left: 0;
|
|
22
|
+
top: 0;
|
|
23
|
+
height: 100%;
|
|
24
|
+
background-color: rgb(103, 103, 103);
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
max-width: 100%;
|
|
27
|
+
}
|
|
28
|
+
.current-line {
|
|
29
|
+
position: absolute;
|
|
30
|
+
left: 0;
|
|
31
|
+
top: 0;
|
|
32
|
+
height: 100%;
|
|
33
|
+
background-color: rgba(70, 97, 255, 1);
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.player-segment-timeline-layout {
|
|
40
|
+
background: transparent;
|
|
41
|
+
.segment-line-box {
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
.segment-line-item {
|
|
46
|
+
background: rgba(0, 0, 0, 1);
|
|
47
|
+
position: relative;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
&:hover {
|
|
50
|
+
&::after {
|
|
51
|
+
content: ' ';
|
|
52
|
+
width: 100%;
|
|
53
|
+
height: 100%;
|
|
54
|
+
left: 0;
|
|
55
|
+
top: 0;
|
|
56
|
+
border: 1px solid #fff;
|
|
57
|
+
z-index: 6;
|
|
58
|
+
position: absolute;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
&.segment-line-item-none {
|
|
62
|
+
background: rgba(222, 14, 14, 1);
|
|
63
|
+
z-index: 6;
|
|
64
|
+
cursor: not-allowed;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.segment-line-mark {
|
|
69
|
+
position: absolute;
|
|
70
|
+
height: 100%;
|
|
71
|
+
width: 2px;
|
|
72
|
+
background-color: #fff;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.frontend-player-timeline-layout {
|
|
78
|
+
.frontend-line-mark {
|
|
79
|
+
position: absolute;
|
|
80
|
+
height: 100%;
|
|
81
|
+
width: 2px;
|
|
82
|
+
background-color: #fff;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
.frontend-line-tip-box {
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: -130px;
|
|
88
|
+
color: #fff;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
border-radius: 3px;
|
|
91
|
+
background-color: rgb(0, 0, 0, 0.65);
|
|
92
|
+
padding: 10px;
|
|
93
|
+
width: max-content;
|
|
94
|
+
line-height: 20px;
|
|
95
|
+
margin-left: -81px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.segment-line-tip-box {
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
div {
|
|
103
|
+
margin: 0;
|
|
104
|
+
padding: 2px 0;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.lm-player-volume-popup {
|
|
2
|
+
.cloudapp-tooltip-inner {
|
|
3
|
+
height: 130px;
|
|
4
|
+
width: 30px;
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
text-align: center;
|
|
8
|
+
padding: 12px 6px;
|
|
9
|
+
border-radius: 15px;
|
|
10
|
+
}
|
|
11
|
+
.cloudapp-slider-vertical {
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
.cloudapp-slider-track {
|
|
15
|
+
background-color: var(--primary);
|
|
16
|
+
}
|
|
17
|
+
.cloudapp-slider-handle {
|
|
18
|
+
background-color: var(--primary);
|
|
19
|
+
border-color: var(--gray1);
|
|
20
|
+
}
|
|
21
|
+
}
|
package/es/Player/timeline.d.ts
CHANGED
package/es/Player/timeline.js
CHANGED
|
@@ -1,43 +1,62 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
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; }
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
|
|
2
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
|
+
|
|
3
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
|
+
|
|
4
13
|
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; }
|
|
14
|
+
|
|
5
15
|
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; }
|
|
16
|
+
|
|
6
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
+
|
|
7
19
|
import React, { useContext, useMemo, useState } from 'react';
|
|
8
|
-
import useBarStatus from
|
|
9
|
-
import { useVideoEvent } from
|
|
10
|
-
import { Context } from
|
|
11
|
-
import "./style/timeline.
|
|
20
|
+
import useBarStatus from "./contraller_bar/useBarStatus";
|
|
21
|
+
import { useVideoEvent } from "./event";
|
|
22
|
+
import { Context } from "./context";
|
|
23
|
+
import "./style/timeline.less";
|
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
26
|
export function useTimes() {
|
|
13
27
|
var _useContext = useContext(Context),
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
api = _useContext.api,
|
|
29
|
+
isFpsPlay = _useContext.isFpsPlay;
|
|
30
|
+
|
|
16
31
|
var _useState = useState({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
32
|
+
currentTime: 0,
|
|
33
|
+
buffered: 0
|
|
34
|
+
}),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
state = _useState2[0],
|
|
37
|
+
setState = _useState2[1];
|
|
38
|
+
|
|
23
39
|
var getCurrentTime = function getCurrentTime() {
|
|
24
40
|
return setState(function (old) {
|
|
25
|
-
return
|
|
41
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
26
42
|
currentTime: api.getCurrentTime(),
|
|
27
43
|
buffered: api.getSecondsLoaded()
|
|
28
44
|
});
|
|
29
45
|
});
|
|
30
46
|
};
|
|
47
|
+
|
|
31
48
|
var getBuffered = function getBuffered() {
|
|
32
49
|
return setState(function (old) {
|
|
33
|
-
return
|
|
50
|
+
return _objectSpread(_objectSpread({}, old), {}, {
|
|
34
51
|
buffered: api.getSecondsLoaded()
|
|
35
52
|
});
|
|
36
53
|
});
|
|
37
54
|
};
|
|
55
|
+
|
|
38
56
|
var seekendPlay = function seekendPlay() {
|
|
39
57
|
return !isFpsPlay && api.play();
|
|
40
58
|
};
|
|
59
|
+
|
|
41
60
|
useVideoEvent('timeupdate', getCurrentTime);
|
|
42
61
|
useVideoEvent('progress', getBuffered);
|
|
43
62
|
useVideoEvent('suspend', getBuffered);
|
|
@@ -46,40 +65,48 @@ export function useTimes() {
|
|
|
46
65
|
return [state.currentTime, state.buffered, api.getDuration()];
|
|
47
66
|
}, [state.currentTime, state.buffered, api]);
|
|
48
67
|
}
|
|
68
|
+
|
|
49
69
|
function TimeLine() {
|
|
50
70
|
var _useContext2 = useContext(Context),
|
|
51
|
-
|
|
71
|
+
api = _useContext2.api;
|
|
72
|
+
|
|
52
73
|
var status = useBarStatus();
|
|
74
|
+
|
|
53
75
|
var _useTimes = useTimes(),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
76
|
+
_useTimes2 = _slicedToArray(_useTimes, 3),
|
|
77
|
+
currentTime = _useTimes2[0],
|
|
78
|
+
buffered = _useTimes2[1],
|
|
79
|
+
duration = _useTimes2[2];
|
|
80
|
+
|
|
58
81
|
var playPercent = useMemo(function () {
|
|
59
82
|
return currentTime / duration * 100;
|
|
60
83
|
}, [currentTime, duration]);
|
|
61
84
|
var bufferedPercent = useMemo(function () {
|
|
62
85
|
return buffered / duration * 100;
|
|
63
86
|
}, [buffered, duration]);
|
|
87
|
+
|
|
64
88
|
var seekWithLine = function seekWithLine(e) {
|
|
65
89
|
var rect = e.currentTarget.getBoundingClientRect();
|
|
66
90
|
var current = e.pageX - rect.left;
|
|
67
91
|
var cTime = current / rect.width * api.getDuration();
|
|
68
92
|
api.seekTo(cTime);
|
|
69
93
|
};
|
|
70
|
-
|
|
94
|
+
|
|
95
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
71
96
|
className: "player-timeline-layout ".concat(status === 0 ? 'hide-time-line' : ''),
|
|
72
|
-
onClick: seekWithLine
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
97
|
+
onClick: seekWithLine,
|
|
98
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
99
|
+
className: "buffer-line",
|
|
100
|
+
style: {
|
|
101
|
+
width: "".concat(bufferedPercent, "%")
|
|
102
|
+
}
|
|
103
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
104
|
+
className: "current-line",
|
|
105
|
+
style: {
|
|
106
|
+
width: "".concat(playPercent, "%")
|
|
107
|
+
}
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
84
110
|
}
|
|
111
|
+
|
|
85
112
|
export default TimeLine;
|
package/es/Player/util.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
|
|
2
3
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
-
|
|
4
|
+
|
|
5
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
+
|
|
7
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
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; }
|
|
14
|
+
|
|
4
15
|
import Flvjs from '@cloud-app-dev/flv.js';
|
|
5
16
|
import Hls from 'hls.js';
|
|
6
|
-
import Events from
|
|
17
|
+
import Events from "./event/eventName";
|
|
18
|
+
|
|
7
19
|
/**
|
|
8
20
|
* 创建HLS对象
|
|
9
21
|
* @param {*} video
|
|
@@ -13,7 +25,8 @@ export function createHlsPlayer(video, url, isLive, hlsConfig) {
|
|
|
13
25
|
if (!Hls.isSupported()) {
|
|
14
26
|
return undefined;
|
|
15
27
|
}
|
|
16
|
-
|
|
28
|
+
|
|
29
|
+
var player = new Hls(_objectSpread({
|
|
17
30
|
liveDurationInfinity: isLive,
|
|
18
31
|
enableWorker: true
|
|
19
32
|
}, hlsConfig));
|
|
@@ -26,22 +39,27 @@ export function createHlsPlayer(video, url, isLive, hlsConfig) {
|
|
|
26
39
|
* @param {*} video
|
|
27
40
|
* @param {*} options
|
|
28
41
|
*/
|
|
42
|
+
|
|
29
43
|
export function createFlvPlayer(video, url, isLive, flvConfig) {
|
|
30
44
|
if (!Flvjs.isSupported()) {
|
|
31
45
|
return undefined;
|
|
32
46
|
}
|
|
47
|
+
|
|
33
48
|
Flvjs.LoggingControl.enableDebug = false;
|
|
34
49
|
Flvjs.LoggingControl.enableVerbose = false;
|
|
35
50
|
Flvjs.LoggingControl.enableWarn = false;
|
|
36
|
-
|
|
51
|
+
|
|
52
|
+
var mediaDataSource = _objectSpread({
|
|
37
53
|
type: 'flv',
|
|
38
54
|
url: url
|
|
39
55
|
}, flvConfig.mediaDataSource);
|
|
40
|
-
|
|
56
|
+
|
|
57
|
+
var config = _objectSpread({
|
|
41
58
|
enableWorker: true,
|
|
42
59
|
isLive: isLive !== null && isLive !== void 0 ? isLive : true,
|
|
43
60
|
enableStashBuffer: !isLive
|
|
44
61
|
}, flvConfig.config);
|
|
62
|
+
|
|
45
63
|
var player = Flvjs.createPlayer(mediaDataSource, config);
|
|
46
64
|
player.attachMediaElement(video);
|
|
47
65
|
player.load();
|
|
@@ -49,12 +67,14 @@ export function createFlvPlayer(video, url, isLive, flvConfig) {
|
|
|
49
67
|
}
|
|
50
68
|
export var playReload = function playReload(video, event, flv, hls, url) {
|
|
51
69
|
playUnload(video, flv, hls);
|
|
70
|
+
|
|
52
71
|
if (flv) {
|
|
53
72
|
tryCatch(function () {
|
|
54
73
|
flv.load();
|
|
55
74
|
flv.play();
|
|
56
75
|
});
|
|
57
76
|
}
|
|
77
|
+
|
|
58
78
|
if (hls) {
|
|
59
79
|
tryCatch(function () {
|
|
60
80
|
hls.swapAudioCodec();
|
|
@@ -64,34 +84,41 @@ export var playReload = function playReload(video, event, flv, hls, url) {
|
|
|
64
84
|
video.play();
|
|
65
85
|
});
|
|
66
86
|
}
|
|
87
|
+
|
|
67
88
|
if (!flv && !hls) {
|
|
68
89
|
video.setAttribute('src', url);
|
|
69
90
|
tryCatch(function () {
|
|
70
91
|
return video.play();
|
|
71
92
|
});
|
|
72
93
|
}
|
|
94
|
+
|
|
73
95
|
event.emit(Events.RELOAD);
|
|
74
96
|
};
|
|
75
97
|
export var playUnload = function playUnload(video, flv, hls) {
|
|
76
98
|
video.pause();
|
|
99
|
+
|
|
77
100
|
if (flv) {
|
|
78
101
|
flv.unload();
|
|
79
102
|
return;
|
|
80
103
|
}
|
|
104
|
+
|
|
81
105
|
if (hls) {
|
|
82
106
|
hls.stopLoad();
|
|
83
107
|
return;
|
|
84
108
|
}
|
|
109
|
+
|
|
85
110
|
video.removeAttribute('src');
|
|
86
111
|
};
|
|
87
112
|
/**
|
|
88
113
|
* 获取播放文件类型
|
|
89
114
|
* @param {*} url
|
|
90
115
|
*/
|
|
116
|
+
|
|
91
117
|
export function getVideoType(url) {
|
|
92
118
|
if (!url) {
|
|
93
119
|
return 'native';
|
|
94
120
|
}
|
|
121
|
+
|
|
95
122
|
return url.indexOf('.flv') > -1 ? 'flv' : url.indexOf('.m3u8') > -1 ? 'hls' : 'native';
|
|
96
123
|
}
|
|
97
124
|
export function timeStamp(second) {
|
|
@@ -99,16 +126,22 @@ export function timeStamp(second) {
|
|
|
99
126
|
var h = Math.round(second / 60 / 60 % 24);
|
|
100
127
|
var m = Math.round(second / 60 % 60);
|
|
101
128
|
var s = Math.round(second % 60);
|
|
129
|
+
|
|
102
130
|
if (h === 0) {
|
|
103
131
|
return "".concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
|
|
104
132
|
}
|
|
133
|
+
|
|
105
134
|
return "".concat(h < 10 ? '0' + h : h, ":").concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
|
|
106
135
|
}
|
|
107
136
|
export function getRandom() {
|
|
108
137
|
return Math.random().toString(36).substr(2);
|
|
109
138
|
}
|
|
110
|
-
export function tryCatch(
|
|
111
|
-
return
|
|
139
|
+
export function tryCatch(_x) {
|
|
140
|
+
return _tryCatch.apply(this, arguments);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function _tryCatch() {
|
|
144
|
+
_tryCatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fn) {
|
|
112
145
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
113
146
|
while (1) {
|
|
114
147
|
switch (_context.prev = _context.next) {
|
|
@@ -116,12 +149,15 @@ export function tryCatch(fn) {
|
|
|
116
149
|
_context.prev = 0;
|
|
117
150
|
_context.next = 3;
|
|
118
151
|
return fn();
|
|
152
|
+
|
|
119
153
|
case 3:
|
|
120
154
|
_context.next = 7;
|
|
121
155
|
break;
|
|
156
|
+
|
|
122
157
|
case 5:
|
|
123
158
|
_context.prev = 5;
|
|
124
159
|
_context.t0 = _context["catch"](0);
|
|
160
|
+
|
|
125
161
|
case 7:
|
|
126
162
|
case "end":
|
|
127
163
|
return _context.stop();
|
|
@@ -129,11 +165,14 @@ export function tryCatch(fn) {
|
|
|
129
165
|
}
|
|
130
166
|
}, _callee, null, [[0, 5]]);
|
|
131
167
|
}));
|
|
168
|
+
return _tryCatch.apply(this, arguments);
|
|
132
169
|
}
|
|
170
|
+
|
|
133
171
|
export var FMT = 'YYYY-MM-DD HH:mm:ss';
|
|
134
172
|
export function getDomStyleValue(dom, styleKey) {
|
|
135
173
|
if (!dom) {
|
|
136
174
|
return '';
|
|
137
175
|
}
|
|
176
|
+
|
|
138
177
|
return window.getComputedStyle(dom).getPropertyValue(styleKey);
|
|
139
178
|
}
|
package/es/PlayerExt/demo.d.ts
CHANGED