@cloud-app-dev/vidc 4.0.15 → 4.1.0
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/.dumirc.ts +2 -18
- package/.eslintrc.js +3 -0
- package/.fatherrc.ts +0 -7
- package/es/AppContext/Sync.d.ts +1 -2
- package/es/AppContext/index.d.ts +10 -3
- package/es/AppContext/index.js +14 -4
- package/es/AppContext/interface.d.ts +1 -0
- package/es/CheckGroupFixed/demo.d.ts +1 -2
- package/es/CheckGroupFixed/demo.js +7 -12
- package/es/CheckGroupFixed/index.d.ts +7 -3
- package/es/CheckGroupFixed/index.js +9 -9
- package/es/CheckGroupFixed/style.d.ts +6 -0
- package/es/CheckGroupFixed/style.js +9 -0
- package/es/Config/index.js +1 -1
- package/es/CustomRenderSelect/index.d.ts +3 -2
- package/es/CustomRenderSelect/index.js +13 -10
- package/es/DBTools/index.js +1 -2
- package/es/DisableMark/index.d.ts +1 -2
- package/es/DisableMark/index.js +5 -2
- package/es/DomMove/demo.d.ts +1 -2
- package/es/DomMove/demo.js +0 -1
- package/es/DomMove/index.js +7 -8
- package/es/DynamicGridList/demo.d.ts +2 -0
- package/es/DynamicGridList/index.d.ts +1 -1
- package/es/DynamicGridList/index.js +3 -3
- package/es/DynamicList/demo.d.ts +1 -2
- package/es/DynamicList/demo.js +14 -19
- package/es/DynamicList/index.d.ts +1 -2
- package/es/DynamicList/index.js +10 -8
- package/es/ErrorFallback/index.d.ts +1 -2
- package/es/EventTools/index.d.ts +1 -1
- package/es/GridList/demo.d.ts +2 -0
- package/es/GridList/{Demo.js → demo.js} +1 -1
- package/es/GridList/hook.js +2 -2
- package/es/GridList/index.d.ts +0 -1
- package/es/GridList/index.js +5 -2
- package/es/HightLevel/index.d.ts +1 -2
- package/es/HightLevel/index.js +2 -3
- package/es/IconFont/index.d.ts +1 -1
- package/es/LabelValue/index.d.ts +1 -2
- package/es/LabelValue/index.js +5 -2
- package/es/List/demo.d.ts +1 -2
- package/es/List/demo.js +1 -2
- package/es/List/index.d.ts +2 -3
- package/es/List/index.js +25 -17
- package/es/ListWithSizeAnimate/demo.d.ts +1 -2
- package/es/ListWithSizeAnimate/index.d.ts +0 -1
- package/es/ListWithSizeAnimate/index.js +19 -10
- package/es/LoaderScript/index.d.ts +1 -1
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -2
- package/es/Picture/component/DefaultRects/RectInfo.js +6 -4
- package/es/Picture/component/DefaultRects/index.d.ts +1 -3
- package/es/Picture/component/DefaultRects/index.js +5 -5
- package/es/Picture/component/DefaultRects/style.d.ts +10 -0
- package/es/Picture/component/DefaultRects/style.js +28 -0
- package/es/Picture/component/DrawRect/index.d.ts +1 -3
- package/es/Picture/component/DrawRect/index.js +6 -3
- package/es/Picture/component/RectMenu/index.d.ts +1 -3
- package/es/Picture/component/RectMenu/index.js +13 -8
- package/es/Picture/component/Tools/index.d.ts +1 -2
- package/es/Picture/component/Tools/index.js +21 -9
- package/es/Picture/component/Tools/style.d.ts +2 -0
- package/es/Picture/component/Tools/style.js +5 -0
- package/es/Picture/component/WheelScale/index.d.ts +1 -2
- package/es/Picture/demo.d.ts +1 -2
- package/es/Picture/demo.js +1 -1
- package/es/Picture/index.d.ts +1 -3
- package/es/Picture/index.js +21 -19
- package/es/Picture/useDraw.js +4 -4
- package/es/Player/api/index.d.ts +1 -1
- package/es/Player/api/index.js +44 -18
- package/es/Player/context.d.ts +1 -1
- package/es/Player/contraller_bar/bar.d.ts +1 -1
- package/es/Player/contraller_bar/bar.js +5 -1
- package/es/Player/contraller_bar/contraller_event.d.ts +1 -1
- package/es/Player/contraller_bar/contraller_event.js +4 -5
- package/es/Player/contraller_bar/index.d.ts +1 -2
- package/es/Player/contraller_bar/index.js +8 -2
- package/es/Player/contraller_bar/left_bar.d.ts +1 -1
- package/es/Player/contraller_bar/left_bar.js +12 -3
- package/es/Player/contraller_bar/right_bar.d.ts +1 -1
- package/es/Player/contraller_bar/right_bar.js +1 -2
- package/es/Player/contraller_bar/time.d.ts +1 -2
- package/es/Player/contraller_bar/time.js +5 -2
- package/es/Player/contraller_bar/volume.d.ts +1 -2
- package/es/Player/contraller_bar/volume.js +11 -6
- package/es/Player/demo.d.ts +1 -2
- package/es/Player/demo.js +41 -29
- package/es/Player/empty.d.ts +1 -2
- package/es/Player/empty.js +0 -1
- package/es/Player/event/index.d.ts +1 -1
- package/es/Player/event/index.js +4 -3
- package/es/Player/fps_play.d.ts +1 -2
- package/es/Player/fps_play.js +6 -2
- package/es/Player/frontend_player.d.ts +1 -2
- package/es/Player/frontend_player.js +4 -5
- package/es/Player/frontend_timeline.d.ts +1 -3
- package/es/Player/frontend_timeline.js +16 -8
- package/es/Player/iconfont.d.ts +1 -2
- package/es/Player/iconfont.js +1 -2
- package/es/Player/live_heart.js +8 -9
- package/es/Player/message.d.ts +2 -4
- package/es/Player/message.js +16 -7
- package/es/Player/player.d.ts +2 -0
- package/es/Player/segment_player.d.ts +1 -2
- package/es/Player/segment_player.js +4 -5
- package/es/Player/segment_timeline.d.ts +1 -3
- package/es/Player/segment_timeline.js +19 -9
- package/es/Player/single_player.d.ts +0 -1
- package/es/Player/single_player.js +18 -15
- package/es/Player/timeline.d.ts +5 -3
- package/es/Player/timeline.js +10 -4
- package/es/Player/util.d.ts +2 -2
- package/es/Player/util.js +2 -2
- package/es/PlayerExt/demo.d.ts +1 -2
- package/es/PlayerExt/demo.js +3 -3
- package/es/PlayerExt/index.d.ts +1 -2
- package/es/PlayerExt/index.js +10 -5
- package/es/Progress/index.d.ts +1 -3
- package/es/Progress/index.js +7 -3
- package/es/ROI/demo.d.ts +1 -2
- package/es/ROI/demo.js +1 -2
- package/es/ROI/index.d.ts +1 -2
- package/es/ROI/index.js +17 -7
- package/es/RefDrawer/Footer.d.ts +1 -1
- package/es/RefDrawer/index.d.ts +1 -1
- package/es/RefDrawer/index.js +2 -2
- package/es/RefModal/demo.d.ts +1 -2
- package/es/RefModal/index.d.ts +1 -1
- package/es/RefModal/index.js +2 -2
- package/es/ScreenPlayer/Live.d.ts +1 -3
- package/es/ScreenPlayer/Live.js +10 -11
- package/es/ScreenPlayer/LiveTools.d.ts +5 -1
- package/es/ScreenPlayer/LiveTools.js +14 -9
- package/es/ScreenPlayer/PlayerWithExt.d.ts +3 -3
- package/es/ScreenPlayer/PlayerWithExt.js +14 -13
- package/es/ScreenPlayer/RatePick.d.ts +1 -2
- package/es/ScreenPlayer/RatePick.js +9 -4
- package/es/ScreenPlayer/Record.d.ts +1 -3
- package/es/ScreenPlayer/Record.js +27 -22
- package/es/ScreenPlayer/RecordTools.d.ts +1 -1
- package/es/ScreenPlayer/RecordTools.js +11 -13
- package/es/ScreenPlayer/ScreenSelect.d.ts +1 -2
- package/es/ScreenPlayer/ScreenSelect.js +11 -3
- package/es/ScreenPlayer/SegmentTimeLine.d.ts +1 -2
- package/es/ScreenPlayer/SegmentTimeLine.js +12 -6
- package/es/ScreenPlayer/TimeMode.d.ts +1 -2
- package/es/ScreenPlayer/TimeMode.js +7 -3
- package/es/ScreenPlayer/TimeSelect.d.ts +1 -2
- package/es/ScreenPlayer/TimeSelect.js +10 -5
- package/es/ScreenPlayer/containerStyle.d.ts +13 -0
- package/es/ScreenPlayer/containerStyle.js +32 -0
- package/es/ScreenPlayer/demo.d.ts +1 -2
- package/es/ScreenPlayer/demo.js +8 -13
- package/es/ScreenPlayer/demo2.d.ts +1 -2
- package/es/ScreenPlayer/demo2.js +112 -116
- package/es/ScreenPlayer/index.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.d.ts +2 -2
- package/es/ScreenPlayer/useTimeSlider.js +16 -15
- package/es/ScreenPlayer/useVideoFit.js +2 -2
- package/es/SocketEmitter/eventEmitter.d.ts +1 -1
- package/es/TableLayout/index.d.ts +1 -2
- package/es/TableLayout/index.js +7 -4
- package/es/Timeout/index.d.ts +1 -2
- package/es/Timeout/index.js +4 -5
- package/es/cache/index.d.ts +1 -1
- package/es/cache/index.js +21 -21
- package/es/index.d.ts +3 -11
- package/es/index.js +3 -11
- package/es/likeGo/index.d.ts +2 -0
- package/es/{Map/Config/utils.js → likeGo/index.js} +15 -49
- package/es/likeGoSync/index.d.ts +2 -0
- package/es/likeGoSync/index.js +10 -0
- package/es/logger/index.d.ts +4 -4
- package/es/nextTick/index.d.ts +1 -1
- package/es/nextTick/index.js +2 -6
- package/es/recorder/demo.d.ts +2 -0
- package/es/recorder/demo.js +200 -0
- package/es/recorder/index.d.ts +294 -0
- package/es/recorder/index.js +991 -0
- package/es/useDrawROI/index.js +8 -12
- package/es/useEventEmitterHandle/index.js +2 -2
- package/es/useInfiniteScroll/index.d.ts +1 -1
- package/es/useInfiniteScroll/index.js +8 -7
- package/es/useRafInterval/index.js +2 -2
- package/es/useSimpleState/index.js +3 -4
- package/es/useVirtualList/index.d.ts +1 -1
- package/es/useVirtualList/index.js +5 -8
- package/es/utils.d.ts +4 -4
- package/es/utils.js +1 -30
- package/es/uuid/index.d.ts +2 -1
- package/es/uuid/index.js +3 -12
- package/package.json +36 -37
- package/release-build.sh +3 -2
- package/scripts/{entry.js → entry.mjs} +4 -6
- package/{icon-fix.js → scripts/icon-fix.mjs} +4 -3
- package/tsconfig.json +1 -1
- package/es/Auth/index.d.ts +0 -8
- package/es/Auth/index.js +0 -18
- package/es/AutoExit/index.d.ts +0 -6
- package/es/AutoExit/index.js +0 -23
- package/es/CheckGroupFixed/index.less +0 -53
- package/es/ConfigContext/index.d.ts +0 -22
- package/es/ConfigContext/index.js +0 -25
- package/es/CustomRenderSelect/index.less +0 -25
- package/es/DisableMark/index.less +0 -9
- package/es/DynamicGridList/Demo.d.ts +0 -3
- package/es/DynamicList/index.less +0 -17
- package/es/FullScreen/index.d.ts +0 -22
- package/es/FullScreen/index.js +0 -36
- package/es/FullScreen/index.less +0 -18
- package/es/GridList/Demo.d.ts +0 -3
- package/es/GridList/index.less +0 -8
- package/es/HightLevel/index.less +0 -3
- package/es/ImageView/index.d.ts +0 -17
- package/es/ImageView/index.js +0 -58
- package/es/ImageView/index.less +0 -11
- package/es/LabelPlayer/111.png +0 -0
- package/es/LabelPlayer/demo.d.ts +0 -2
- package/es/LabelPlayer/demo.js +0 -123
- package/es/LabelPlayer/index.d.ts +0 -21
- package/es/LabelPlayer/index.js +0 -169
- package/es/LabelPlayer/index.less +0 -24
- package/es/LabelValue/index.less +0 -23
- package/es/List/index.less +0 -13
- package/es/ListWithSizeAnimate/index.less +0 -23
- package/es/Map/AMap.d.ts +0 -7109
- package/es/Map/BasicMap/AMapInstance.d.ts +0 -19
- package/es/Map/BasicMap/AMapInstance.js +0 -98
- package/es/Map/BasicMap/LeafletInstance.d.ts +0 -18
- package/es/Map/BasicMap/LeafletInstance.js +0 -111
- package/es/Map/BasicMap/index.d.ts +0 -9
- package/es/Map/BasicMap/index.js +0 -98
- package/es/Map/BasicMap/index.less +0 -29
- package/es/Map/ClusterLayer/demo.d.ts +0 -3
- package/es/Map/ClusterLayer/demo.js +0 -22
- package/es/Map/ClusterLayer/hook.d.ts +0 -5
- package/es/Map/ClusterLayer/hook.js +0 -124
- package/es/Map/ClusterLayer/index.d.ts +0 -6
- package/es/Map/ClusterLayer/index.js +0 -32
- package/es/Map/ClusterLayer/index.less +0 -29
- package/es/Map/ClusterLayer/props.d.ts +0 -8
- package/es/Map/Config/index.d.ts +0 -9
- package/es/Map/Config/index.js +0 -52
- package/es/Map/Config/utils.d.ts +0 -2
- package/es/Map/Context/index.d.ts +0 -11
- package/es/Map/Context/index.js +0 -56
- package/es/Map/FindPio/index.d.ts +0 -4
- package/es/Map/FindPio/index.js +0 -14
- package/es/Map/FindPio/index.less +0 -7
- package/es/Map/InfoWindow/MakerLikeWindow.d.ts +0 -4
- package/es/Map/InfoWindow/MakerLikeWindow.js +0 -113
- package/es/Map/InfoWindow/demo.d.ts +0 -3
- package/es/Map/InfoWindow/demo.js +0 -76
- package/es/Map/InfoWindow/index.d.ts +0 -11
- package/es/Map/InfoWindow/index.js +0 -67
- package/es/Map/LevelCenter/DragMarker/index.d.ts +0 -10
- package/es/Map/LevelCenter/DragMarker/index.js +0 -44
- package/es/Map/LevelCenter/demo.d.ts +0 -3
- package/es/Map/LevelCenter/demo.js +0 -46
- package/es/Map/LevelCenter/index.d.ts +0 -15
- package/es/Map/LevelCenter/index.js +0 -71
- package/es/Map/LoaderMap/index.d.ts +0 -12
- package/es/Map/LoaderMap/index.js +0 -71
- package/es/Map/MapDrawSelect/demo.d.ts +0 -3
- package/es/Map/MapDrawSelect/demo.js +0 -79
- package/es/Map/MapDrawSelect/index.d.ts +0 -15
- package/es/Map/MapDrawSelect/index.js +0 -62
- package/es/Map/MouseTool/index.d.ts +0 -10
- package/es/Map/MouseTool/index.js +0 -44
- package/es/Map/MouseTool/useMouseTools.d.ts +0 -7
- package/es/Map/MouseTool/useMouseTools.js +0 -83
- package/es/Map/ResetTools/index.d.ts +0 -10
- package/es/Map/ResetTools/index.js +0 -67
- package/es/Map/ResetTools/index.less +0 -39
- package/es/Map/SinglePoint/demo.d.ts +0 -3
- package/es/Map/SinglePoint/demo.js +0 -16
- package/es/Map/SinglePoint/index.d.ts +0 -27
- package/es/Map/SinglePoint/index.js +0 -57
- package/es/Map/SinglePoint/index.less +0 -41
- package/es/Map/hook/useMapEvent.d.ts +0 -2
- package/es/Map/hook/useMapEvent.js +0 -19
- package/es/Map/hook/useMapType.d.ts +0 -4
- package/es/Map/hook/useMapType.js +0 -12
- package/es/Map/icon.d.ts +0 -2
- package/es/Map/icon.js +0 -10
- package/es/Map/index.d.ts +0 -24
- package/es/Map/index.js +0 -25
- package/es/Map/interface.d.ts +0 -74
- package/es/Map/points.d.ts +0 -74
- package/es/Map/points.js +0 -1
- package/es/Map/useMarker/index.d.ts +0 -10
- package/es/Map/useMarker/index.js +0 -71
- package/es/Map/withMap/index.d.ts +0 -3
- package/es/Map/withMap/index.js +0 -18
- package/es/Picture/component/DefaultRects/index.less +0 -211
- package/es/Picture/component/DrawRect/index.less +0 -8
- package/es/Picture/component/RectMenu/index.less +0 -36
- package/es/Picture/component/Tools/index.less +0 -49
- package/es/Picture/index.less +0 -20
- package/es/Player/style/bar.less +0 -43
- package/es/Player/style/index.less +0 -34
- package/es/Player/style/message.less +0 -56
- package/es/Player/style/slider.less +0 -106
- package/es/Player/style/timeline.less +0 -116
- package/es/Player/style/volume.less +0 -24
- package/es/PlayerExt/index.less +0 -10
- package/es/Progress/index.less +0 -21
- package/es/ROI/index.less +0 -33
- package/es/ScreenPlayer/index.less +0 -335
- package/es/TableLayout/index.less +0 -4
- package/es/ThemeAntd/demo.d.ts +0 -4
- package/es/ThemeAntd/demo.js +0 -129
- package/es/ThemeAntd/demo.less +0 -20
- package/es/ThemeAntd/index.d.ts +0 -7
- package/es/ThemeAntd/index.js +0 -23
- package/es/ThemeAntd/index.less +0 -4
- package/es/VList/index.d.ts +0 -11
- package/es/VList/index.js +0 -42
- package/es/VList/index.less +0 -6
- package/es/VList/utils.d.ts +0 -14
- package/es/VList/utils.js +0 -17
- package/es/bigNumberTransformCN/index.d.ts +0 -5
- package/es/bigNumberTransformCN/index.js +0 -60
- package/es/useFullscreen/demo.d.ts +0 -2
- package/es/useFullscreen/demo.js +0 -48
- package/es/useFullscreen/index.d.ts +0 -12
- package/es/useFullscreen/index.js +0 -76
- /package/es/DynamicGridList/{Demo.js → demo.js} +0 -0
package/es/Player/live_heart.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import _useDocumentVisibility from "ahooks/es/useDocumentVisibility";
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import { useDocumentVisibility, useRafInterval, useUpdateEffect } from 'ahooks';
|
|
4
3
|
import { useRef } from 'react';
|
|
5
4
|
import Events from "./event/eventName";
|
|
6
5
|
function useLiveHeart(_ref) {
|
|
7
6
|
var api = _ref.api,
|
|
8
7
|
event = _ref.event,
|
|
9
8
|
isLive = _ref.isLive;
|
|
10
|
-
var documentVisibility =
|
|
9
|
+
var documentVisibility = useDocumentVisibility();
|
|
11
10
|
var cTimeRef = useRef(0);
|
|
12
11
|
var run = function run() {
|
|
13
12
|
var _api$getCurrentTime;
|
|
@@ -22,24 +21,24 @@ function useLiveHeart(_ref) {
|
|
|
22
21
|
api.play();
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
useUpdateEffect(function () {
|
|
26
25
|
return run();
|
|
27
26
|
}, [documentVisibility]);
|
|
28
|
-
|
|
27
|
+
useRafInterval(function () {
|
|
29
28
|
var _api$getCurrentTime2;
|
|
30
29
|
return cTimeRef.current = (_api$getCurrentTime2 = api === null || api === void 0 ? void 0 : api.getCurrentTime()) !== null && _api$getCurrentTime2 !== void 0 ? _api$getCurrentTime2 : 0;
|
|
31
30
|
}, 1 * 1000);
|
|
32
|
-
|
|
31
|
+
useRafInterval(function () {
|
|
33
32
|
return run();
|
|
34
33
|
}, 30 * 1000);
|
|
35
|
-
|
|
34
|
+
useRafInterval(function () {
|
|
36
35
|
var _api$video;
|
|
37
36
|
if (!api || !event) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
39
|
var cuurentTime = api.getCurrentTime();
|
|
41
40
|
if (!!isLive && !((_api$video = api.video) !== null && _api$video !== void 0 && _api$video.paused) && cuurentTime === cTimeRef.current) {
|
|
42
|
-
event.emit(Events.ERROR);
|
|
41
|
+
event.emit(Events.ERROR, 'long time no play!');
|
|
43
42
|
}
|
|
44
43
|
}, 20 * 1000);
|
|
45
44
|
}
|
package/es/Player/message.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
declare function VideoMessage(): JSX.Element;
|
|
4
|
-
export declare const NoSource: () => JSX.Element;
|
|
1
|
+
declare function VideoMessage(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const NoSource: () => import("react/jsx-runtime").JSX.Element;
|
|
5
3
|
export default VideoMessage;
|
package/es/Player/message.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
2
3
|
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; }
|
|
3
4
|
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) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -10,14 +11,22 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
12
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
import { css, keyframes } from '@emotion/css';
|
|
16
|
+
import { useContext, useMemo, useRef, useState } from 'react';
|
|
14
17
|
import { Context } from "./context";
|
|
15
18
|
import { useRegisterPlayerEvent, useVideoEvent } from "./event";
|
|
16
19
|
import EventName from "./event/eventName";
|
|
17
20
|
import IconFont from "./iconfont";
|
|
18
|
-
import "./style/message.less";
|
|
19
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
var lmPlayerMessageMaskCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n z-index: -1;\n display: flex;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: transparent;\n opacity: 0;\n transition: all 0.5s;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n"])));
|
|
24
|
+
var lmPlayerLoadingIconCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n z-index: -1;\n font-size: 48px;\n visibility: hidden;\n"])));
|
|
25
|
+
var lmPlayerMaskLoadingAnimationCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 1;\n background: rgb(0 0 0 / 60%);\n opacity: 1;\n"])));
|
|
26
|
+
var loadingAnimationFrames = keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
27
|
+
var lmPlayerLoadingAnimationCss = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n z-index: 9;\n visibility: visible;\n animation: ", " 1s linear infinite;\n"])), loadingAnimationFrames);
|
|
28
|
+
var lmPlayerLoadfailCss = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n z-index: 9;\n visibility: visible;\n"])));
|
|
29
|
+
var lmPlayerMessageCss = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n padding: 10px;\n font-size: 16px;\n color: #fff;\n"])));
|
|
21
30
|
function VideoMessage() {
|
|
22
31
|
var _useContext = useContext(Context),
|
|
23
32
|
api = _useContext.api;
|
|
@@ -33,7 +42,7 @@ function VideoMessage() {
|
|
|
33
42
|
var message = useMemo(function () {
|
|
34
43
|
if (state.status === 'fail') {
|
|
35
44
|
console.warn("\u89C6\u9891\u9519\u8BEF\uFF0C\u8BF7\u624B\u52A8\u5237\u65B0\u91CD\u8BD5\uFF01");
|
|
36
|
-
return '
|
|
45
|
+
return '请稍后重试';
|
|
37
46
|
}
|
|
38
47
|
if (state.status === 'reload') {
|
|
39
48
|
console.warn("\u7B2C".concat(state.errorTimer, "\u6B21\u91CD\u8FDE"));
|
|
@@ -113,19 +122,19 @@ function VideoMessage() {
|
|
|
113
122
|
var loading = state.loading,
|
|
114
123
|
status = state.status;
|
|
115
124
|
return /*#__PURE__*/_jsxs("div", {
|
|
116
|
-
className: "
|
|
125
|
+
className: "".concat(lmPlayerMessageMaskCss, " ").concat(loading || status === 'fail' ? lmPlayerMaskLoadingAnimationCss : ''),
|
|
117
126
|
children: [/*#__PURE__*/_jsx(IconFont, {
|
|
118
127
|
type: status === 'fail' ? 'lm-player-YesorNo_No_Dark' : 'lm-player-Loading',
|
|
119
|
-
className: "".concat(loading && status !== 'fail' ?
|
|
128
|
+
className: "".concat(lmPlayerLoadingIconCss, " ").concat(loading && status !== 'fail' ? lmPlayerLoadingAnimationCss : status === 'fail' ? lmPlayerLoadfailCss : '')
|
|
120
129
|
}), /*#__PURE__*/_jsx("span", {
|
|
121
|
-
className:
|
|
130
|
+
className: lmPlayerMessageCss,
|
|
122
131
|
children: message
|
|
123
132
|
})]
|
|
124
133
|
});
|
|
125
134
|
}
|
|
126
135
|
export var NoSource = function NoSource() {
|
|
127
136
|
return /*#__PURE__*/_jsx("div", {
|
|
128
|
-
className: "
|
|
137
|
+
className: "".concat(lmPlayerMessageMaskCss, " ").concat(lmPlayerMaskLoadingAnimationCss),
|
|
129
138
|
children: /*#__PURE__*/_jsx(IconFont, {
|
|
130
139
|
style: {
|
|
131
140
|
fontSize: 80
|
package/es/Player/player.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { ISegmentPlayerProps } from './player';
|
|
3
2
|
/**
|
|
4
3
|
* @desc 主组件,负责片段整体逻辑控制
|
|
5
4
|
* @param param0
|
|
6
5
|
* @returns
|
|
7
6
|
*/
|
|
8
|
-
declare function SegmentPlayer({ segments, begin, forwordRef, defaultIndex, onCanPlayerInit, customTimeLine, ...props }: ISegmentPlayerProps): JSX.Element;
|
|
7
|
+
declare function SegmentPlayer({ segments, begin, forwordRef, defaultIndex, onCanPlayerInit, customTimeLine, ...props }: ISegmentPlayerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default SegmentPlayer;
|
|
@@ -1,6 +1,4 @@
|
|
|
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
|
-
import _useUpdate from "ahooks/es/useUpdate";
|
|
3
|
-
import _useLatest from "ahooks/es/useLatest";
|
|
4
2
|
var _excluded = ["segments", "begin", "forwordRef", "defaultIndex", "onCanPlayerInit", "customTimeLine"];
|
|
5
3
|
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; }
|
|
6
4
|
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; }
|
|
@@ -15,7 +13,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
15
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; }
|
|
16
14
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
17
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
import
|
|
16
|
+
import { useLatest, useUpdate } from 'ahooks';
|
|
17
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
18
|
import { useRegisterPlayerEvent, useVideoEvent } from "./event";
|
|
20
19
|
import Events from "./event/eventName";
|
|
21
20
|
import SegmentTimeLine from "./segment_timeline";
|
|
@@ -123,8 +122,8 @@ function SegmentPlayer(_ref) {
|
|
|
123
122
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
124
123
|
state = _useState4[0],
|
|
125
124
|
setState = _useState4[1];
|
|
126
|
-
var latestSegmentsRef =
|
|
127
|
-
var update =
|
|
125
|
+
var latestSegmentsRef = useLatest(segments);
|
|
126
|
+
var update = useUpdate();
|
|
128
127
|
var ref = useRef(null);
|
|
129
128
|
var playRef = forwordRef ? forwordRef : ref;
|
|
130
129
|
var _ref2 = playRef.current || {},
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { ISegmentType } from './player';
|
|
3
|
-
import './style/timeline.less';
|
|
4
2
|
interface ITimeLineProps {
|
|
5
3
|
index: number;
|
|
6
4
|
segments: ISegmentType[];
|
|
@@ -8,5 +6,5 @@ interface ITimeLineProps {
|
|
|
8
6
|
begin: number;
|
|
9
7
|
seekTo: (time: number) => void;
|
|
10
8
|
}
|
|
11
|
-
declare function SegmentTimeLine({ index, segments, duration, begin, seekTo }: ITimeLineProps): JSX.Element;
|
|
9
|
+
declare function SegmentTimeLine({ index, segments, duration, begin, seekTo }: ITimeLineProps): import("react/jsx-runtime").JSX.Element;
|
|
12
10
|
export default SegmentTimeLine;
|
|
@@ -1,4 +1,5 @@
|
|
|
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
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
2
3
|
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; }
|
|
3
4
|
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) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -10,15 +11,21 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
12
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
import { css } from '@emotion/css';
|
|
13
16
|
import { Tooltip } from 'antd';
|
|
14
17
|
import moment from 'dayjs';
|
|
15
18
|
import React, { startTransition, useMemo, useState } from 'react';
|
|
16
19
|
import useBarStatus from "./contraller_bar/useBarStatus";
|
|
17
|
-
import "./
|
|
18
|
-
import { useTimes } from "./timeline";
|
|
20
|
+
import { bufferLineCss, currentLineCss, hideTimeLineCss, playerTimelineLayoutCss, useTimes } from "./timeline";
|
|
19
21
|
import { FMT } from "./util";
|
|
20
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
var segmentLineBoxCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n height: 100%;\n"])));
|
|
25
|
+
var segmentLineItemCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n background: rgb(0 0 0 / 100%);\n box-sizing: border-box;\n &:hover {\n &::after {\n box-sizing: border-box;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 6;\n width: 100%;\n height: 100%;\n border: 1px solid #fff;\n content: ' ';\n }\n }\n"])));
|
|
26
|
+
var segmentLineItemNoneCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n z-index: 6;\n cursor: not-allowed;\n background: rgb(222 14 14 / 100%);\n"])));
|
|
27
|
+
var segmentLineTipBoxCss = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: 12px;\n div {\n padding: 2px 0;\n margin: 0;\n }\n"])));
|
|
28
|
+
var segmentLineMarkCss = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n width: 2px;\n height: 100%;\n pointer-events: none;\n background-color: #fff;\n"])));
|
|
22
29
|
function TipTitle(_ref) {
|
|
23
30
|
var index = _ref.index,
|
|
24
31
|
segments = _ref.segments,
|
|
@@ -53,7 +60,7 @@ function TipTitle(_ref) {
|
|
|
53
60
|
return (_segments$index = segments[index]) !== null && _segments$index !== void 0 && _segments$index.url ? true : false;
|
|
54
61
|
}, [index, segments]);
|
|
55
62
|
return /*#__PURE__*/_jsxs("div", {
|
|
56
|
-
className:
|
|
63
|
+
className: segmentLineTipBoxCss,
|
|
57
64
|
children: [/*#__PURE__*/_jsx("div", {
|
|
58
65
|
style: {
|
|
59
66
|
fontWeight: 600
|
|
@@ -144,11 +151,14 @@ function SegmentTimeLine(_ref2) {
|
|
|
144
151
|
});
|
|
145
152
|
};
|
|
146
153
|
return /*#__PURE__*/_jsx("div", {
|
|
147
|
-
className: "
|
|
154
|
+
className: "".concat(playerTimelineLayoutCss, " ").concat(status === 0 ? hideTimeLineCss : ''),
|
|
155
|
+
style: {
|
|
156
|
+
background: 'transparent'
|
|
157
|
+
},
|
|
148
158
|
onMouseMove: onLineMouseOver,
|
|
149
159
|
onMouseOut: onLineMouseOut,
|
|
150
160
|
children: /*#__PURE__*/_jsxs("div", {
|
|
151
|
-
className:
|
|
161
|
+
className: segmentLineBoxCss,
|
|
152
162
|
children: [segments.map(function (v, i) {
|
|
153
163
|
return /*#__PURE__*/_jsx(Tooltip, {
|
|
154
164
|
title: /*#__PURE__*/_jsx(TipTitle, {
|
|
@@ -159,7 +169,7 @@ function SegmentTimeLine(_ref2) {
|
|
|
159
169
|
markTime: state.markTime
|
|
160
170
|
}),
|
|
161
171
|
children: /*#__PURE__*/_jsx("div", {
|
|
162
|
-
className: "
|
|
172
|
+
className: "".concat(segmentLineItemCss, " ").concat(!v.url ? segmentLineItemNoneCss : ''),
|
|
163
173
|
onClick: function onClick(e) {
|
|
164
174
|
return seekWithLine(e, i);
|
|
165
175
|
},
|
|
@@ -169,17 +179,17 @@ function SegmentTimeLine(_ref2) {
|
|
|
169
179
|
})
|
|
170
180
|
}, "time-line-".concat(i));
|
|
171
181
|
}), /*#__PURE__*/_jsx("div", {
|
|
172
|
-
className:
|
|
182
|
+
className: bufferLineCss,
|
|
173
183
|
style: {
|
|
174
184
|
width: "".concat(bufferedPercent, "%")
|
|
175
185
|
}
|
|
176
186
|
}), /*#__PURE__*/_jsx("div", {
|
|
177
|
-
className:
|
|
187
|
+
className: currentLineCss,
|
|
178
188
|
style: {
|
|
179
189
|
width: "".concat(playPercent, "%")
|
|
180
190
|
}
|
|
181
191
|
}), state.left !== -1 && /*#__PURE__*/_jsx("span", {
|
|
182
|
-
className:
|
|
192
|
+
className: segmentLineMarkCss,
|
|
183
193
|
style: {
|
|
184
194
|
left: state.left
|
|
185
195
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExportPlayerType, ISinglePlayerProps } from './player';
|
|
3
|
-
import './style/index.less';
|
|
4
3
|
declare const SinglePlayer: React.ForwardRefExoticComponent<ISinglePlayerProps & React.RefAttributes<ExportPlayerType>>;
|
|
5
4
|
export default SinglePlayer;
|
|
@@ -1,9 +1,6 @@
|
|
|
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
|
-
import _useUpdateEffect from "ahooks/es/useUpdateEffect";
|
|
3
|
-
import _useMemoizedFn from "ahooks/es/useMemoizedFn";
|
|
4
|
-
import _useLatest from "ahooks/es/useLatest";
|
|
5
|
-
import _useToggle3 from "ahooks/es/useToggle";
|
|
6
2
|
var _excluded = ["className", "url", "type", "hideContrallerBar", "isLive", "errorReloadTimer", "children", "onCanPlayerInit", "extActions"];
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
7
4
|
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; }
|
|
8
5
|
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; }
|
|
9
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -17,6 +14,9 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
17
14
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
|
+
import { css } from '@emotion/css';
|
|
19
|
+
import { useLatest, useMemoizedFn, useToggle, useUpdateEffect } from 'ahooks';
|
|
20
20
|
import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
21
21
|
import { usePlayerApi } from "./api";
|
|
22
22
|
import { Provider } from "./context";
|
|
@@ -31,9 +31,11 @@ import useLiveHeart from "./live_heart";
|
|
|
31
31
|
import VideoMessage from "./message";
|
|
32
32
|
import Timeline from "./timeline";
|
|
33
33
|
import { createProxy, getVideoType, playUnload } from "./util";
|
|
34
|
-
import "./style/index.less";
|
|
35
34
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
36
35
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
|
+
var playerContainerCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n height: 100%;\n background: #000;\n box-sizing: border-box;\n .anticon {\n color: #fff;\n }\n"])));
|
|
37
|
+
var playerMaskLayoutCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n overflow: hidden;\n"])));
|
|
38
|
+
var videoCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n background: #000;\n"])));
|
|
37
39
|
var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref) {
|
|
38
40
|
var _props$reload;
|
|
39
41
|
var className = _ref.className,
|
|
@@ -71,7 +73,7 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
71
73
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72
74
|
state = _useState2[0],
|
|
73
75
|
setState = _useState2[1];
|
|
74
|
-
var _useToggle =
|
|
76
|
+
var _useToggle = useToggle('fill', 'contain'),
|
|
75
77
|
_useToggle2 = _slicedToArray(_useToggle, 2),
|
|
76
78
|
fit = _useToggle2[0],
|
|
77
79
|
toggle = _useToggle2[1].toggle;
|
|
@@ -104,8 +106,8 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
104
106
|
var hasLink = useMemo(function () {
|
|
105
107
|
return !!url || !!(flvConfig !== null && flvConfig !== void 0 && flvConfig.mediaDataSource.segments) && vType === 'flv';
|
|
106
108
|
}, [url, flvConfig === null || flvConfig === void 0 ? void 0 : flvConfig.mediaDataSource.segments, vType]);
|
|
107
|
-
var hlsRef =
|
|
108
|
-
var flvRef =
|
|
109
|
+
var hlsRef = useLatest(hls);
|
|
110
|
+
var flvRef = useLatest(flv);
|
|
109
111
|
|
|
110
112
|
// 存储容器
|
|
111
113
|
useEffect(function () {
|
|
@@ -123,15 +125,15 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
123
125
|
}, [url]);
|
|
124
126
|
|
|
125
127
|
// 特殊接口实现 reload是可能被重写的,但是API只暴露原生的方法
|
|
126
|
-
var reload =
|
|
128
|
+
var reload = useMemoizedFn(function () {
|
|
127
129
|
rePlay();
|
|
128
130
|
// playReload(video, event, flvRef.current, hlsRef.current, url);
|
|
129
131
|
});
|
|
130
132
|
|
|
131
|
-
var unload =
|
|
133
|
+
var unload = useMemoizedFn(function () {
|
|
132
134
|
return playUnload(video, flvRef.current, hlsRef.current);
|
|
133
135
|
});
|
|
134
|
-
var openFpsPlay =
|
|
136
|
+
var openFpsPlay = useMemoizedFn(function () {
|
|
135
137
|
setState(function (old) {
|
|
136
138
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
137
139
|
isFpsPlay: true
|
|
@@ -139,7 +141,7 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
139
141
|
});
|
|
140
142
|
api === null || api === void 0 ? void 0 : api.pause();
|
|
141
143
|
});
|
|
142
|
-
var closeFpsPlay =
|
|
144
|
+
var closeFpsPlay = useMemoizedFn(function () {
|
|
143
145
|
setState(function (old) {
|
|
144
146
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
145
147
|
isFpsPlay: false
|
|
@@ -185,7 +187,7 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
185
187
|
},
|
|
186
188
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
187
189
|
[video, state.container, playApi, playEvent, fit]);
|
|
188
|
-
|
|
190
|
+
useUpdateEffect(function () {
|
|
189
191
|
return api && event && video ? onCanPlayerInit === null || onCanPlayerInit === void 0 ? void 0 : onCanPlayerInit() : undefined;
|
|
190
192
|
}, [api, event, video]);
|
|
191
193
|
|
|
@@ -231,11 +233,12 @@ var SinglePlayer = /*#__PURE__*/React.forwardRef(function SinglePlayer(_ref, ref
|
|
|
231
233
|
isLive: isLive,
|
|
232
234
|
isFpsPlay: state.isFpsPlay,
|
|
233
235
|
children: /*#__PURE__*/_jsxs("div", {
|
|
234
|
-
className: "
|
|
236
|
+
className: "".concat(playerContainerCss, " ").concat(className),
|
|
235
237
|
ref: domRef,
|
|
236
238
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
237
|
-
className:
|
|
239
|
+
className: playerMaskLayoutCss,
|
|
238
240
|
children: [/*#__PURE__*/_jsx("video", _objectSpread(_objectSpread({}, videoProps), {}, {
|
|
241
|
+
className: videoCss,
|
|
239
242
|
style: {
|
|
240
243
|
objectFit: fit,
|
|
241
244
|
visibility: state.isFpsPlay ? 'hidden' : 'unset'
|
package/es/Player/timeline.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const playerTimelineLayoutCss: string;
|
|
2
|
+
export declare const hideTimeLineCss: string;
|
|
3
|
+
export declare const bufferLineCss: string;
|
|
4
|
+
export declare const currentLineCss: string;
|
|
3
5
|
export declare function useTimes(): number[];
|
|
4
|
-
declare function TimeLine(): JSX.Element;
|
|
6
|
+
declare function TimeLine(): import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default TimeLine;
|
package/es/Player/timeline.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
3
|
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; }
|
|
3
4
|
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) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -10,13 +11,18 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
12
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
import { css } from '@emotion/css';
|
|
13
16
|
import React, { useContext, useMemo, useState } from 'react';
|
|
14
17
|
import { Context } from "./context";
|
|
15
18
|
import useBarStatus from "./contraller_bar/useBarStatus";
|
|
16
19
|
import { useVideoEvent } from "./event";
|
|
17
|
-
import "./style/timeline.less";
|
|
18
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
export var playerTimelineLayoutCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 28px;\n left: 0;\n z-index: 9;\n display: flex;\n width: 100%;\n height: 12px;\n cursor: pointer;\n background: rgb(0 0 0 / 100%);\n opacity: 0.8;\n justify-content: center;\n align-items: center;\n transition: all 0.1s;\n"])));
|
|
23
|
+
export var hideTimeLineCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n bottom: 0;\n height: 4px;\n"])));
|
|
24
|
+
export var bufferLineCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n max-width: 100%;\n pointer-events: none;\n background-color: rgb(103 103 103);\n"])));
|
|
25
|
+
export var currentLineCss = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n max-width: 100%;\n overflow: hidden;\n pointer-events: none;\n background-color: rgb(70 97 255 / 100%);\n"])));
|
|
20
26
|
export function useTimes() {
|
|
21
27
|
var _useContext = useContext(Context),
|
|
22
28
|
api = _useContext.api,
|
|
@@ -80,15 +86,15 @@ function TimeLine() {
|
|
|
80
86
|
api === null || api === void 0 ? void 0 : api.seekTo(cTime);
|
|
81
87
|
};
|
|
82
88
|
return /*#__PURE__*/_jsxs("div", {
|
|
83
|
-
className: "
|
|
89
|
+
className: "".concat(playerTimelineLayoutCss, " ").concat(status === 0 ? hideTimeLineCss : ''),
|
|
84
90
|
onClick: seekWithLine,
|
|
85
91
|
children: [/*#__PURE__*/_jsx("div", {
|
|
86
|
-
className:
|
|
92
|
+
className: bufferLineCss,
|
|
87
93
|
style: {
|
|
88
94
|
width: "".concat(bufferedPercent, "%")
|
|
89
95
|
}
|
|
90
96
|
}), /*#__PURE__*/_jsx("div", {
|
|
91
|
-
className:
|
|
97
|
+
className: currentLineCss,
|
|
92
98
|
style: {
|
|
93
99
|
width: "".concat(playPercent, "%")
|
|
94
100
|
}
|
package/es/Player/util.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type VideoEventInstance from './event';
|
|
|
4
4
|
import type { FlvPlayerConfig } from './player';
|
|
5
5
|
/**
|
|
6
6
|
* 创建HLS对象
|
|
7
|
-
* @param {
|
|
8
|
-
* @param {
|
|
7
|
+
* @param {HTMLVideoElement} video
|
|
8
|
+
* @param {string} url
|
|
9
9
|
*/
|
|
10
10
|
export declare function createHlsPlayer(video: HTMLVideoElement, url?: string, isLive?: boolean, hlsConfig?: HlsConfig): Hls | undefined;
|
|
11
11
|
/**
|
package/es/Player/util.js
CHANGED
|
@@ -13,8 +13,8 @@ import { likeGo } from "../utils";
|
|
|
13
13
|
import Events from "./event/eventName";
|
|
14
14
|
/**
|
|
15
15
|
* 创建HLS对象
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
16
|
+
* @param {HTMLVideoElement} video
|
|
17
|
+
* @param {string} url
|
|
18
18
|
*/
|
|
19
19
|
export function createHlsPlayer(video, url, isLive, hlsConfig) {
|
|
20
20
|
if (!Hls.isSupported() || !url) {
|
package/es/PlayerExt/demo.d.ts
CHANGED
package/es/PlayerExt/demo.js
CHANGED
|
@@ -10,8 +10,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
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
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { Button, ConfigProvider, Input, Select } from 'antd';
|
|
13
14
|
import React, { useState } from 'react';
|
|
14
|
-
import { Button, ConfigProvider, Select, Input } from 'antd';
|
|
15
15
|
import Player from "../Player/single_player";
|
|
16
16
|
import ExtModel from "./index";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -122,7 +122,7 @@ function Demo() {
|
|
|
122
122
|
width: 60,
|
|
123
123
|
height: 32
|
|
124
124
|
},
|
|
125
|
-
onClick: function onClick(
|
|
125
|
+
onClick: function onClick() {
|
|
126
126
|
return setState(function (old) {
|
|
127
127
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
128
128
|
url: ''
|
|
@@ -135,7 +135,7 @@ function Demo() {
|
|
|
135
135
|
width: 60,
|
|
136
136
|
height: 32
|
|
137
137
|
},
|
|
138
|
-
onClick: function onClick(
|
|
138
|
+
onClick: function onClick() {
|
|
139
139
|
return setState(function (old) {
|
|
140
140
|
return _objectSpread(_objectSpread({}, old), {}, {
|
|
141
141
|
url: state.tempUrl
|
package/es/PlayerExt/index.d.ts
CHANGED
package/es/PlayerExt/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
|
+
var _templateObject;
|
|
2
3
|
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; }
|
|
3
4
|
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) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -10,9 +11,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
12
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
import { css } from '@emotion/css';
|
|
13
16
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
14
17
|
import IconFont from "../Player/iconfont";
|
|
15
|
-
|
|
18
|
+
|
|
19
|
+
//模式1浏览器模式,2插件模式
|
|
16
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
22
|
/**
|
|
@@ -27,6 +31,7 @@ export var LOCAL_PORT = ['15080', '15081', '15082', '15083', '15084', '15085', '
|
|
|
27
31
|
export function getLocalPort() {
|
|
28
32
|
return LOCAL_PORT[Math.floor(Math.random() * LOCAL_PORT.length)];
|
|
29
33
|
}
|
|
34
|
+
var classname = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n height: 100%;\n color: #fff;\n background-color: #000;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n"])));
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
37
|
* @desc 转码插件模式下的url
|
|
@@ -73,7 +78,7 @@ function NeedInstallPlugin(_ref) {
|
|
|
73
78
|
var pluginDownloadUrl = _ref.pluginDownloadUrl,
|
|
74
79
|
retry = _ref.retry;
|
|
75
80
|
return /*#__PURE__*/_jsx("div", {
|
|
76
|
-
className:
|
|
81
|
+
className: classname,
|
|
77
82
|
children: /*#__PURE__*/_jsxs("div", {
|
|
78
83
|
style: {
|
|
79
84
|
marginTop: -60,
|
|
@@ -114,7 +119,7 @@ function NeedInstallPlugin(_ref) {
|
|
|
114
119
|
}
|
|
115
120
|
function Loading() {
|
|
116
121
|
return /*#__PURE__*/_jsx("div", {
|
|
117
|
-
className: "lm-player-ext-layout",
|
|
122
|
+
className: "".concat(classname, " lm-player-ext-layout "),
|
|
118
123
|
children: /*#__PURE__*/_jsxs("div", {
|
|
119
124
|
style: {
|
|
120
125
|
marginTop: -60,
|
|
@@ -135,7 +140,7 @@ function Loading() {
|
|
|
135
140
|
}
|
|
136
141
|
function Empty() {
|
|
137
142
|
return /*#__PURE__*/_jsx("div", {
|
|
138
|
-
className: "lm-player-ext-layout",
|
|
143
|
+
className: "".concat(classname, " lm-player-ext-layout "),
|
|
139
144
|
children: /*#__PURE__*/_jsx(IconFont, {
|
|
140
145
|
type: "lm-player-PlaySource",
|
|
141
146
|
style: {
|
|
@@ -197,7 +202,7 @@ export function ExtModel(_ref2) {
|
|
|
197
202
|
return /*#__PURE__*/_jsx(Empty, {});
|
|
198
203
|
}
|
|
199
204
|
return /*#__PURE__*/_jsx("div", {
|
|
200
|
-
className: "lm-player-ext-layout",
|
|
205
|
+
className: "".concat(classname, " lm-player-ext-layout "),
|
|
201
206
|
children: /*#__PURE__*/React.cloneElement(children, mode === 2 ? {
|
|
202
207
|
url: playUrl,
|
|
203
208
|
segments: playSegments
|
package/es/Progress/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import './index.less';
|
|
3
1
|
interface IProgressComponentProps {
|
|
4
2
|
status: 'over' | 'error' | 'loading';
|
|
5
3
|
}
|
|
6
|
-
declare function ProgressComponent({ status }: IProgressComponentProps): JSX.Element;
|
|
4
|
+
declare function ProgressComponent({ status }: IProgressComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
7
5
|
declare namespace ProgressComponent {
|
|
8
6
|
var defaultProps: {
|
|
9
7
|
status: string;
|