@desynova-digital/player 4.0.0 → 4.0.2

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.
Files changed (111) hide show
  1. package/Manager.js +99 -0
  2. package/actions/player.js +331 -0
  3. package/actions/video.js +206 -0
  4. package/{utils/colors.js → colors.js} +1 -2
  5. package/{media → components}/AudioMeter.js +96 -109
  6. package/components/BigPlayButton.js +84 -0
  7. package/components/ImageViewer.js +272 -0
  8. package/{control → components}/MarkerBar.js +33 -24
  9. package/{utils → components}/Menu.js +13 -4
  10. package/components/Player.js +706 -0
  11. package/{header/Header.js → components/PlayerHeader.js} +104 -78
  12. package/components/Playlist.js +95 -0
  13. package/{control → components}/PointersBar.js +122 -61
  14. package/components/PosterImage.js +50 -0
  15. package/{media → components}/SDOutline.js +13 -49
  16. package/components/Shortcut.js +821 -0
  17. package/{control → components}/Slider.js +27 -23
  18. package/components/TagsBar.js +81 -0
  19. package/components/Video.js +1280 -0
  20. package/{control → components/control-bar}/AudioTracksMenuButton.js +32 -28
  21. package/components/control-bar/CameraButton.js +75 -0
  22. package/components/control-bar/CommentsButton.js +186 -0
  23. package/components/control-bar/ControlBar.js +266 -0
  24. package/components/control-bar/EditorControlMenuButton.js +317 -0
  25. package/components/control-bar/ForwardControl.js +12 -0
  26. package/components/control-bar/ForwardReplayControl.js +106 -0
  27. package/{control → components/control-bar}/FullscreenToggle.js +26 -21
  28. package/components/control-bar/PlayToggle.js +85 -0
  29. package/components/control-bar/ReplayControl.js +12 -0
  30. package/components/control-bar/SettingsMenuButton.js +41 -0
  31. package/components/control-bar/SubtitleLanguagesMenuButton.js +149 -0
  32. package/components/control-bar/SubtitleMovementMenu.js +140 -0
  33. package/{control/VolumneMenuButton.js → components/control-bar/VolumeMenuButton.js} +26 -27
  34. package/components/control-bar/ZoomMenuButton.js +90 -0
  35. package/{control → components/marking-controls}/MarkInControl.js +32 -25
  36. package/{control → components/marking-controls}/MarkOutControl.js +35 -26
  37. package/components/marking-controls/MarkingAddButton.js +79 -0
  38. package/components/marking-controls/MarkingControl.js +95 -0
  39. package/components/marking-controls/MarkingDeleteButton.js +70 -0
  40. package/{control → components/marking-controls}/MarkingDuration.js +12 -5
  41. package/components/marking-controls/MarkingPreview.js +72 -0
  42. package/components/progress-bar/AudioWaveform.js +126 -0
  43. package/components/progress-bar/LoadProgressBar.js +67 -0
  44. package/components/progress-bar/MouseTimeDisplay.js +36 -0
  45. package/{control → components/progress-bar}/PlayProgressBar.js +4 -4
  46. package/components/progress-bar/ProgressControl.js +186 -0
  47. package/{control → components/progress-bar}/SeekBar.js +113 -72
  48. package/{control → components/progress-bar}/Timeline.js +43 -32
  49. package/{control/PlayBackRateControl.js → components/settings-menu-control/PlaybackRateControl.js} +44 -30
  50. package/components/settings-menu-control/SafeAreaControl.js +81 -0
  51. package/components/settings-menu-control/SettingsMenu.js +56 -0
  52. package/components/settings-menu-control/SubtitleControl.js +1 -0
  53. package/components/time-controls/CurrentTimeDisplay.js +83 -0
  54. package/{control → components/time-controls}/DurationDisplay.js +8 -15
  55. package/components/time-controls/TimeDivider.js +25 -0
  56. package/{control → components/volume-control}/VolumeBar.js +62 -80
  57. package/components/volume-control/VolumeControl.js +19 -0
  58. package/{control → components/volume-control}/VolumeLevel.js +2 -3
  59. package/components/zoom-control/ZoomBar.js +155 -0
  60. package/components/zoom-control/ZoomLevel.js +55 -0
  61. package/index.js +198 -1
  62. package/package.json +5 -8
  63. package/reducers/index.js +19 -0
  64. package/reducers/operation.js +35 -0
  65. package/reducers/player.js +222 -0
  66. package/utils/browser.js +30 -0
  67. package/utils/dom.js +93 -0
  68. package/utils/fullscreen.js +72 -0
  69. package/utils/index.js +156 -57
  70. package/Player.js +0 -945
  71. package/control/AudioTracksMenuButton.jsx +0 -80
  72. package/control/ControlBar.js +0 -303
  73. package/control/ControlBar.jsx +0 -264
  74. package/control/CurrentTimeDisplay.js +0 -34
  75. package/control/CurrentTimeDisplay.jsx +0 -35
  76. package/control/DurationDisplay.jsx +0 -48
  77. package/control/ForwardBackwardControl.js +0 -76
  78. package/control/ForwardBackwardControl.jsx +0 -79
  79. package/control/FullscreenToggle.jsx +0 -83
  80. package/control/MarkInControl.jsx +0 -109
  81. package/control/MarkOutControl.jsx +0 -131
  82. package/control/MarkerBar.jsx +0 -107
  83. package/control/MarkingControl.js +0 -82
  84. package/control/MarkingControl.jsx +0 -143
  85. package/control/MarkingPreview.js +0 -49
  86. package/control/MarkingPreview.jsx +0 -60
  87. package/control/PlayBackRateControl.jsx +0 -106
  88. package/control/PlayProgressBar.jsx +0 -92
  89. package/control/PlayToggle.js +0 -56
  90. package/control/PlayToggle.jsx +0 -57
  91. package/control/PointersBar.jsx +0 -286
  92. package/control/ProgressControl.js +0 -127
  93. package/control/ProgressControl.jsx +0 -155
  94. package/control/SeekBar.jsx +0 -229
  95. package/control/SettingsMenuButton.js +0 -63
  96. package/control/SettingsMenuButton.jsx +0 -69
  97. package/control/Slider.jsx +0 -243
  98. package/control/Timeline.jsx +0 -131
  99. package/control/VolumeBar.jsx +0 -174
  100. package/control/VolumeLevel.jsx +0 -66
  101. package/control/VolumneMenuButton.jsx +0 -111
  102. package/header/Header.jsx +0 -479
  103. package/media/AudioMeter.jsx +0 -411
  104. package/media/SDOutline.jsx +0 -90
  105. package/media/Video.js +0 -684
  106. package/media/Video.jsx +0 -714
  107. package/playlist/Playlist.js +0 -67
  108. package/playlist/Playlist.jsx +0 -91
  109. package/playlist/index.js +0 -13
  110. package/shortcuts/Shortcut.js +0 -662
  111. package/utils/Menu.jsx +0 -105
