@cloud-app-dev/vidc 2.1.0-alpha.9 → 2.2.0-alpha.1
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/.umirc.ts +1 -1
- package/es/AppContext/Sync.d.ts +1 -0
- package/es/AppContext/interface.d.ts +4 -1
- package/es/AppRedirect/index.d.ts +1 -0
- package/es/CheckGroupFixed/index.d.ts +1 -0
- package/es/DeviceSelect/TreeType.d.ts +1 -0
- package/es/DeviceSelect/demo.d.ts +1 -0
- package/es/DeviceSelect/index.d.ts +1 -0
- package/es/DeviceSelect/index.js +1 -1
- package/es/Drag/DragAndDropItem.js +2 -2
- package/es/Drag/DropItem.js +2 -2
- package/es/Drawer/Footer.d.ts +1 -0
- package/es/Drawer/index.d.ts +1 -0
- package/es/InitialConfig/utils.d.ts +5 -5
- package/es/InitialConfig/utils.js +19 -19
- package/es/Input/index.d.ts +1 -0
- package/es/List/CheckExt.d.ts +1 -0
- package/es/List/DeviceList/index.js +1 -1
- package/es/List/DynamicDeviceList/Demo.d.ts +1 -0
- package/es/List/DynamicDeviceList/index.d.ts +1 -0
- package/es/List/VList/index.d.ts +1 -0
- package/es/List/index.d.ts +1 -0
- package/es/LoaderApp/loader.js +2 -6
- package/es/LoaderApp/utils.d.ts +1 -0
- package/es/LoaderApp/utils.js +37 -0
- package/es/Modal/index.d.ts +1 -0
- package/es/Picture/component/DefaultRects/RectInfo.d.ts +1 -0
- package/es/Picture/component/DefaultRects/index.d.ts +2 -1
- package/es/Picture/component/DrawRect/index.d.ts +3 -4
- package/es/Picture/component/RectMenu/index.d.ts +2 -3
- package/es/Picture/component/WheelScale/index.d.ts +1 -0
- package/es/Picture/component/WheelScale/index.js +3 -3
- package/es/Picture/index.d.ts +1 -0
- package/es/Picture/index.js +4 -2
- package/es/Picture/interface.d.ts +4 -2
- package/es/Picture/utils.d.ts +1 -0
- package/es/Player/api/index.d.ts +71 -0
- package/es/Player/api/index.js +284 -0
- package/es/Player/contraller_bar/bar.d.ts +8 -0
- package/es/Player/contraller_bar/bar.js +21 -0
- package/es/Player/contraller_bar/contraller_event.d.ts +9 -0
- package/es/Player/contraller_bar/contraller_event.js +57 -0
- package/es/Player/contraller_bar/index.d.ts +19 -0
- package/es/Player/contraller_bar/index.js +37 -0
- package/es/Player/contraller_bar/left_bar.d.ts +15 -0
- package/es/Player/contraller_bar/left_bar.js +91 -0
- package/es/Player/contraller_bar/right_bar.d.ts +13 -0
- package/es/Player/contraller_bar/right_bar.js +55 -0
- package/es/Player/contraller_bar/useBarStatus.d.ts +3 -0
- package/es/Player/contraller_bar/useBarStatus.js +52 -0
- package/es/Player/demo.d.ts +2 -0
- package/es/Player/demo.js +269 -0
- package/es/Player/event/browserTabEvent.d.ts +9 -0
- package/es/Player/event/browserTabEvent.js +57 -0
- package/es/Player/event/errorEvent.d.ts +16 -0
- package/es/Player/event/errorEvent.js +120 -0
- package/es/Player/event/eventName.d.ts +3 -0
- package/es/Player/event/eventName.js +15 -0
- package/es/Player/event/index.d.ts +22 -0
- package/es/Player/event/index.js +175 -0
- package/es/Player/frontend_player.d.ts +15 -0
- package/es/Player/frontend_player.js +90 -0
- package/es/Player/frontend_timeline.d.ts +14 -0
- package/es/Player/frontend_timeline.js +141 -0
- package/es/Player/iconfont.d.ts +13 -0
- package/es/Player/iconfont.js +18 -0
- package/es/Player/index.d.ts +4 -0
- package/es/Player/index.js +4 -0
- package/es/Player/live_heart.d.ts +6 -0
- package/es/Player/live_heart.js +29 -0
- package/es/Player/message.d.ts +11 -0
- package/es/Player/message.js +150 -0
- package/es/Player/player.d.ts +75 -0
- package/es/Player/segment_player.d.ts +13 -0
- package/es/Player/segment_player.js +191 -0
- package/es/Player/segment_timeline.d.ts +16 -0
- package/es/Player/segment_timeline.js +154 -0
- package/es/Player/single_player.d.ts +5 -0
- package/es/Player/single_player.js +185 -0
- package/es/Player/style/bar.css +37 -0
- package/es/Player/style/iconfont.css +62 -0
- package/es/Player/style/index.css +22 -0
- package/es/Player/style/message.css +49 -0
- package/es/Player/style/slider.css +96 -0
- package/es/Player/style/timeline.css +92 -0
- package/es/Player/timeline.d.ts +11 -0
- package/es/Player/timeline.js +104 -0
- package/es/Player/util.d.ts +48 -0
- package/es/Player/util.js +172 -0
- package/es/Progress/index.d.ts +1 -0
- package/es/Tree/BaseTree/demo.d.ts +1 -0
- package/es/Tree/BaseTree/index.d.ts +2 -2
- package/es/Tree/demo.d.ts +1 -0
- package/es/Tree/index.js +1 -1
- package/es/UserSelect/demo.d.ts +1 -0
- package/es/WorkerFlow/Form/Approver.d.ts +1 -0
- package/es/WorkerFlow/Form/Condition.d.ts +1 -0
- package/es/WorkerFlow/Form/EmptyUserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/FormAuth.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupList.d.ts +1 -0
- package/es/WorkerFlow/Form/GroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/Handle.d.ts +1 -0
- package/es/WorkerFlow/Form/LevelGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Form/UserAndGroupSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSelect.d.ts +1 -0
- package/es/WorkerFlow/Form/UserSet.d.ts +1 -0
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Add.js +1 -1
- package/es/WorkerFlow/Nodes/AddOption.d.ts +1 -0
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Approver.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Condition.d.ts +1 -0
- package/es/WorkerFlow/Nodes/End.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Handle.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Node.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Notifier.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Render.d.ts +1 -0
- package/es/WorkerFlow/Nodes/Start.d.ts +1 -0
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +1 -0
- package/es/index.d.ts +3 -3
- package/es/index.js +4 -4
- package/package.json +13 -10
- package/es/AppRouter/index.d.ts +0 -8
- package/es/AppRouter/index.js +0 -17
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
}
|
|
17
|
+
.lm-player-message-mask.lm-player-mask-loading-animation {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
background: rgba(0, 0, 0, 0.6);
|
|
20
|
+
z-index: 1;
|
|
21
|
+
}
|
|
22
|
+
.lm-player-message-mask .lm-player-loading-icon {
|
|
23
|
+
position: relative;
|
|
24
|
+
font-size: 48px;
|
|
25
|
+
z-index: -1;
|
|
26
|
+
visibility: hidden;
|
|
27
|
+
}
|
|
28
|
+
.lm-player-message-mask .lm-player-loading-icon.lm-player-loading-animation {
|
|
29
|
+
visibility: visible;
|
|
30
|
+
z-index: 9;
|
|
31
|
+
animation: loadingAnimation 1s linear infinite;
|
|
32
|
+
}
|
|
33
|
+
.lm-player-message-mask .lm-player-loading-icon.lm-player-loadfail {
|
|
34
|
+
visibility: visible;
|
|
35
|
+
z-index: 9;
|
|
36
|
+
}
|
|
37
|
+
.lm-player-message-mask .lm-player-message {
|
|
38
|
+
color: #fff;
|
|
39
|
+
font-size: 16px;
|
|
40
|
+
padding: 10px;
|
|
41
|
+
}
|
|
42
|
+
@keyframes loadingAnimation {
|
|
43
|
+
form {
|
|
44
|
+
transform: rotate(0deg);
|
|
45
|
+
}
|
|
46
|
+
to {
|
|
47
|
+
transform: rotate(360deg);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
}
|
|
10
|
+
.slider-layout .slider-content {
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 2px;
|
|
13
|
+
position: relative;
|
|
14
|
+
transition: height 0.2s;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
.slider-layout .slider-other-content {
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 2px;
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: 0;
|
|
23
|
+
top: 50%;
|
|
24
|
+
transform: translateY(-50%);
|
|
25
|
+
transition: height 0.2s;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
z-index: 9;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
}
|
|
30
|
+
.slider-layout .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-layout .slider-visibel-line {
|
|
41
|
+
position: absolute;
|
|
42
|
+
background: #5b7eac;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
left: 0;
|
|
46
|
+
top: 0;
|
|
47
|
+
z-index: 3;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
}
|
|
51
|
+
.slider-layout .slider-current-line {
|
|
52
|
+
position: absolute;
|
|
53
|
+
background-color: #ffaa00;
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
left: 0;
|
|
57
|
+
top: 0;
|
|
58
|
+
z-index: 3;
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
}
|
|
61
|
+
.slider-layout .drag-change-icon {
|
|
62
|
+
position: absolute;
|
|
63
|
+
width: 6px;
|
|
64
|
+
height: 6px;
|
|
65
|
+
border-radius: 50%;
|
|
66
|
+
margin-left: -3px;
|
|
67
|
+
border: 1px solid #fff;
|
|
68
|
+
background-color: #ffaa00;
|
|
69
|
+
top: -3px;
|
|
70
|
+
pointer-events: all;
|
|
71
|
+
box-sizing: content-box;
|
|
72
|
+
}
|
|
73
|
+
.slider-layout:hover .slider-content,
|
|
74
|
+
.slider-layout:hover .slider-other-content {
|
|
75
|
+
height: 4px;
|
|
76
|
+
}
|
|
77
|
+
.slider-layout:hover .drag-change-icon {
|
|
78
|
+
width: 10px;
|
|
79
|
+
height: 10px;
|
|
80
|
+
top: -4px;
|
|
81
|
+
margin-left: -5px;
|
|
82
|
+
}
|
|
83
|
+
.lm-player-slide-tips {
|
|
84
|
+
background: rgba(0, 0, 0, 0.6);
|
|
85
|
+
position: absolute;
|
|
86
|
+
left: 0;
|
|
87
|
+
top: -26px;
|
|
88
|
+
transform: translate(-50%, -100%);
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
color: #fff;
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
z-index: 6;
|
|
93
|
+
padding: 2px 4px;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
z-index: 99;
|
|
96
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.player-timeline-layout {
|
|
2
|
+
position: absolute;
|
|
3
|
+
left: 0;
|
|
4
|
+
bottom: 28px;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 20px;
|
|
7
|
+
background: #000000;
|
|
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
|
+
}
|
|
16
|
+
.player-timeline-layout.hide-time-line {
|
|
17
|
+
bottom: 0;
|
|
18
|
+
height: 4px;
|
|
19
|
+
}
|
|
20
|
+
.player-timeline-layout .buffer-line {
|
|
21
|
+
position: absolute;
|
|
22
|
+
left: 0;
|
|
23
|
+
top: 0;
|
|
24
|
+
height: 100%;
|
|
25
|
+
background-color: #676767;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
max-width: 100%;
|
|
28
|
+
}
|
|
29
|
+
.player-timeline-layout .current-line {
|
|
30
|
+
position: absolute;
|
|
31
|
+
left: 0;
|
|
32
|
+
top: 0;
|
|
33
|
+
height: 100%;
|
|
34
|
+
background-color: #4661ff;
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
}
|
|
39
|
+
.player-timeline-layout.player-segment-timeline-layout {
|
|
40
|
+
background: transparent;
|
|
41
|
+
}
|
|
42
|
+
.player-timeline-layout.player-segment-timeline-layout .segment-line-box {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
display: flex;
|
|
46
|
+
}
|
|
47
|
+
.player-timeline-layout.player-segment-timeline-layout .segment-line-box .segment-line-item {
|
|
48
|
+
background: #000000;
|
|
49
|
+
position: relative;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
}
|
|
52
|
+
.player-timeline-layout.player-segment-timeline-layout .segment-line-box .segment-line-item:hover::after {
|
|
53
|
+
content: ' ';
|
|
54
|
+
width: 100%;
|
|
55
|
+
height: 100%;
|
|
56
|
+
left: 0;
|
|
57
|
+
top: 0;
|
|
58
|
+
border: 1px solid #fff;
|
|
59
|
+
z-index: 6;
|
|
60
|
+
position: absolute;
|
|
61
|
+
}
|
|
62
|
+
.player-timeline-layout.player-segment-timeline-layout .segment-line-box .segment-line-item.segment-line-item-none {
|
|
63
|
+
background: #de0e0e;
|
|
64
|
+
z-index: 6;
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
}
|
|
67
|
+
.player-timeline-layout.frontend-player-timeline-layout .frontend-line-mark {
|
|
68
|
+
position: absolute;
|
|
69
|
+
height: 100%;
|
|
70
|
+
width: 2px;
|
|
71
|
+
background-color: #fff;
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
}
|
|
74
|
+
.player-timeline-layout.frontend-player-timeline-layout .frontend-line-tip-box {
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: -130px;
|
|
77
|
+
color: #fff;
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
border-radius: 3px;
|
|
80
|
+
background-color: #000000;
|
|
81
|
+
padding: 10px;
|
|
82
|
+
width: 162px;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
margin-left: -81px;
|
|
85
|
+
}
|
|
86
|
+
.segment-line-tip-box {
|
|
87
|
+
font-size: 12px;
|
|
88
|
+
}
|
|
89
|
+
.segment-line-tip-box div {
|
|
90
|
+
margin: 0;
|
|
91
|
+
padding: 2px 0;
|
|
92
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type Api from './api';
|
|
3
|
+
import type VideoEventInstance from './event';
|
|
4
|
+
import './style/timeline.less';
|
|
5
|
+
interface ITimeLineProps {
|
|
6
|
+
api: Api;
|
|
7
|
+
event: VideoEventInstance;
|
|
8
|
+
}
|
|
9
|
+
export declare function useTimes(api: Api, event: VideoEventInstance, isHide?: boolean): number[];
|
|
10
|
+
declare function TimeLine({ api, event }: ITimeLineProps): JSX.Element;
|
|
11
|
+
export default TimeLine;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
14
|
+
import useBarStatus from './contraller_bar/useBarStatus';
|
|
15
|
+
import "./style/timeline.css";
|
|
16
|
+
export function useTimes(api, event, isHide) {
|
|
17
|
+
var _useState = useState({
|
|
18
|
+
currentTime: 0,
|
|
19
|
+
buffered: 0
|
|
20
|
+
}),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
state = _useState2[0],
|
|
23
|
+
setState = _useState2[1];
|
|
24
|
+
|
|
25
|
+
if (isHide) {
|
|
26
|
+
return [0, 0, 0];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
var getCurrentTime = function getCurrentTime() {
|
|
31
|
+
return setState(function (old) {
|
|
32
|
+
return Object.assign(Object.assign({}, old), {
|
|
33
|
+
currentTime: api.getCurrentTime(),
|
|
34
|
+
buffered: api.getSecondsLoaded()
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var getBuffered = function getBuffered() {
|
|
40
|
+
return setState(function (old) {
|
|
41
|
+
return Object.assign(Object.assign({}, old), {
|
|
42
|
+
buffered: api.getSecondsLoaded()
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var seekendPlay = function seekendPlay() {
|
|
48
|
+
return api.play();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
event.addEventListener('timeupdate', getCurrentTime);
|
|
52
|
+
event.addEventListener('progress', getBuffered);
|
|
53
|
+
event.addEventListener('suspend', getBuffered);
|
|
54
|
+
event.addEventListener('seeked', seekendPlay);
|
|
55
|
+
return function () {
|
|
56
|
+
event.removeEventListener('timeupdate', getCurrentTime);
|
|
57
|
+
event.removeEventListener('progress', getBuffered);
|
|
58
|
+
event.removeEventListener('suspend', getBuffered);
|
|
59
|
+
event.removeEventListener('seeked', seekendPlay);
|
|
60
|
+
};
|
|
61
|
+
}, [event, api]);
|
|
62
|
+
return [state.currentTime, state.buffered, api.getDuration()];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function TimeLine(_ref) {
|
|
66
|
+
var api = _ref.api,
|
|
67
|
+
event = _ref.event;
|
|
68
|
+
var status = useBarStatus(event);
|
|
69
|
+
|
|
70
|
+
var _useTimes = useTimes(api, event),
|
|
71
|
+
_useTimes2 = _slicedToArray(_useTimes, 3),
|
|
72
|
+
currentTime = _useTimes2[0],
|
|
73
|
+
buffered = _useTimes2[1],
|
|
74
|
+
duration = _useTimes2[2];
|
|
75
|
+
|
|
76
|
+
var playPercent = useMemo(function () {
|
|
77
|
+
return currentTime / duration * 100;
|
|
78
|
+
}, [currentTime]);
|
|
79
|
+
var bufferedPercent = useMemo(function () {
|
|
80
|
+
return buffered / duration * 100;
|
|
81
|
+
}, [buffered]);
|
|
82
|
+
var seekWithLine = useCallback(function (e) {
|
|
83
|
+
var rect = e.currentTarget.getBoundingClientRect();
|
|
84
|
+
var current = e.pageX - rect.left;
|
|
85
|
+
var cTime = current / rect.width * api.getDuration();
|
|
86
|
+
api.seekTo(cTime);
|
|
87
|
+
}, [api]);
|
|
88
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
className: "player-timeline-layout ".concat(status === 0 ? 'hide-time-line' : ''),
|
|
90
|
+
onClick: seekWithLine
|
|
91
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: "buffer-line",
|
|
93
|
+
style: {
|
|
94
|
+
width: "".concat(bufferedPercent, "%")
|
|
95
|
+
}
|
|
96
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: "current-line",
|
|
98
|
+
style: {
|
|
99
|
+
width: "".concat(playPercent, "%")
|
|
100
|
+
}
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default TimeLine;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Flvjs from 'flv.zv.js';
|
|
2
|
+
import Hls, { HlsConfig } from 'hls.js';
|
|
3
|
+
import type { FlvPlayerConfig } from './player';
|
|
4
|
+
/**
|
|
5
|
+
* 创建HLS对象
|
|
6
|
+
* @param {*} video
|
|
7
|
+
* @param {*} URL
|
|
8
|
+
*/
|
|
9
|
+
export declare function createHlsPlayer(video: HTMLVideoElement, url: string, hlsConfig: HlsConfig): Hls;
|
|
10
|
+
/**
|
|
11
|
+
* 创建FLV对象
|
|
12
|
+
* @param {*} video
|
|
13
|
+
* @param {*} options
|
|
14
|
+
*/
|
|
15
|
+
export declare function createFlvPlayer(video: HTMLVideoElement, url: string, isLive?: boolean, flvConfig?: FlvPlayerConfig): Flvjs.Player;
|
|
16
|
+
export declare const playReload: (video: HTMLVideoElement, flv?: Flvjs.Player, hls?: Hls, url?: string) => void;
|
|
17
|
+
export declare const playUnload: (video: HTMLVideoElement, flv?: Flvjs.Player, hls?: Hls) => void;
|
|
18
|
+
/**
|
|
19
|
+
* 获取播放文件类型
|
|
20
|
+
* @param {*} url
|
|
21
|
+
*/
|
|
22
|
+
export declare function getVideoType(url: string): "flv" | "native" | "m3u8";
|
|
23
|
+
export declare function timeStamp(second: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* 日期格式化
|
|
26
|
+
* @param {*} timetemp
|
|
27
|
+
*/
|
|
28
|
+
export declare function dateFormat(timetemp: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* 全屏
|
|
31
|
+
* @param {*} element
|
|
32
|
+
*/
|
|
33
|
+
export declare function fullscreen(element: HTMLElement): void;
|
|
34
|
+
/**
|
|
35
|
+
* exitFullscreen 退出全屏
|
|
36
|
+
* @param {Objct} element 选择器
|
|
37
|
+
*/
|
|
38
|
+
export declare function exitFullscreen(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 判读是否支持全屏
|
|
41
|
+
*/
|
|
42
|
+
export declare function fullscreenEnabled(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* [isFullscreen 判断浏览器是否全屏]
|
|
45
|
+
* @return [全屏则返回当前调用全屏的元素,不全屏返回false]
|
|
46
|
+
*/
|
|
47
|
+
export declare function isFullscreen(ele: HTMLElement): boolean;
|
|
48
|
+
export declare function getRandom(): string;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import Flvjs from 'flv.zv.js';
|
|
2
|
+
import Hls from 'hls.js';
|
|
3
|
+
/**
|
|
4
|
+
* 创建HLS对象
|
|
5
|
+
* @param {*} video
|
|
6
|
+
* @param {*} URL
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export function createHlsPlayer(video, url, hlsConfig) {
|
|
10
|
+
if (!Hls.isSupported()) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
var player = new Hls(Object.assign({
|
|
15
|
+
liveDurationInfinity: true,
|
|
16
|
+
fragLoadingMaxRetry: 0,
|
|
17
|
+
manifestLoadingMaxRetry: 0,
|
|
18
|
+
levelLoadingMaxRetry: 0,
|
|
19
|
+
enableWorker: true
|
|
20
|
+
}, hlsConfig));
|
|
21
|
+
player.loadSource(url);
|
|
22
|
+
player.attachMedia(video);
|
|
23
|
+
return player;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 创建FLV对象
|
|
27
|
+
* @param {*} video
|
|
28
|
+
* @param {*} options
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export function createFlvPlayer(video, url, isLive, flvConfig) {
|
|
32
|
+
if (!Flvjs.isSupported()) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var mediaDataSource = Object.assign({
|
|
37
|
+
type: 'flv',
|
|
38
|
+
url: url
|
|
39
|
+
}, flvConfig.mediaDataSource);
|
|
40
|
+
var config = Object.assign({
|
|
41
|
+
enableWorker: true,
|
|
42
|
+
// lazyLoad: false,
|
|
43
|
+
// Indicates how many seconds of data to be kept for lazyLoad.
|
|
44
|
+
// lazyLoadMaxDuration: 0,
|
|
45
|
+
// autoCleanupMaxBackwardDuration: 3,
|
|
46
|
+
// autoCleanupMinBackwardDuration: 2,
|
|
47
|
+
// autoCleanupSourceBuffer: true,
|
|
48
|
+
enableStashBuffer: false,
|
|
49
|
+
stashInitialSize: 128,
|
|
50
|
+
isLive: isLive !== null && isLive !== void 0 ? isLive : true
|
|
51
|
+
}, flvConfig.config);
|
|
52
|
+
var player = Flvjs.createPlayer(mediaDataSource, config);
|
|
53
|
+
player.attachMediaElement(video);
|
|
54
|
+
player.load();
|
|
55
|
+
return player;
|
|
56
|
+
}
|
|
57
|
+
export var playReload = function playReload(video, flv, hls, url) {
|
|
58
|
+
video.pause();
|
|
59
|
+
video.removeAttribute('src');
|
|
60
|
+
|
|
61
|
+
if (flv) {
|
|
62
|
+
flv.unload();
|
|
63
|
+
flv.load();
|
|
64
|
+
flv.play();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (hls) {
|
|
68
|
+
hls.swapAudioCodec();
|
|
69
|
+
hls.recoverMediaError();
|
|
70
|
+
hls.stopLoad();
|
|
71
|
+
hls.startLoad();
|
|
72
|
+
hls.loadSource(url);
|
|
73
|
+
video.play();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (!flv && !hls) {
|
|
77
|
+
video.setAttribute('src', url);
|
|
78
|
+
video.play();
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export var playUnload = function playUnload(video, flv, hls) {
|
|
82
|
+
video.pause();
|
|
83
|
+
|
|
84
|
+
if (flv) {
|
|
85
|
+
flv.unload();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (hls) {
|
|
90
|
+
hls.stopLoad();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
video.removeAttribute('src');
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* 获取播放文件类型
|
|
98
|
+
* @param {*} url
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
export function getVideoType(url) {
|
|
102
|
+
if (!url) {
|
|
103
|
+
return 'native';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return url.indexOf('.flv') > -1 ? 'flv' : url.indexOf('.m3u8') > -1 ? 'm3u8' : 'native';
|
|
107
|
+
}
|
|
108
|
+
export function timeStamp(second) {
|
|
109
|
+
// 转换为式分秒
|
|
110
|
+
var h = Math.round(second / 60 / 60 % 24);
|
|
111
|
+
var m = Math.round(second / 60 % 60);
|
|
112
|
+
var s = Math.round(second % 60);
|
|
113
|
+
|
|
114
|
+
if (h === 0) {
|
|
115
|
+
return "".concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return "".concat(h < 10 ? '0' + h : h, ":").concat(m < 10 ? '0' + m : m, ":").concat(s < 10 ? '0' + s : s);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 日期格式化
|
|
122
|
+
* @param {*} timetemp
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
export function dateFormat(timetemp) {
|
|
126
|
+
var date = new Date(timetemp);
|
|
127
|
+
var YYYY = date.getFullYear();
|
|
128
|
+
var DD = date.getDate();
|
|
129
|
+
var MM = date.getMonth() + 1;
|
|
130
|
+
var hh = date.getHours();
|
|
131
|
+
var mm = date.getMinutes();
|
|
132
|
+
var ss = date.getSeconds();
|
|
133
|
+
return "".concat(YYYY, ".").concat(MM > 9 ? MM : '0' + MM, ".").concat(DD > 9 ? DD : '0' + DD, " ").concat(hh > 9 ? hh : '0' + hh, ".").concat(mm > 9 ? mm : '0' + mm, ".").concat(ss > 9 ? ss : '0' + ss);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* 全屏
|
|
137
|
+
* @param {*} element
|
|
138
|
+
*/
|
|
139
|
+
|
|
140
|
+
export function fullscreen(element) {
|
|
141
|
+
element.requestFullscreen();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* exitFullscreen 退出全屏
|
|
145
|
+
* @param {Objct} element 选择器
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
export function exitFullscreen() {
|
|
149
|
+
document.exitFullscreen();
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 判读是否支持全屏
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
export function fullscreenEnabled() {
|
|
156
|
+
return document.fullscreenEnabled;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* [isFullscreen 判断浏览器是否全屏]
|
|
160
|
+
* @return [全屏则返回当前调用全屏的元素,不全屏返回false]
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
export function isFullscreen(ele) {
|
|
164
|
+
if (!ele) {
|
|
165
|
+
return false;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return document.fullscreenElement === ele;
|
|
169
|
+
}
|
|
170
|
+
export function getRandom() {
|
|
171
|
+
return Math.random().toString(36).substr(2);
|
|
172
|
+
}
|
package/es/Progress/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* tree 基础组件支持各种自定义其他tree可用过它来拓展
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { DataNode, TreeProps } from 'antd/lib/tree';
|
|
5
|
+
import type { DataNode, TreeProps } from 'antd/lib/tree';
|
|
6
6
|
import './index.less';
|
|
7
7
|
export interface ITreeNodeProps {
|
|
8
8
|
prefix?: (node: DataNode) => JSX.Element;
|
|
@@ -12,7 +12,7 @@ export interface ITreeNodeProps {
|
|
|
12
12
|
nameKey?: string;
|
|
13
13
|
RenderTreeTitle?: (node: DataNode) => JSX.Element;
|
|
14
14
|
}
|
|
15
|
-
export interface BaseTreeProps extends TreeProps {
|
|
15
|
+
export interface BaseTreeProps extends Omit<TreeProps, 'icon'> {
|
|
16
16
|
checkable?: boolean;
|
|
17
17
|
className?: string;
|
|
18
18
|
treeData?: DataNode[] | any[];
|
package/es/Tree/demo.d.ts
CHANGED
package/es/Tree/index.js
CHANGED
package/es/UserSelect/demo.d.ts
CHANGED