@desynova-digital/player 3.9.7 → 4.0.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/Player.js +945 -0
- package/control/AudioTracksMenuButton.js +91 -0
- package/control/AudioTracksMenuButton.jsx +80 -0
- package/control/ControlBar.js +303 -0
- package/control/ControlBar.jsx +264 -0
- package/control/CurrentTimeDisplay.js +34 -0
- package/control/CurrentTimeDisplay.jsx +35 -0
- package/control/DurationDisplay.js +38 -0
- package/control/DurationDisplay.jsx +48 -0
- package/control/ForwardBackwardControl.js +76 -0
- package/control/ForwardBackwardControl.jsx +79 -0
- package/control/FullscreenToggle.js +82 -0
- package/control/FullscreenToggle.jsx +83 -0
- package/control/MarkInControl.js +124 -0
- package/control/MarkInControl.jsx +109 -0
- package/control/MarkOutControl.js +137 -0
- package/control/MarkOutControl.jsx +131 -0
- package/control/MarkerBar.js +127 -0
- package/control/MarkerBar.jsx +107 -0
- package/control/MarkingControl.js +82 -0
- package/control/MarkingControl.jsx +143 -0
- package/control/MarkingDuration.js +44 -0
- package/control/MarkingPreview.js +49 -0
- package/control/MarkingPreview.jsx +60 -0
- package/control/PlayBackRateControl.js +106 -0
- package/control/PlayBackRateControl.jsx +106 -0
- package/control/PlayProgressBar.js +61 -0
- package/control/PlayProgressBar.jsx +92 -0
- package/control/PlayToggle.js +56 -0
- package/control/PlayToggle.jsx +57 -0
- package/control/PointersBar.js +231 -0
- package/control/PointersBar.jsx +286 -0
- package/control/ProgressControl.js +127 -0
- package/control/ProgressControl.jsx +155 -0
- package/control/SeekBar.js +204 -0
- package/control/SeekBar.jsx +229 -0
- package/control/SettingsMenuButton.js +63 -0
- package/control/SettingsMenuButton.jsx +69 -0
- package/control/Slider.js +274 -0
- package/control/Slider.jsx +243 -0
- package/control/Timeline.js +118 -0
- package/control/Timeline.jsx +131 -0
- package/control/VolumeBar.js +198 -0
- package/control/VolumeBar.jsx +174 -0
- package/control/VolumeLevel.js +61 -0
- package/control/VolumeLevel.jsx +66 -0
- package/control/VolumneMenuButton.js +112 -0
- package/control/VolumneMenuButton.jsx +111 -0
- package/header/Header.js +309 -0
- package/header/Header.jsx +479 -0
- package/index.js +9 -151
- package/media/AudioMeter.js +381 -0
- package/media/AudioMeter.jsx +411 -0
- package/media/SDOutline.js +82 -0
- package/media/SDOutline.jsx +90 -0
- package/media/Video.js +684 -0
- package/media/Video.jsx +714 -0
- package/package.json +5 -1
- package/playlist/Playlist.js +67 -0
- package/playlist/Playlist.jsx +91 -0
- package/playlist/index.js +13 -0
- package/shortcuts/Shortcut.js +662 -0
- package/utils/Menu.js +50 -0
- package/utils/Menu.jsx +105 -0
- package/{colors.js → utils/colors.js} +13 -13
- package/utils/dom.js +6 -16
- package/utils/index.js +52 -122
- package/Manager.js +0 -124
- package/actions/player.js +0 -375
- package/actions/video.js +0 -230
- package/components/AudioMeter.js +0 -414
- package/components/BigPlayButton.js +0 -110
- package/components/ImageViewer.js +0 -318
- package/components/MarkerBar.js +0 -138
- package/components/Menu.js +0 -77
- package/components/Player.js +0 -821
- package/components/PlayerHeader.js +0 -472
- package/components/Playlist.js +0 -133
- package/components/PointersBar.js +0 -299
- package/components/PosterImage.js +0 -61
- package/components/SDOutline.js +0 -68
- package/components/Shortcut.js +0 -621
- package/components/Slider.js +0 -317
- package/components/TagsBar.js +0 -100
- package/components/Video.js +0 -1431
- package/components/control-bar/AudioTracksMenuButton.js +0 -113
- package/components/control-bar/CameraButton.js +0 -88
- package/components/control-bar/CommentsButton.js +0 -216
- package/components/control-bar/ControlBar.js +0 -260
- package/components/control-bar/EditorControlMenuButton.js +0 -412
- package/components/control-bar/ForwardControl.js +0 -17
- package/components/control-bar/ForwardReplayControl.js +0 -122
- package/components/control-bar/FullscreenToggle.js +0 -101
- package/components/control-bar/PlayToggle.js +0 -98
- package/components/control-bar/ReplayControl.js +0 -17
- package/components/control-bar/SettingsMenuButton.js +0 -43
- package/components/control-bar/SubtitleLanguagesMenuButton.js +0 -174
- package/components/control-bar/VolumeMenuButton.js +0 -134
- package/components/control-bar/ZoomMenuButton.js +0 -116
- package/components/marking-controls/MarkInControl.js +0 -140
- package/components/marking-controls/MarkOutControl.js +0 -155
- package/components/marking-controls/MarkingAddButton.js +0 -94
- package/components/marking-controls/MarkingControl.js +0 -135
- package/components/marking-controls/MarkingDeleteButton.js +0 -84
- package/components/marking-controls/MarkingDuration.js +0 -77
- package/components/marking-controls/MarkingPreview.js +0 -86
- package/components/progress-bar/AudioWaveform.js +0 -144
- package/components/progress-bar/LoadProgressBar.js +0 -90
- package/components/progress-bar/MouseTimeDisplay.js +0 -53
- package/components/progress-bar/PlayProgressBar.js +0 -79
- package/components/progress-bar/ProgressControl.js +0 -222
- package/components/progress-bar/SeekBar.js +0 -261
- package/components/progress-bar/Timeline.js +0 -134
- package/components/settings-menu-control/PlaybackRateControl.js +0 -147
- package/components/settings-menu-control/SafeAreaControl.js +0 -92
- package/components/settings-menu-control/SettingsMenu.js +0 -68
- package/components/settings-menu-control/SubtitleControl.js +0 -1
- package/components/time-controls/CurrentTimeDisplay.js +0 -53
- package/components/time-controls/DurationDisplay.js +0 -51
- package/components/time-controls/TimeDivider.js +0 -41
- package/components/volume-control/VolumeBar.js +0 -216
- package/components/volume-control/VolumeControl.js +0 -35
- package/components/volume-control/VolumeLevel.js +0 -78
- package/components/zoom-control/ZoomBar.js +0 -189
- package/components/zoom-control/ZoomLevel.js +0 -68
- package/reducers/index.js +0 -23
- package/reducers/operation.js +0 -36
- package/reducers/player.js +0 -222
- package/utils/browser.js +0 -29
- package/utils/fullscreen.js +0 -73
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropTypes } from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import colors from '../utils/colors';
|
|
5
|
+
import PlayToggle from './PlayToggle';
|
|
6
|
+
// import { mergeAndSortChildren } from '../utils';
|
|
7
|
+
import ForwardBackWardComponent from './ForwardBackwardControl';
|
|
8
|
+
import CurrentTimeDisplay from './CurrentTimeDisplay';
|
|
9
|
+
import DurationDisplay from './DurationDisplay';
|
|
10
|
+
import VolumeMenuButton from './VolumneMenuButton';
|
|
11
|
+
import AudioTracksMenuButton from './AudioTracksMenuButton';
|
|
12
|
+
import SettingsMenuButton from './SettingsMenuButton';
|
|
13
|
+
import FullscreenToggle from './FullscreenToggle';
|
|
14
|
+
import MarkingControl from './MarkingControl';
|
|
15
|
+
|
|
16
|
+
const PlayerControlBlock = styled.div`
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: ${(props) => ((props.player === 'panel' && props.active) || props.player !== 'panel' ? '50px' : '0px')};
|
|
19
|
+
overflow: ${(props) =>
|
|
20
|
+
(props.player === 'panel' && props.active) || props.player !== 'panel' ? 'visible' : 'hidden'};
|
|
21
|
+
position: ${(props) => (props.player === 'panel' ? 'absolute' : 'relative')};
|
|
22
|
+
bottom: ${(props) => (props.player === 'panel' ? '0px' : 'initial')};
|
|
23
|
+
background: ${colors.common.base.black};
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
align-items: center;
|
|
27
|
+
transition: all 250ms ease-in-out;
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const VideoControlBlock = styled.div`
|
|
31
|
+
width: 100%;
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: flex-start;
|
|
34
|
+
align-items: center;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
const ControlBar = ({
|
|
38
|
+
playerType,
|
|
39
|
+
actionClick,
|
|
40
|
+
controlType,
|
|
41
|
+
paused,
|
|
42
|
+
userActivity,
|
|
43
|
+
currentTime,
|
|
44
|
+
initialTime,
|
|
45
|
+
frameRate,
|
|
46
|
+
duration,
|
|
47
|
+
muted,
|
|
48
|
+
assetType,
|
|
49
|
+
volume,
|
|
50
|
+
isFullscreen,
|
|
51
|
+
audioTracksArr, //audio tracks props
|
|
52
|
+
activeAudio,
|
|
53
|
+
SDBorderActive, //settings menu props
|
|
54
|
+
playbackRate,
|
|
55
|
+
onAddMarker, //markers props
|
|
56
|
+
onDeleteMarker,
|
|
57
|
+
allowMarkerOverlap,
|
|
58
|
+
playerReadOnlyMode,
|
|
59
|
+
disablePlayerActions,
|
|
60
|
+
playerSelectedMarker,
|
|
61
|
+
markers
|
|
62
|
+
}) => {
|
|
63
|
+
const getDefaultChildren = () => {
|
|
64
|
+
return [
|
|
65
|
+
<PlayToggle paused={paused} actionClick={actionClick} key="play-toggle" />,
|
|
66
|
+
<ForwardBackWardComponent mode="replay" seconds={10} actionClick={actionClick} key="replay-control-10" />,
|
|
67
|
+
<ForwardBackWardComponent mode="replay" actionClick={actionClick} key="replay-control" />,
|
|
68
|
+
<ForwardBackWardComponent mode="forward" actionClick={actionClick} key="forward-control" />,
|
|
69
|
+
<ForwardBackWardComponent mode="forward" seconds={10} actionClick={actionClick} key="forward-control-10" />,
|
|
70
|
+
<CurrentTimeDisplay
|
|
71
|
+
currentTime={currentTime}
|
|
72
|
+
initialTime={initialTime}
|
|
73
|
+
frameRate={frameRate}
|
|
74
|
+
key="current-time-display"
|
|
75
|
+
/>,
|
|
76
|
+
<DurationDisplay duration={duration} frameRate={frameRate} key="duration-display" />,
|
|
77
|
+
<VolumeMenuButton
|
|
78
|
+
muted={muted}
|
|
79
|
+
assetType={assetType}
|
|
80
|
+
playerType={playerType}
|
|
81
|
+
actionClick={actionClick}
|
|
82
|
+
volume={volume}
|
|
83
|
+
style={{ margin: 'auto 10px auto auto' }}
|
|
84
|
+
key="volume-menu-button"
|
|
85
|
+
/>,
|
|
86
|
+
<AudioTracksMenuButton
|
|
87
|
+
audioTracksArr={audioTracksArr}
|
|
88
|
+
activeAudio={activeAudio}
|
|
89
|
+
actionClick={actionClick}
|
|
90
|
+
key="audio-tracks-menu-button"
|
|
91
|
+
/>,
|
|
92
|
+
<SettingsMenuButton
|
|
93
|
+
actionClick={actionClick}
|
|
94
|
+
SDBorderActive={SDBorderActive}
|
|
95
|
+
playbackRate={playbackRate}
|
|
96
|
+
key="settings-menu-button"
|
|
97
|
+
/>,
|
|
98
|
+
<FullscreenToggle key="fullscreen-toggle" actionClick={actionClick} style={{ marginRight: '10px' }} />
|
|
99
|
+
|
|
100
|
+
// // <CommentsButton {...this.props} key="comments-button" order={6.01} />,
|
|
101
|
+
// // <EditorControlMenuButton
|
|
102
|
+
// // style={{ margin: 'auto 10px auto auto' }}
|
|
103
|
+
// // {...this.props}
|
|
104
|
+
// // key="edit-menu-button"
|
|
105
|
+
// // order={6.1}
|
|
106
|
+
// // />,
|
|
107
|
+
// <VolumeMenuButton
|
|
108
|
+
// style={{ margin: 'auto 10px auto auto' }}
|
|
109
|
+
// {...this.props}
|
|
110
|
+
// key="volume-menu-button"
|
|
111
|
+
// order={7}
|
|
112
|
+
// />,
|
|
113
|
+
// <SubtitleLanguagesMenuButton
|
|
114
|
+
// {...this.props}
|
|
115
|
+
// key="subtitle-menu-button"
|
|
116
|
+
// order={7}
|
|
117
|
+
// />,
|
|
118
|
+
// <AudioTracksMenuButton
|
|
119
|
+
// {...this.props}
|
|
120
|
+
// key="audio-tracks-menu-button"
|
|
121
|
+
// order={7}
|
|
122
|
+
// />,
|
|
123
|
+
// <SettingsMenuButton
|
|
124
|
+
// {...this.props}
|
|
125
|
+
// key="settings-menu-button"
|
|
126
|
+
// order={8}
|
|
127
|
+
// />,
|
|
128
|
+
// <FullscreenToggle {...this.props} key="fullscreen-toggle" order={9} style={{ marginRight: '10px' }} />
|
|
129
|
+
];
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const getAdvancedChildren = () => {
|
|
133
|
+
return [
|
|
134
|
+
<PlayToggle paused={paused} actionClick={actionClick} key="play-toggle" />,
|
|
135
|
+
<ForwardBackWardComponent mode="replay" seconds={10} actionClick={actionClick} key="replay-control-10" />,
|
|
136
|
+
<ForwardBackWardComponent mode="replay" actionClick={actionClick} key="replay-control" />,
|
|
137
|
+
<ForwardBackWardComponent mode="forward" actionClick={actionClick} key="forward-control" />,
|
|
138
|
+
<ForwardBackWardComponent mode="forward" seconds={10} actionClick={actionClick} key="forward-control-10" />,
|
|
139
|
+
<CurrentTimeDisplay
|
|
140
|
+
currentTime={currentTime}
|
|
141
|
+
initialTime={initialTime}
|
|
142
|
+
frameRate={frameRate}
|
|
143
|
+
key="current-time-display"
|
|
144
|
+
/>,
|
|
145
|
+
<DurationDisplay duration={duration} frameRate={frameRate} key="duration-display" />,
|
|
146
|
+
<MarkingControl
|
|
147
|
+
frameRate={frameRate}
|
|
148
|
+
actionClick={actionClick}
|
|
149
|
+
onAddMarker={onAddMarker}
|
|
150
|
+
onDeleteMarker={onDeleteMarker}
|
|
151
|
+
markers={markers}
|
|
152
|
+
controlType={controlType}
|
|
153
|
+
playerType={playerType}
|
|
154
|
+
allowMarkerOverlap={allowMarkerOverlap}
|
|
155
|
+
playerReadOnlyMode={playerReadOnlyMode}
|
|
156
|
+
disablePlayerActions={disablePlayerActions}
|
|
157
|
+
playerSelectedMarker={playerSelectedMarker}
|
|
158
|
+
currentTime={currentTime}
|
|
159
|
+
key="marking-controls"
|
|
160
|
+
/>,
|
|
161
|
+
<VolumeMenuButton
|
|
162
|
+
muted={muted}
|
|
163
|
+
assetType={assetType}
|
|
164
|
+
playerType={playerType}
|
|
165
|
+
actionClick={actionClick}
|
|
166
|
+
volume={volume}
|
|
167
|
+
style={{ margin: 'auto 10px auto auto' }}
|
|
168
|
+
key="volume-menu-button"
|
|
169
|
+
/>,
|
|
170
|
+
<AudioTracksMenuButton
|
|
171
|
+
audioTracksArr={audioTracksArr}
|
|
172
|
+
activeAudio={activeAudio}
|
|
173
|
+
actionClick={actionClick}
|
|
174
|
+
key="audio-tracks-menu-button"
|
|
175
|
+
/>,
|
|
176
|
+
<SettingsMenuButton
|
|
177
|
+
actionClick={actionClick}
|
|
178
|
+
SDBorderActive={SDBorderActive}
|
|
179
|
+
playbackRate={playbackRate}
|
|
180
|
+
key="settings-menu-button"
|
|
181
|
+
/>,
|
|
182
|
+
<FullscreenToggle key="fullscreen-toggle" actionClick={actionClick} style={{ marginRight: '10px' }} />
|
|
183
|
+
|
|
184
|
+
// <ReplayControl {...this.props} key="replay-control" order={3.1} />,
|
|
185
|
+
// <ForwardControl {...this.props} key="forward-control" order={4} />,
|
|
186
|
+
// <ForwardControl {...this.props} seconds={10} key="forward-control-10" order={4.1} />,
|
|
187
|
+
// <CurrentTimeDisplay
|
|
188
|
+
// {...this.props}
|
|
189
|
+
// key="current-time-display"
|
|
190
|
+
// order={5.1}
|
|
191
|
+
// />,
|
|
192
|
+
// <TimeDivider {...this.props} key="time-divider" order={5.2} />,
|
|
193
|
+
// <DurationDisplay {...this.props} key="duration-display" order={5.3} />,
|
|
194
|
+
// <MarkingControl {...this.props} key="marking-controls" order={6} />,
|
|
195
|
+
// // {/* <CommentsButton {...this.props} key="comments-button" order={6.01} />, */}
|
|
196
|
+
// // {/* <ZoomMenuButton
|
|
197
|
+
// // style={{ marginLeft: '0 10px' }}
|
|
198
|
+
// // {...this.props}
|
|
199
|
+
// // key="zoom-menu-button"
|
|
200
|
+
// // order={7}
|
|
201
|
+
// // />, */}
|
|
202
|
+
// // <EditorControlMenuButton
|
|
203
|
+
// // style={{ margin: 'auto 10px auto auto' }}
|
|
204
|
+
// // {...this.props}
|
|
205
|
+
// // key="edit-menu-button"
|
|
206
|
+
// // order={7}
|
|
207
|
+
// // />,
|
|
208
|
+
// <VolumeMenuButton
|
|
209
|
+
// style={{ margin: 'auto 10px auto auto' }}
|
|
210
|
+
// {...this.props}
|
|
211
|
+
// key="volume-menu-button"
|
|
212
|
+
// order={8}
|
|
213
|
+
// />,
|
|
214
|
+
// <SubtitleLanguagesMenuButton
|
|
215
|
+
// {...this.props}
|
|
216
|
+
// key="subtitle-menu-button"
|
|
217
|
+
// order={8}
|
|
218
|
+
// />,
|
|
219
|
+
// <CameraButton
|
|
220
|
+
// order={9}
|
|
221
|
+
// playerType={playerType}
|
|
222
|
+
// />,
|
|
223
|
+
// <SubtitleMovementMenu
|
|
224
|
+
// {...this.props}
|
|
225
|
+
// key="subtitle-movement-menu"
|
|
226
|
+
// order={8}
|
|
227
|
+
// />,
|
|
228
|
+
// <AudioTracksMenuButton
|
|
229
|
+
// {...this.props}
|
|
230
|
+
// key="audio-tracks-menu-button"
|
|
231
|
+
// order={9}
|
|
232
|
+
// />,
|
|
233
|
+
// <SettingsMenuButton
|
|
234
|
+
// {...this.props}
|
|
235
|
+
// key="settings-menu-button"
|
|
236
|
+
// order={10}
|
|
237
|
+
// />,
|
|
238
|
+
// <FullscreenToggle {...this.props} key="fullscreen-toggle" order={11} style={{ marginRight: '10px' }}/>
|
|
239
|
+
];
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const getChildren = () => {
|
|
243
|
+
// const { controlType, children, fileType, player } = this.props;
|
|
244
|
+
// const childrens = React.Children.toArray(children);
|
|
245
|
+
let defaultChildren = [];
|
|
246
|
+
// if(fileType === 'image') {
|
|
247
|
+
// defaultChildren = this.getImageChildrens();
|
|
248
|
+
// } else {
|
|
249
|
+
defaultChildren = controlType === 'advanced' && !isFullscreen ? getAdvancedChildren() : getDefaultChildren();
|
|
250
|
+
// }
|
|
251
|
+
|
|
252
|
+
return defaultChildren; // mergeAndSortChildren(defaultChildren, []);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const children = getChildren();
|
|
256
|
+
|
|
257
|
+
return (
|
|
258
|
+
<PlayerControlBlock id="controls-container" active={(userActivity && userActivity) || null} player={playerType}>
|
|
259
|
+
<VideoControlBlock>{children}</VideoControlBlock>
|
|
260
|
+
</PlayerControlBlock>
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export default ControlBar;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
var _templateObject;
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
+
var propTypes = {
|
|
15
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
16
|
+
initialTime: _propTypes.PropTypes.number,
|
|
17
|
+
frameRate: _propTypes.PropTypes.number
|
|
18
|
+
};
|
|
19
|
+
var defaultProps = {
|
|
20
|
+
player: {}
|
|
21
|
+
};
|
|
22
|
+
var VideoCurrentTime = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: SFUIText-Regular;\n font-size: 12px;\n letter-spacing: -0.6px;\n color: #ffffff;\n min-width: 65px;\n text-align: left;\n"])));
|
|
23
|
+
var CurrentTimeDisplay = function CurrentTimeDisplay(_ref) {
|
|
24
|
+
var currentTime = _ref.currentTime,
|
|
25
|
+
initialTime = _ref.initialTime,
|
|
26
|
+
frameRate = _ref.frameRate;
|
|
27
|
+
var formattedTime = (0, _utils.secondsToTime)(currentTime.seconds, frameRate, initialTime);
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(VideoCurrentTime, null, formattedTime);
|
|
29
|
+
};
|
|
30
|
+
CurrentTimeDisplay.propTypes = propTypes;
|
|
31
|
+
CurrentTimeDisplay.defaultProps = defaultProps;
|
|
32
|
+
CurrentTimeDisplay.displayName = 'CurrentTimeDisplay';
|
|
33
|
+
var _default = CurrentTimeDisplay;
|
|
34
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PropTypes } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import { secondsToTime } from '../utils';
|
|
6
|
+
|
|
7
|
+
const propTypes = {
|
|
8
|
+
player: PropTypes.instanceOf(Object),
|
|
9
|
+
initialTime: PropTypes.number,
|
|
10
|
+
frameRate: PropTypes.number
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const defaultProps = {
|
|
14
|
+
player: {}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const VideoCurrentTime = styled.div`
|
|
18
|
+
font-family: SFUIText-Regular;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
letter-spacing: -0.6px;
|
|
21
|
+
color: #ffffff;
|
|
22
|
+
min-width: 65px;
|
|
23
|
+
text-align: left;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const CurrentTimeDisplay = ({ currentTime, initialTime, frameRate }) => {
|
|
27
|
+
const formattedTime = secondsToTime(currentTime.seconds, frameRate, initialTime);
|
|
28
|
+
return <VideoCurrentTime>{formattedTime}</VideoCurrentTime>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
CurrentTimeDisplay.propTypes = propTypes;
|
|
32
|
+
CurrentTimeDisplay.defaultProps = defaultProps;
|
|
33
|
+
CurrentTimeDisplay.displayName = 'CurrentTimeDisplay';
|
|
34
|
+
|
|
35
|
+
export default CurrentTimeDisplay;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
var _templateObject, _templateObject2;
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
+
var propTypes = {
|
|
15
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
16
|
+
frameRate: _propTypes.PropTypes.number,
|
|
17
|
+
separator: _propTypes.PropTypes.string
|
|
18
|
+
};
|
|
19
|
+
var defaultProps = {
|
|
20
|
+
player: {}
|
|
21
|
+
};
|
|
22
|
+
var VideoTotalDuration = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-family: SFUIText-Regular;\n font-size: 12px;\n letter-spacing: -0.6px;\n margin: 0 2px;\n color: #888888;\n"])));
|
|
23
|
+
var TimeSeperator = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: #888888;\n margin: 0 2px;\n font-family: SFUIText-Regular;\n font-size: 12px;\n letter-spacing: -0.6px;\n"])));
|
|
24
|
+
function DurationDisplay(_ref) {
|
|
25
|
+
var duration = _ref.duration,
|
|
26
|
+
frameRate = _ref.frameRate,
|
|
27
|
+
separator = _ref.separator;
|
|
28
|
+
var formattedTime = (0, _utils.secondsToTime)(duration.seconds, frameRate);
|
|
29
|
+
var separatorText = separator || '/';
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(TimeSeperator, {
|
|
31
|
+
dir: "ltr"
|
|
32
|
+
}, separatorText), /*#__PURE__*/_react["default"].createElement(VideoTotalDuration, null, formattedTime));
|
|
33
|
+
}
|
|
34
|
+
DurationDisplay.propTypes = propTypes;
|
|
35
|
+
DurationDisplay.defaultProps = defaultProps;
|
|
36
|
+
DurationDisplay.displayName = 'DurationDisplay';
|
|
37
|
+
var _default = DurationDisplay;
|
|
38
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PropTypes } from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import { secondsToTime } from '../utils';
|
|
6
|
+
|
|
7
|
+
const propTypes = {
|
|
8
|
+
player: PropTypes.instanceOf(Object),
|
|
9
|
+
frameRate: PropTypes.number,
|
|
10
|
+
separator: PropTypes.string
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const defaultProps = {
|
|
14
|
+
player: {}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const VideoTotalDuration = styled.div`
|
|
18
|
+
font-family: SFUIText-Regular;
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
letter-spacing: -0.6px;
|
|
21
|
+
margin: 0 2px;
|
|
22
|
+
color: #888888;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const TimeSeperator = styled.div`
|
|
26
|
+
color: #888888;
|
|
27
|
+
margin: 0 2px;
|
|
28
|
+
font-family: SFUIText-Regular;
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
letter-spacing: -0.6px;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
function DurationDisplay({ duration, frameRate, separator }) {
|
|
34
|
+
const formattedTime = secondsToTime(duration.seconds, frameRate);
|
|
35
|
+
const separatorText = separator || '/';
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<TimeSeperator dir="ltr">{separatorText}</TimeSeperator>
|
|
39
|
+
<VideoTotalDuration>{formattedTime}</VideoTotalDuration>
|
|
40
|
+
</>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
DurationDisplay.propTypes = propTypes;
|
|
45
|
+
DurationDisplay.defaultProps = defaultProps;
|
|
46
|
+
DurationDisplay.displayName = 'DurationDisplay';
|
|
47
|
+
|
|
48
|
+
export default DurationDisplay;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _components = require("@desynova-digital/components");
|
|
11
|
+
var _templateObject,
|
|
12
|
+
_this = void 0;
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
var ForwardReplayButton = (0, _styledComponents["default"])(_components.Button)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0 10px;\n &:hover,\n &:focus {\n background: transparent;\n }\n"])));
|
|
16
|
+
var propTypes = {
|
|
17
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
18
|
+
seconds: _propTypes.PropTypes.number
|
|
19
|
+
};
|
|
20
|
+
var defaultProps = {
|
|
21
|
+
actions: {},
|
|
22
|
+
seconds: 0.04
|
|
23
|
+
};
|
|
24
|
+
var ForwardBackWardComponent = function ForwardBackWardComponent(_ref) {
|
|
25
|
+
var mode = _ref.mode,
|
|
26
|
+
seconds = _ref.seconds,
|
|
27
|
+
actionClick = _ref.actionClick;
|
|
28
|
+
var getIcon = function getIcon() {
|
|
29
|
+
var icon = '';
|
|
30
|
+
if (mode === 'forward') {
|
|
31
|
+
if (seconds === 10) {
|
|
32
|
+
icon = 'forward-10';
|
|
33
|
+
} else {
|
|
34
|
+
icon = 'triangle-double-right';
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
if (seconds === 10) {
|
|
38
|
+
icon = 'rewind-10';
|
|
39
|
+
} else {
|
|
40
|
+
icon = 'triangle-double-left';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return icon;
|
|
44
|
+
};
|
|
45
|
+
var handleClick = function handleClick() {
|
|
46
|
+
// Depends mode to implement different actions
|
|
47
|
+
if (mode === 'forward') {
|
|
48
|
+
actionClick({
|
|
49
|
+
action: 'add_seconds',
|
|
50
|
+
value: seconds
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
actionClick({
|
|
54
|
+
action: 'add_seconds',
|
|
55
|
+
value: -seconds
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement(ForwardReplayButton, {
|
|
60
|
+
display: "rounded",
|
|
61
|
+
appearance: "cta",
|
|
62
|
+
icon: getIcon(),
|
|
63
|
+
iconWidth: seconds === 10 ? 22 : 14,
|
|
64
|
+
iconHeight: seconds === 10 ? 22 : 14,
|
|
65
|
+
width: 20,
|
|
66
|
+
height: 20,
|
|
67
|
+
ref: function ref(c) {
|
|
68
|
+
_this.button = c;
|
|
69
|
+
},
|
|
70
|
+
onClick: handleClick
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
ForwardBackWardComponent.propTypes = propTypes;
|
|
74
|
+
ForwardBackWardComponent.defaultProps = defaultProps;
|
|
75
|
+
var _default = ForwardBackWardComponent;
|
|
76
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PropTypes } from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Button } from '@desynova-digital/components';
|
|
5
|
+
|
|
6
|
+
const ForwardReplayButton = styled(Button)`
|
|
7
|
+
background: transparent;
|
|
8
|
+
border: none;
|
|
9
|
+
margin: 0 10px;
|
|
10
|
+
&:hover,
|
|
11
|
+
&:focus {
|
|
12
|
+
background: transparent;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const propTypes = {
|
|
17
|
+
actions: PropTypes.instanceOf(Object),
|
|
18
|
+
seconds: PropTypes.number
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const defaultProps = {
|
|
22
|
+
actions: {},
|
|
23
|
+
seconds: 0.04
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const ForwardBackWardComponent = ({ mode, seconds, actionClick }) => {
|
|
27
|
+
const getIcon = () => {
|
|
28
|
+
let icon = '';
|
|
29
|
+
if (mode === 'forward') {
|
|
30
|
+
if (seconds === 10) {
|
|
31
|
+
icon = 'forward-10';
|
|
32
|
+
} else {
|
|
33
|
+
icon = 'triangle-double-right';
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
if (seconds === 10) {
|
|
37
|
+
icon = 'rewind-10';
|
|
38
|
+
} else {
|
|
39
|
+
icon = 'triangle-double-left';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return icon;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleClick = () => {
|
|
46
|
+
// Depends mode to implement different actions
|
|
47
|
+
if (mode === 'forward') {
|
|
48
|
+
actionClick({
|
|
49
|
+
action: 'add_seconds',
|
|
50
|
+
value: seconds
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
actionClick({
|
|
54
|
+
action: 'add_seconds',
|
|
55
|
+
value: -seconds
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<ForwardReplayButton
|
|
62
|
+
display="rounded"
|
|
63
|
+
appearance="cta"
|
|
64
|
+
icon={getIcon()}
|
|
65
|
+
iconWidth={seconds === 10 ? 22 : 14}
|
|
66
|
+
iconHeight={seconds === 10 ? 22 : 14}
|
|
67
|
+
width={20}
|
|
68
|
+
height={20}
|
|
69
|
+
ref={(c) => {
|
|
70
|
+
this.button = c;
|
|
71
|
+
}}
|
|
72
|
+
onClick={handleClick}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
ForwardBackWardComponent.propTypes = propTypes;
|
|
78
|
+
ForwardBackWardComponent.defaultProps = defaultProps;
|
|
79
|
+
export default ForwardBackWardComponent;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
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); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _components = require("@desynova-digital/components");
|
|
12
|
+
var _templateObject;
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
24
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
25
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
28
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
29
|
+
var propTypes = {
|
|
30
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
31
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
32
|
+
playerType: _propTypes.PropTypes.oneOf(['dubbing_review', 'clipping_default', 'default', 'tagging', 'qc', 'subtitle', 'snp_edit', 'archive', 'restore', 'clipping', 'storyboard', 'panel'])
|
|
33
|
+
};
|
|
34
|
+
var defaultProps = {
|
|
35
|
+
actions: {},
|
|
36
|
+
player: {}
|
|
37
|
+
};
|
|
38
|
+
var FullscreenToggleButton = (0, _styledComponents["default"])(_components.Button)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0 10px;\n &:hover,\n &:focus {\n background: transparent;\n svg path {\n fill: #00cec6;\n }\n }\n"])));
|
|
39
|
+
var FullscreenToggle = /*#__PURE__*/function (_Component) {
|
|
40
|
+
_inherits(FullscreenToggle, _Component);
|
|
41
|
+
var _super = _createSuper(FullscreenToggle);
|
|
42
|
+
function FullscreenToggle(props, context) {
|
|
43
|
+
var _this;
|
|
44
|
+
_classCallCheck(this, FullscreenToggle);
|
|
45
|
+
_this = _super.call(this, props, context);
|
|
46
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
47
|
+
return _this;
|
|
48
|
+
}
|
|
49
|
+
_createClass(FullscreenToggle, [{
|
|
50
|
+
key: "handleClick",
|
|
51
|
+
value: function handleClick() {
|
|
52
|
+
var actionClick = this.props.actionClick;
|
|
53
|
+
actionClick({
|
|
54
|
+
action: 'toggle_fullscreen'
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "render",
|
|
59
|
+
value: function render() {
|
|
60
|
+
var _this2 = this;
|
|
61
|
+
var playerType = this.props.playerType;
|
|
62
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, playerType !== 'panel' ? /*#__PURE__*/_react["default"].createElement(FullscreenToggleButton, {
|
|
63
|
+
display: "rounded",
|
|
64
|
+
appearance: "cta",
|
|
65
|
+
icon: "fullscreen",
|
|
66
|
+
ref: function ref(c) {
|
|
67
|
+
_this2.button = c;
|
|
68
|
+
},
|
|
69
|
+
onClick: this.handleClick,
|
|
70
|
+
iconWidth: 14,
|
|
71
|
+
iconHeight: 14,
|
|
72
|
+
width: 20,
|
|
73
|
+
height: 20
|
|
74
|
+
}) : null);
|
|
75
|
+
}
|
|
76
|
+
}]);
|
|
77
|
+
return FullscreenToggle;
|
|
78
|
+
}(_react.Component);
|
|
79
|
+
exports["default"] = FullscreenToggle;
|
|
80
|
+
FullscreenToggle.propTypes = propTypes;
|
|
81
|
+
FullscreenToggle.defaultProps = defaultProps;
|
|
82
|
+
FullscreenToggle.displayName = 'FullscreenToggle';
|