@@ -1,286 +0,0 @@
1
- /* eslint-disable jsx-a11y/mouse-events-have-key-events */
2
- /* eslint-disable jsx-a11y/click-events-have-key-events */
3
- /* eslint-disable react/no-array-index-key */
4
- import React, { Component } from 'react';
5
- import styled from 'styled-components';
6
- import { PropTypes } from 'prop-types';
7
- import { Icon } from '@desynova-digital/components';
8
- import _ from 'lodash';
9
-
10
- /*
11
- * import { colors } from '@desynova-digital/tokens';
12
- * import colors from '../colors';
13
- */
14
-
15
- const propTypes = {
16
- player: PropTypes.instanceOf(Object),
17
- actions: PropTypes.instanceOf(Object),
18
- markers: PropTypes.instanceOf(Array),
19
- onTagClick: PropTypes.func
20
- };
21
-
22
- const defaultProps = {
23
- player: {}
24
- };
25
-
26
- const PointersContainer = styled.div`
27
- display: flex;
28
- `;
29
-
30
- const PointerBlock = styled.div`
31
- width: 100%;
32
- height: 20px;
33
- position: relative;
34
- border-top: 1px solid #333333;
35
- border-bottom: 1px solid #333333;
36
- .empty-pointers-msg {
37
- display: flex;
38
- justify-content: center;
39
- align-items: center;
40
- height: 100%;
41
- p {
42
- font-family: SFUIText-Medium;
43
- font-size: 11px;
44
- color: #aaaaaa;
45
- }
46
- ${Icon.Element} {
47
- margin: 0 5px;
48
- }
49
- }
50
- `;
51
- const MarkerTagsBlock = styled.div`
52
- min-width: 100px;
53
- max-width: 100px;
54
- position: relative;
55
- height: 100%;
56
- .tags-block {
57
- height: 20px;
58
- font-family: SFUIText-Medium;
59
- font-size: 10px;
60
- color: #ffffff;
61
- text-transform: uppercase;
62
- border-top: 1px solid #333333;
63
- border-bottom: 1px solid #333333;
64
- p {
65
- line-height: 18px;
66
- padding: 0 10px;
67
- white-space: nowrap;
68
- overflow: hidden;
69
- text-overflow: ellipsis;
70
- }
71
- }
72
- `;
73
-
74
- const ToolTipStyles = styled.div`
75
- position: absolute;
76
- z-index: 2;
77
- height: 18px;
78
- transition: left 0.1s ease-in-out;
79
-
80
- .tooltip-container {
81
- border-radius: 0.25rem;
82
- padding: 5px;
83
- width: fit-content;
84
- background: #ffffff;
85
- color: #666666;
86
-
87
- h4 {
88
- white-space: nowrap;
89
- font-size: 12px;
90
- }
91
-
92
- &:after {
93
- content: '';
94
- position: absolute;
95
- border-left: 5px solid transparent;
96
- border-right: 5px solid transparent;
97
- border-top: 5px solid white;
98
- ${(props) => {
99
- return props.multiline ? 'bottom: -21px;' : 'bottom: -9px;';
100
- }}
101
- left: 50%;
102
- transform: translateX(-50%);
103
- }
104
- }
105
- `;
106
-
107
- export default class PointersBar extends Component {
108
- constructor(props) {
109
- super(props);
110
- this.getPointerStyle = this.getPointerStyle.bind(this);
111
- this.state = {
112
- tooltip: {
113
- isVisible: false
114
- }
115
- };
116
- this._tooltipRef = React.createRef();
117
- this.renderComp = 0;
118
- }
119
-
120
- shouldComponentUpdate(nextProps, nextState) {
121
- if (_.isEqual(nextProps.markers, this.props.markers) && !this.renderComp) {
122
- return false;
123
- }
124
- this.renderComp = 0;
125
- return true;
126
- }
127
- onMarkerClick(e, marker) {
128
- const { onTagClick, actionClick } = this.props;
129
- const start_time = parseFloat(e.target.getAttribute('leftpos'));
130
- const end_time = parseFloat(e.target.getAttribute('rightpos'));
131
- // actions.handleMarkerUpdate(start_time, end_time);
132
- actionClick({
133
- action: 'pause'
134
- });
135
- // actions.pause();
136
- actionClick({
137
- action: 'seek',
138
- value: start_time
139
- });
140
- // actions.seek(start_time);
141
- onTagClick(start_time, end_time, marker);
142
- }
143
-
144
- getPointerStyle(leftMarker, rightMarker, index) {
145
- const { duration } = this.props;
146
- const left = (leftMarker / duration.seconds) * 100;
147
- const right = (rightMarker / duration.seconds) * 100;
148
- const width = right - left;
149
- const style = {
150
- left: `${left}%`,
151
- position: 'absolute',
152
- bottom: 0,
153
- height: '100%',
154
- width: `${width}%`,
155
- cursor: 'pointer',
156
- backgroundColor: index % 2 === 0 ? '#00cec6' : '#146778',
157
- opacity: 0.8,
158
- minWidth: '0.3px'
159
- };
160
- return style;
161
- }
162
-
163
- setTooltipData(e, title) {
164
- const { tooltip } = this.state;
165
- tooltip.isVisible = false;
166
- tooltip.text = title;
167
- tooltip.bottom = window.innerHeight - e.target.getBoundingClientRect().top; // e.target.getBoundingClientRect().top - e.target.getBoundingClientRect().height - 10;
168
- tooltip.bottom = title.line1 ? tooltip.bottom + 22 : tooltip.bottom + 10;
169
- tooltip.left =
170
- e.target.getBoundingClientRect().left +
171
- (e.target.getBoundingClientRect().right - e.target.getBoundingClientRect().left) / 2;
172
- this.renderComp = 1;
173
- this.setState({ ...tooltip }, () => {
174
- const { tooltip } = this.state;
175
- const tooltipRefOffset =
176
- this._tooltipRef.current && this._tooltipRef.current.offsetWidth ? this._tooltipRef.current.offsetWidth / 2 : 0;
177
- tooltip.isVisible = true;
178
- tooltip.left = tooltip.left - tooltipRefOffset;
179
- this.renderComp = 1;
180
- this.setState({
181
- ...tooltip
182
- });
183
- });
184
- }
185
-
186
- getTitle(marker) {
187
- let data = marker.segment_title || marker.word || '';
188
- if (!data.length && marker.line1) {
189
- return {
190
- line1: marker.line1,
191
- line2: marker.line2
192
- };
193
- }
194
- return data;
195
- }
196
-
197
- render() {
198
- const { markers } = this.props;
199
- const {
200
- tooltip: { isVisible, text, left, bottom }
201
- } = this.state;
202
- const self = this;
203
- return (
204
- <React.Fragment>
205
- {markers && markers.length
206
- ? markers.map((marker_obj) => {
207
- return (
208
- <PointersContainer key={marker_obj.name}>
209
- <MarkerTagsBlock key={`${marker_obj.name}-tags-block`}>
210
- <div className="tags-block">
211
- <p>{marker_obj.name}</p>
212
- </div>
213
- </MarkerTagsBlock>
214
- <PointerBlock key={`${marker_obj.name}-key-tags-block`}>
215
- {marker_obj && marker_obj.values && marker_obj.values.length ? (
216
- marker_obj.values.map((marker, index) => {
217
- const style = self.getPointerStyle(marker.start_time, marker.end_time, index);
218
- return (
219
- <div
220
- className="marker-blocks"
221
- onClick={(e) => {
222
- this.onMarkerClick(e, marker);
223
- }}
224
- onMouseOver={(e) => {
225
- self.setTooltipData(e, this.getTitle(marker));
226
- }}
227
- onMouseOut={() => {
228
- const { tooltip } = this.state;
229
- tooltip.isVisible = false;
230
- tooltip.text = null;
231
- this.renderComp = 1;
232
- // tooltip.left = null;
233
- this.setState({ ...tooltip });
234
- }}
235
- role="button"
236
- tabIndex="-1"
237
- style={style}
238
- leftpos={marker.start_time}
239
- rightpos={marker.end_time}
240
- key={`${marker.start_time}-${marker.end_time}-${index}`}
241
- />
242
- );
243
- })
244
- ) : (
245
- <div className="empty-pointers-msg">
246
- <p>Mark In</p>
247
- <Icon name="in-marker" stroke="#fff" width={7} height={11} />
248
- <p>and Mark Out</p>
249
- <Icon name="out-marker" stroke="#fff" width={7} height={11} />
250
- <p>to create {marker_obj.name} in the selected range. </p>
251
- {/* <p>Then press</p>
252
- <Icon name="add" stroke="#fff" width={10} height={10} />
253
- <p>to create {marker_obj.name}.</p> */}
254
- </div>
255
- )}
256
- </PointerBlock>
257
- <MarkerTagsBlock>
258
- <div className="tags-block">
259
- <p />
260
- </div>
261
- </MarkerTagsBlock>
262
- </PointersContainer>
263
- );
264
- })
265
- : null}
266
- {text && (
267
- <ToolTipStyles
268
- multiline={!!text.line1}
269
- ref={this._tooltipRef}
270
- style={{ left: left || 0, bottom: bottom || 0, visibility: isVisible ? 'visible' : 'hidden' }}>
271
- <div className="tooltip-container">
272
- {text.line1 && <h4>{text.line1}</h4>}
273
- {text.line2 && <h4>{text.line2}</h4>}
274
- {!text.line1 && <h4>{text}</h4>}
275
- </div>
276
- </ToolTipStyles>
277
- )}
278
- <div id="dummy-container"></div>
279
- </React.Fragment>
280
- );
281
- }
282
- }
283
-
284
- PointersBar.propTypes = propTypes;
285
- PointersBar.defaultProps = defaultProps;
286
- PointersBar.displayName = 'PointersBar';
@@ -1,127 +0,0 @@
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 _propTypes = require("prop-types");
9
- var _react = _interopRequireWildcard(require("react"));
10
- var _reactDom = require("react-dom");
11
- var _styledComponents = _interopRequireDefault(require("styled-components"));
12
- var Dom = _interopRequireWildcard(require("../utils/dom"));
13
- var _SeekBar = _interopRequireDefault(require("./SeekBar"));
14
- var _PointersBar = _interopRequireDefault(require("./PointersBar"));
15
- var _colors = _interopRequireDefault(require("../utils/colors"));
16
- var _templateObject, _templateObject2, _templateObject3;
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
- 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); }
19
- 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; }
20
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22
- 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); } }
23
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
24
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
- 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); }
26
- 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); }
27
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
28
- 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); }; }
29
- 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); }
30
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
31
- 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; } }
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
34
- var propTypes = {
35
- player: _propTypes.PropTypes.instanceOf(Object),
36
- controlType: _propTypes.PropTypes.string,
37
- playerType: _propTypes.PropTypes.oneOf(['dubbing_review', 'clipping_default', 'default', 'tagging', 'qc', 'subtitle', 'snp_edit', 'archive', 'restore', 'clipping', 'storyboard', 'panel'])
38
- };
39
- var defaultProps = {};
40
- var ProgressControlBlock = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: ", ";\n position: relative;\n overflow: ", ";\n padding-top: 0px;\n background: #000000;\n background: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n transition: all 250ms ease-in-out;\n bottom: ", ";\n"])), function (props) {
41
- return props.controlType === 'advanced' && !props.isFullscreen ? '80px' : '4px';
42
- }, function (props) {
43
- return props.controlType === 'advanced' && !props.isFullscreen ? 'none' : 'visible';
44
- }, _colors["default"].common.base.black, function (props) {
45
- return props.player === 'panel' && props.active ? '50px' : 'initial';
46
- });
47
- var SeekControlBar = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n position: relative;\n cursor: pointer;\n z-index: ", ";\n"])), function (props) {
48
- return props.controlType === 'advanced' && !props.isFullscreen ? '2' : '1';
49
- });
50
- var MarkerTagsBlock = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n min-width: 100px;\n max-width: 100px;\n position: relative;\n height: 100%;\n .empty-block {\n height: calc(100% - 20px);\n }\n .tags-block {\n height: 20px;\n font-family: SFUIText-Medium;\n font-size: 12px;\n color: #ffffff;\n text-transform: uppercase;\n border-top: 1px solid #333333;\n border-bottom: 1px solid #333333;\n p {\n line-height: 18px;\n padding-left: 10px;\n }\n }\n"])));
51
- var ProgressControl = /*#__PURE__*/function (_Component) {
52
- _inherits(ProgressControl, _Component);
53
- var _super = _createSuper(ProgressControl);
54
- function ProgressControl(props, context) {
55
- var _this;
56
- _classCallCheck(this, ProgressControl);
57
- _this = _super.call(this, props, context);
58
- _this.state = {
59
- mouseTime: {
60
- time: null,
61
- position: 0,
62
- stateZoom: null
63
- }
64
- };
65
- _this.handleMouseMoveThrottle = _this.handleMouseMove.bind(_assertThisInitialized(_this));
66
- return _this;
67
- }
68
- _createClass(ProgressControl, [{
69
- key: "handleMouseMove",
70
- value: function handleMouseMove(event) {
71
- // if (!event.pageX) {
72
- // return;
73
- // }
74
- // const {
75
- // duration: { seconds }
76
- // } = this.props;
77
- // const node = findDOMNode(this.seekBar);
78
- // const newTime = Dom.getPointerPosition(node, event).x * seconds;
79
- // const position = event.pageX - Dom.findElPosition(node).left;
80
- // this.setState({
81
- // mouseTime: {
82
- // time: newTime,
83
- // position
84
- // }
85
- // });
86
- }
87
- }, {
88
- key: "render",
89
- value: function render() {
90
- var _this2 = this;
91
- var _this$props = this.props,
92
- controlType = _this$props.controlType,
93
- playerType = _this$props.playerType,
94
- isFullscreen = _this$props.isFullscreen,
95
- userActivity = _this$props.userActivity;
96
- var mouseTime = this.state.mouseTime;
97
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(ProgressControlBlock, {
98
- controlType: controlType,
99
- player: playerType,
100
- active: userActivity,
101
- isFullscreen: isFullscreen,
102
- ref: function ref(c) {
103
- _this2.progressControlBlock = c;
104
- }
105
- }, controlType === 'advanced' && !isFullscreen ? /*#__PURE__*/_react["default"].createElement(MarkerTagsBlock, null, /*#__PURE__*/_react["default"].createElement("div", {
106
- className: "empty-block"
107
- })) : null, /*#__PURE__*/_react["default"].createElement(SeekControlBar, {
108
- ref: function ref(c) {
109
- _this2.seekControlBar = c;
110
- },
111
- onMouseMove: this.handleMouseMoveThrottle
112
- }, /*#__PURE__*/_react["default"].createElement(_SeekBar["default"], _extends({
113
- mouseTime: mouseTime,
114
- ref: function ref(c) {
115
- _this2.seekBar = c;
116
- }
117
- }, this.props))), controlType === 'advanced' && !isFullscreen ? /*#__PURE__*/_react["default"].createElement(MarkerTagsBlock, null, /*#__PURE__*/_react["default"].createElement("div", {
118
- className: "empty-block"
119
- })) : null), controlType === 'advanced' && !isFullscreen ? /*#__PURE__*/_react["default"].createElement(_PointersBar["default"], this.props) : null);
120
- }
121
- }]);
122
- return ProgressControl;
123
- }(_react.Component);
124
- exports["default"] = ProgressControl;
125
- ProgressControl.propTypes = propTypes;
126
- ProgressControl.defaultProps = defaultProps;
127
- ProgressControl.displayName = 'ProgressControl';
@@ -1,155 +0,0 @@
1
- import { PropTypes } from 'prop-types';
2
- import React, { Component } from 'react';
3
- import { findDOMNode } from 'react-dom';
4
- import styled from 'styled-components';
5
- import * as Dom from '../utils/dom';
6
- import SeekBar from './SeekBar';
7
- import PointersBar from './PointersBar';
8
- import colors from '../utils/colors';
9
-
10
- const propTypes = {
11
- player: PropTypes.instanceOf(Object),
12
- controlType: PropTypes.string,
13
- playerType: PropTypes.oneOf([
14
- 'dubbing_review',
15
- 'clipping_default',
16
- 'default',
17
- 'tagging',
18
- 'qc',
19
- 'subtitle',
20
- 'snp_edit',
21
- 'archive',
22
- 'restore',
23
- 'clipping',
24
- 'storyboard',
25
- 'panel'
26
- ])
27
- };
28
-
29
- const defaultProps = {};
30
-
31
- const ProgressControlBlock = styled.div`
32
- width: 100%;
33
- height: ${(props) => (props.controlType === 'advanced' && !props.isFullscreen ? '80px' : '4px')};
34
- position: relative;
35
- overflow: ${(props) => (props.controlType === 'advanced' && !props.isFullscreen ? 'none' : 'visible')};
36
- padding-top: 0px;
37
- background: #000000;
38
- background: ${colors.common.base.black};
39
- display: flex;
40
- justify-content: center;
41
- align-items: center;
42
- transition: all 250ms ease-in-out;
43
- bottom: ${(props) => (props.player === 'panel' && props.active ? '50px' : 'initial')};
44
- `;
45
-
46
- const SeekControlBar = styled.div`
47
- width: 100%;
48
- height: 100%;
49
- position: relative;
50
- cursor: pointer;
51
- z-index: ${(props) => (props.controlType === 'advanced' && !props.isFullscreen ? '2' : '1')};
52
- `;
53
-
54
- const MarkerTagsBlock = styled.div`
55
- min-width: 100px;
56
- max-width: 100px;
57
- position: relative;
58
- height: 100%;
59
- .empty-block {
60
- height: calc(100% - 20px);
61
- }
62
- .tags-block {
63
- height: 20px;
64
- font-family: SFUIText-Medium;
65
- font-size: 12px;
66
- color: #ffffff;
67
- text-transform: uppercase;
68
- border-top: 1px solid #333333;
69
- border-bottom: 1px solid #333333;
70
- p {
71
- line-height: 18px;
72
- padding-left: 10px;
73
- }
74
- }
75
- `;
76
-
77
- export default class ProgressControl extends Component {
78
- constructor(props, context) {
79
- super(props, context);
80
-
81
- this.state = {
82
- mouseTime: {
83
- time: null,
84
- position: 0,
85
- stateZoom: null
86
- }
87
- };
88
-
89
- this.handleMouseMoveThrottle = this.handleMouseMove.bind(this);
90
- }
91
-
92
- handleMouseMove(event) {
93
- // if (!event.pageX) {
94
- // return;
95
- // }
96
- // const {
97
- // duration: { seconds }
98
- // } = this.props;
99
- // const node = findDOMNode(this.seekBar);
100
- // const newTime = Dom.getPointerPosition(node, event).x * seconds;
101
- // const position = event.pageX - Dom.findElPosition(node).left;
102
- // this.setState({
103
- // mouseTime: {
104
- // time: newTime,
105
- // position
106
- // }
107
- // });
108
- }
109
-
110
- render() {
111
- const { controlType, playerType, isFullscreen, userActivity } = this.props;
112
- const { mouseTime } = this.state;
113
- return (
114
- <React.Fragment>
115
- <ProgressControlBlock
116
- controlType={controlType}
117
- player={playerType}
118
- active={userActivity}
119
- isFullscreen={isFullscreen}
120
- ref={(c) => {
121
- this.progressControlBlock = c;
122
- }}>
123
- {controlType === 'advanced' && !isFullscreen ? (
124
- <MarkerTagsBlock>
125
- <div className="empty-block" />
126
- </MarkerTagsBlock>
127
- ) : null}
128
- <SeekControlBar
129
- ref={(c) => {
130
- this.seekControlBar = c;
131
- }}
132
- onMouseMove={this.handleMouseMoveThrottle}>
133
- <SeekBar
134
- mouseTime={mouseTime}
135
- ref={(c) => {
136
- this.seekBar = c;
137
- }}
138
- {...this.props}
139
- />
140
- </SeekControlBar>
141
- {controlType === 'advanced' && !isFullscreen ? (
142
- <MarkerTagsBlock>
143
- <div className="empty-block" />
144
- </MarkerTagsBlock>
145
- ) : null}
146
- </ProgressControlBlock>
147
- {controlType === 'advanced' && !isFullscreen ? <PointersBar {...this.props} /> : null}
148
- </React.Fragment>
149
- );
150
- }
151
- }
152
-
153
- ProgressControl.propTypes = propTypes;
154
- ProgressControl.defaultProps = defaultProps;
155
- ProgressControl.displayName = 'ProgressControl';