@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
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _extends = Object.assign || 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; };
|
|
8
|
-
|
|
9
|
-
var _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10
|
-
|
|
11
|
-
var _react = require('react');
|
|
12
|
-
|
|
13
|
-
var _react2 = _interopRequireDefault(_react);
|
|
14
|
-
|
|
15
|
-
var _propTypes = require('prop-types');
|
|
16
|
-
|
|
17
|
-
var _styledComponents = require('styled-components');
|
|
18
|
-
|
|
19
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
20
|
-
|
|
21
|
-
var _CommentsButton = require('./control-bar/CommentsButton');
|
|
22
|
-
|
|
23
|
-
var _CommentsButton2 = _interopRequireDefault(_CommentsButton);
|
|
24
|
-
|
|
25
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
-
|
|
27
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
28
|
-
|
|
29
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
30
|
-
|
|
31
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint-disable linebreak-style */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/*
|
|
35
|
-
* import { colors } from '@desynova-digital/tokens';
|
|
36
|
-
* import colors from '../colors';
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
var propTypes = {
|
|
40
|
-
src: _propTypes.PropTypes.string
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var ImageContainer = (0, _styledComponents2.default)('div').withConfig({
|
|
44
|
-
displayName: 'ImageViewer__ImageContainer',
|
|
45
|
-
componentId: 'sc-5q95u9-0'
|
|
46
|
-
})(['position:relative;overflow:hidden;']);
|
|
47
|
-
|
|
48
|
-
var ImageBlock = (0, _styledComponents2.default)('div').withConfig({
|
|
49
|
-
displayName: 'ImageViewer__ImageBlock',
|
|
50
|
-
componentId: 'sc-5q95u9-1'
|
|
51
|
-
})(['position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:calc(100% - 50px);img{position:relative;transition:all 350ms ease-in-out;&.moving{transition:none;}}']);
|
|
52
|
-
|
|
53
|
-
var ImageControls = (0, _styledComponents2.default)('div').withConfig({
|
|
54
|
-
displayName: 'ImageViewer__ImageControls',
|
|
55
|
-
componentId: 'sc-5q95u9-2'
|
|
56
|
-
})(['position:relative;height:50px;background:#000;display:flex;justify-content:flex-start;align-items:center;padding:0 20px;.zoom-in,.zoom-out{width:20px;height:20px;position:relative;cursor:pointer;&:after{content:\'\';position:absolute;width:14px;height:2px;top:50%;left:50%;transform:translate(-50%,-50%);background:#afb2ba;}}.zoom-in{&:before{content:\'\';position:absolute;width:2px;height:14px;top:50%;left:50%;transform:translate(-50%,-50%);background:#afb2ba;}}.percent{font-size:14px;font-family:SFUIText-Regular;color:#fff;margin:0 15px;}']);
|
|
57
|
-
|
|
58
|
-
var ImageViewer = function (_Component) {
|
|
59
|
-
_inherits(ImageViewer, _Component);
|
|
60
|
-
|
|
61
|
-
function ImageViewer(props) {
|
|
62
|
-
_classCallCheck(this, ImageViewer);
|
|
63
|
-
|
|
64
|
-
var _this = _possibleConstructorReturn(this, (ImageViewer.__proto__ || Object.getPrototypeOf(ImageViewer)).call(this, props));
|
|
65
|
-
|
|
66
|
-
_this.state = {
|
|
67
|
-
minWidth: 0,
|
|
68
|
-
minHeight: 0,
|
|
69
|
-
maxWidth: '100%',
|
|
70
|
-
maxHeight: '100%',
|
|
71
|
-
currentHeight: 'auto',
|
|
72
|
-
currentWidth: 'auto',
|
|
73
|
-
draggable: false
|
|
74
|
-
};
|
|
75
|
-
_this.currentX;
|
|
76
|
-
_this.currentY;
|
|
77
|
-
_this.initialX;
|
|
78
|
-
_this.initialY;
|
|
79
|
-
_this.xOffset = 0;
|
|
80
|
-
_this.yOffset = 0;
|
|
81
|
-
|
|
82
|
-
return _this;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
_createClass(ImageViewer, [{
|
|
86
|
-
key: 'componentDidMount',
|
|
87
|
-
value: function componentDidMount() {}
|
|
88
|
-
}, {
|
|
89
|
-
key: 'onMouseDown',
|
|
90
|
-
value: function onMouseDown() {
|
|
91
|
-
this.initialX = event.offsetX;
|
|
92
|
-
this.initialY = event.offsetY;
|
|
93
|
-
this.setState({
|
|
94
|
-
moving: true
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
key: 'onMouseUp',
|
|
99
|
-
value: function onMouseUp() {
|
|
100
|
-
this.setState({
|
|
101
|
-
moving: false
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: 'onMouseMove',
|
|
106
|
-
value: function onMouseMove() {
|
|
107
|
-
var _state = this.state,
|
|
108
|
-
moving = _state.moving,
|
|
109
|
-
draggable = _state.draggable,
|
|
110
|
-
currentWidth = _state.currentWidth,
|
|
111
|
-
currentHeight = _state.currentHeight,
|
|
112
|
-
imageTop = _state.imageTop,
|
|
113
|
-
imageLeft = _state.imageLeft;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (moving && draggable) {
|
|
117
|
-
this.currentX = event.offsetX - this.initialX;
|
|
118
|
-
this.currentY = event.offsetY - this.initialY;
|
|
119
|
-
var newLeft = imageLeft;
|
|
120
|
-
var newTop = imageTop;
|
|
121
|
-
if (currentWidth > this.imageBlock.offsetWidth) {
|
|
122
|
-
var minLeft = 0;
|
|
123
|
-
var maxLeft = this.imageBlock.offsetWidth - currentWidth;
|
|
124
|
-
newLeft = this.imageRef.offsetLeft + this.currentX;
|
|
125
|
-
if (newLeft > minLeft) {
|
|
126
|
-
newLeft = minLeft;
|
|
127
|
-
} else if (newLeft < maxLeft) {
|
|
128
|
-
newLeft = maxLeft;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (currentHeight > this.imageBlock.offsetHeight) {
|
|
132
|
-
var minTop = 0;
|
|
133
|
-
var maxTop = this.imageBlock.offsetHeight - currentHeight;
|
|
134
|
-
newTop = this.imageRef.offsetTop + this.currentY;
|
|
135
|
-
if (newTop > minTop) {
|
|
136
|
-
newTop = minTop;
|
|
137
|
-
} else if (newTop < maxTop) {
|
|
138
|
-
newTop = maxTop;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
this.setState({
|
|
142
|
-
imageLeft: newLeft,
|
|
143
|
-
imageTop: newTop
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
key: 'handleImageLoaded',
|
|
149
|
-
value: function handleImageLoaded() {
|
|
150
|
-
var percentage = Math.round(this.imageRef.offsetHeight / this.imageRef.naturalHeight * 100);
|
|
151
|
-
var imageLeft = (this.imageBlock.offsetWidth - this.imageRef.offsetWidth) / 2;
|
|
152
|
-
var imageTop = (this.imageBlock.offsetHeight - this.imageRef.offsetHeight) / 2;
|
|
153
|
-
|
|
154
|
-
this.setState({
|
|
155
|
-
minWidth: this.imageRef.offsetWidth,
|
|
156
|
-
minHeight: this.imageRef.offsetHeight,
|
|
157
|
-
maxWidth: this.imageRef.naturalWidth,
|
|
158
|
-
maxHeight: this.imageRef.naturalHeight,
|
|
159
|
-
currentWidth: this.imageRef.offsetWidth,
|
|
160
|
-
currentHeight: this.imageRef.offsetHeight,
|
|
161
|
-
percentage: percentage,
|
|
162
|
-
imageLeft: imageLeft,
|
|
163
|
-
imageTop: imageTop
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: 'zoomIn',
|
|
168
|
-
value: function zoomIn() {
|
|
169
|
-
var _state2 = this.state,
|
|
170
|
-
maxWidth = _state2.maxWidth,
|
|
171
|
-
maxHeight = _state2.maxHeight,
|
|
172
|
-
percentage = _state2.percentage;
|
|
173
|
-
|
|
174
|
-
if (percentage < 100) {
|
|
175
|
-
var newPercentage = Math.round(percentage / 10) * 10 + 10;
|
|
176
|
-
newPercentage = newPercentage > 100 ? 100 : newPercentage;
|
|
177
|
-
var newWidth = newPercentage * maxWidth / 100;
|
|
178
|
-
var newHeight = newPercentage * maxHeight / 100;
|
|
179
|
-
var imageLeft = (this.imageBlock.offsetWidth - newWidth) / 2;
|
|
180
|
-
var imageTop = (this.imageBlock.offsetHeight - newHeight) / 2;
|
|
181
|
-
this.setState({
|
|
182
|
-
percentage: newPercentage,
|
|
183
|
-
currentWidth: newWidth,
|
|
184
|
-
currentHeight: newHeight,
|
|
185
|
-
draggable: true,
|
|
186
|
-
imageLeft: imageLeft,
|
|
187
|
-
imageTop: imageTop
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}, {
|
|
192
|
-
key: 'zoomOut',
|
|
193
|
-
value: function zoomOut() {
|
|
194
|
-
var _state3 = this.state,
|
|
195
|
-
minWidth = _state3.minWidth,
|
|
196
|
-
maxWidth = _state3.maxWidth,
|
|
197
|
-
maxHeight = _state3.maxHeight,
|
|
198
|
-
percentage = _state3.percentage;
|
|
199
|
-
|
|
200
|
-
if (percentage) {
|
|
201
|
-
var minPercent = Math.round(minWidth / maxWidth * 100);
|
|
202
|
-
var newPercentage = Math.round(percentage / 10) * 10 - 10;
|
|
203
|
-
newPercentage = newPercentage < minPercent ? minPercent : newPercentage;
|
|
204
|
-
var newWidth = newPercentage * maxWidth / 100;
|
|
205
|
-
var newHeight = newPercentage * maxHeight / 100;
|
|
206
|
-
var imageLeft = (this.imageBlock.offsetWidth - newWidth) / 2;
|
|
207
|
-
var imageTop = (this.imageBlock.offsetHeight - newHeight) / 2;
|
|
208
|
-
var stateObj = {
|
|
209
|
-
percentage: newPercentage,
|
|
210
|
-
currentWidth: newWidth,
|
|
211
|
-
currentHeight: newHeight,
|
|
212
|
-
draggable: true,
|
|
213
|
-
imageLeft: imageLeft,
|
|
214
|
-
imageTop: imageTop
|
|
215
|
-
};
|
|
216
|
-
if (minPercent === newPercentage) {
|
|
217
|
-
stateObj = _extends({}, stateObj, {
|
|
218
|
-
draggable: false
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
this.setState(stateObj);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}, {
|
|
225
|
-
key: 'render',
|
|
226
|
-
value: function render() {
|
|
227
|
-
var _this2 = this;
|
|
228
|
-
|
|
229
|
-
var _state4 = this.state,
|
|
230
|
-
minWidth = _state4.minWidth,
|
|
231
|
-
minHeight = _state4.minHeight,
|
|
232
|
-
maxWidth = _state4.maxWidth,
|
|
233
|
-
maxHeight = _state4.maxHeight,
|
|
234
|
-
currentWidth = _state4.currentWidth,
|
|
235
|
-
currentHeight = _state4.currentHeight,
|
|
236
|
-
percentage = _state4.percentage,
|
|
237
|
-
imageTop = _state4.imageTop,
|
|
238
|
-
imageLeft = _state4.imageLeft,
|
|
239
|
-
draggable = _state4.draggable,
|
|
240
|
-
moving = _state4.moving;
|
|
241
|
-
var src = this.props.src;
|
|
242
|
-
|
|
243
|
-
return _react2.default.createElement(
|
|
244
|
-
ImageContainer,
|
|
245
|
-
null,
|
|
246
|
-
_react2.default.createElement(
|
|
247
|
-
ImageBlock,
|
|
248
|
-
{
|
|
249
|
-
ref: function ref(imageBlock) {
|
|
250
|
-
return _this2.imageBlock = imageBlock;
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
_react2.default.createElement('img', {
|
|
254
|
-
role: 'presentation',
|
|
255
|
-
style: {
|
|
256
|
-
minWidth: minWidth,
|
|
257
|
-
minHeight: minHeight,
|
|
258
|
-
maxWidth: maxWidth,
|
|
259
|
-
maxHeight: maxHeight,
|
|
260
|
-
width: currentWidth,
|
|
261
|
-
height: currentHeight,
|
|
262
|
-
top: imageTop,
|
|
263
|
-
left: imageLeft,
|
|
264
|
-
cursor: draggable ? 'grab' : 'default'
|
|
265
|
-
},
|
|
266
|
-
draggable: false,
|
|
267
|
-
ref: function ref(imageRef) {
|
|
268
|
-
return _this2.imageRef = imageRef;
|
|
269
|
-
},
|
|
270
|
-
onLoad: this.handleImageLoaded.bind(this),
|
|
271
|
-
onMouseDown: this.onMouseDown.bind(this),
|
|
272
|
-
onMouseMove: this.onMouseMove.bind(this),
|
|
273
|
-
onMouseUp: this.onMouseUp.bind(this),
|
|
274
|
-
alt: 'WILD_magazine_Polar_bear_final_00635',
|
|
275
|
-
src: src,
|
|
276
|
-
className: moving ? 'moving' : ''
|
|
277
|
-
// src='https://www.nginx.com/wp-content/uploads/2015/04/nginx-plus-dashboard_R6.png'
|
|
278
|
-
})
|
|
279
|
-
),
|
|
280
|
-
_react2.default.createElement(
|
|
281
|
-
ImageControls,
|
|
282
|
-
null,
|
|
283
|
-
_react2.default.createElement('p', {
|
|
284
|
-
className: 'zoom-in',
|
|
285
|
-
role: 'presentation',
|
|
286
|
-
onClick: function onClick() {
|
|
287
|
-
return _this2.zoomIn();
|
|
288
|
-
}
|
|
289
|
-
}),
|
|
290
|
-
_react2.default.createElement(
|
|
291
|
-
'p',
|
|
292
|
-
{
|
|
293
|
-
className: 'percent'
|
|
294
|
-
},
|
|
295
|
-
percentage,
|
|
296
|
-
'%'
|
|
297
|
-
),
|
|
298
|
-
_react2.default.createElement('p', {
|
|
299
|
-
className: 'zoom-out',
|
|
300
|
-
role: 'presentation',
|
|
301
|
-
onClick: function onClick() {
|
|
302
|
-
return _this2.zoomOut();
|
|
303
|
-
}
|
|
304
|
-
}),
|
|
305
|
-
_react2.default.createElement(_CommentsButton2.default, _extends({}, this.props, { key: 'comments-button', order: 6.01 }))
|
|
306
|
-
)
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
}]);
|
|
310
|
-
|
|
311
|
-
return ImageViewer;
|
|
312
|
-
}(_react.Component);
|
|
313
|
-
|
|
314
|
-
exports.default = ImageViewer;
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
ImageViewer.propTypes = propTypes;
|
|
318
|
-
ImageViewer.displayName = 'ImageViewer';
|
package/components/MarkerBar.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
8
|
-
|
|
9
|
-
var _react = require('react');
|
|
10
|
-
|
|
11
|
-
var _react2 = _interopRequireDefault(_react);
|
|
12
|
-
|
|
13
|
-
var _propTypes = require('prop-types');
|
|
14
|
-
|
|
15
|
-
var _styledComponents = require('styled-components');
|
|
16
|
-
|
|
17
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
18
|
-
|
|
19
|
-
var _components = require('@desynova-digital/components');
|
|
20
|
-
|
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
|
|
23
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
-
|
|
25
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
26
|
-
|
|
27
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
28
|
-
|
|
29
|
-
/*
|
|
30
|
-
* import { colors } from '@desynova-digital/tokens';
|
|
31
|
-
* import colors from '../colors';
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
var propTypes = {
|
|
35
|
-
player: _propTypes.PropTypes.instanceOf(Object),
|
|
36
|
-
controlType: _propTypes.PropTypes.string
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var defaultProps = {
|
|
40
|
-
player: {}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var MarkerBlock = _styledComponents2.default.div.withConfig({
|
|
44
|
-
displayName: 'MarkerBar__MarkerBlock',
|
|
45
|
-
componentId: 'sc-yn9zkf-0'
|
|
46
|
-
})(['width:100%;height:30px;position:', ';bottom:', ';.marker{position:absolute;width:2px;height:20px;p{font-family:SFUIText-Medium;font-size:10px;color:#ffffff;position:absolute;left:50%;transform:translateX(-50%);}', '{position:absolute;display:block;left:50%;top:10px;transform:translateX(-50%);}}'], function (props) {
|
|
47
|
-
return props.controlType === 'advanced' && !props.isFullscreen ? 'relative' : 'absolute';
|
|
48
|
-
}, function (props) {
|
|
49
|
-
return props.controlType === 'advanced' && !props.isFullscreen ? '0px' : '5px';
|
|
50
|
-
}, _components.Icon.Element);
|
|
51
|
-
|
|
52
|
-
var MarkerBar = function (_Component) {
|
|
53
|
-
_inherits(MarkerBar, _Component);
|
|
54
|
-
|
|
55
|
-
function MarkerBar(props) {
|
|
56
|
-
_classCallCheck(this, MarkerBar);
|
|
57
|
-
|
|
58
|
-
var _this = _possibleConstructorReturn(this, (MarkerBar.__proto__ || Object.getPrototypeOf(MarkerBar)).call(this, props));
|
|
59
|
-
|
|
60
|
-
_this.getMarkerPosition = _this.getMarkerPosition.bind(_this);
|
|
61
|
-
_this.getTimePos = _this.getTimePos.bind(_this);
|
|
62
|
-
return _this;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
_createClass(MarkerBar, [{
|
|
66
|
-
key: 'getMarkerPosition',
|
|
67
|
-
value: function getMarkerPosition(timePos) {
|
|
68
|
-
var player = this.props.player;
|
|
69
|
-
|
|
70
|
-
var percent = timePos / player.duration;
|
|
71
|
-
return percent >= 1 ? 1 : percent;
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
key: 'getTimePos',
|
|
75
|
-
value: function getTimePos(markerPos) {
|
|
76
|
-
var leftMarker = document.getElementsByClassName('marker-left')[0];
|
|
77
|
-
var rightMarker = document.getElementsByClassName('marker-right')[0];
|
|
78
|
-
if (leftMarker && rightMarker) {
|
|
79
|
-
var leftOffset = leftMarker.offsetLeft;
|
|
80
|
-
var rightOffset = rightMarker.offsetLeft;
|
|
81
|
-
var offsetDiff = rightOffset - leftOffset;
|
|
82
|
-
var position = '50%';
|
|
83
|
-
if (offsetDiff < 61) {
|
|
84
|
-
switch (markerPos) {
|
|
85
|
-
case 'left':
|
|
86
|
-
position = '-20px';
|
|
87
|
-
break;
|
|
88
|
-
case 'right':
|
|
89
|
-
position = '20px';
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return position;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}, {
|
|
97
|
-
key: 'render',
|
|
98
|
-
value: function render() {
|
|
99
|
-
var _props = this.props,
|
|
100
|
-
player = _props.player,
|
|
101
|
-
controlType = _props.controlType,
|
|
102
|
-
playerSelectedMarker = _props.playerSelectedMarker;
|
|
103
|
-
|
|
104
|
-
var leftMarkerPosition = (this.getMarkerPosition(playerSelectedMarker.leftMarker) * 100).toFixed(2) + '%';
|
|
105
|
-
var rightMarkerPosition = (this.getMarkerPosition(playerSelectedMarker.rightMarker) * 100).toFixed(2) + '%';
|
|
106
|
-
|
|
107
|
-
return _react2.default.createElement(
|
|
108
|
-
MarkerBlock,
|
|
109
|
-
{ controlType: controlType, isFullscreen: player.isFullscreen },
|
|
110
|
-
playerSelectedMarker.leftMarker > -1 ? _react2.default.createElement(
|
|
111
|
-
'div',
|
|
112
|
-
{
|
|
113
|
-
className: 'marker marker-left',
|
|
114
|
-
style: { left: leftMarkerPosition }
|
|
115
|
-
},
|
|
116
|
-
_react2.default.createElement(_components.Icon, { name: 'marker', width: 8, height: 7, color: '#00cec6' })
|
|
117
|
-
) : null,
|
|
118
|
-
playerSelectedMarker.rightMarker > -1 ? _react2.default.createElement(
|
|
119
|
-
'div',
|
|
120
|
-
{
|
|
121
|
-
className: 'marker marker-right',
|
|
122
|
-
style: { left: rightMarkerPosition }
|
|
123
|
-
},
|
|
124
|
-
_react2.default.createElement(_components.Icon, { name: 'marker', width: 8, height: 7, color: '#00cec6' })
|
|
125
|
-
) : null
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
}]);
|
|
129
|
-
|
|
130
|
-
return MarkerBar;
|
|
131
|
-
}(_react.Component);
|
|
132
|
-
|
|
133
|
-
exports.default = MarkerBar;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
MarkerBar.propTypes = propTypes;
|
|
137
|
-
MarkerBar.defaultProps = defaultProps;
|
|
138
|
-
MarkerBar.displayName = 'MarkerBar';
|
package/components/Menu.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = Menu;
|
|
7
|
-
|
|
8
|
-
var _react = require('react');
|
|
9
|
-
|
|
10
|
-
var _react2 = _interopRequireDefault(_react);
|
|
11
|
-
|
|
12
|
-
var _styledComponents = require('styled-components');
|
|
13
|
-
|
|
14
|
-
var _styledComponents2 = _interopRequireDefault(_styledComponents);
|
|
15
|
-
|
|
16
|
-
var _propTypes = require('prop-types');
|
|
17
|
-
|
|
18
|
-
var _components = require('@desynova-digital/components');
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
|
-
var propTypes = {
|
|
23
|
-
children: _propTypes.PropTypes.arrayOf(_propTypes.PropTypes.element),
|
|
24
|
-
icon: _propTypes.PropTypes.string,
|
|
25
|
-
style: _propTypes.PropTypes.instanceOf(Object),
|
|
26
|
-
active: _propTypes.PropTypes.bool,
|
|
27
|
-
position: _propTypes.PropTypes.string
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var defaultProps = {
|
|
31
|
-
position: 'center'
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var MenuContainer = _styledComponents2.default.div.withConfig({
|
|
35
|
-
displayName: 'Menu__MenuContainer',
|
|
36
|
-
componentId: 'sc-183o83v-0'
|
|
37
|
-
})(['width:20px;position:relative;&:hover{.menu-popup{visibility:visible;opacity:1;}}.menu-popup{visibility:hidden;opacity:0;position:absolute;bottom:20px;padding-bottom:16px;z-index:10;transition:all 350ms ease-in-out;&.right{left:-10px;&:after{left:15px;}}&.center{left:50%;transform:translateX(-50%);&:after{left:50%;transform:translateX(-50%);}}&.left{right:-10px;&:after{right:15px;}}&.active{visibility:visible;opacity:1;}&:after{content:\'\';border-left:6px solid transparent;position:absolute;border-right:6px solid transparent;border-top:6px solid rgb(0,206,198);bottom:10px;}.menu-list{border-radius:10px;background:#fff;min-width:175px;max-height:500px;transition:all 250ms ease-in-out;overflow:auto;max-height:400px;}}']);
|
|
38
|
-
|
|
39
|
-
var MenuIcon = (0, _styledComponents2.default)(_components.Button).withConfig({
|
|
40
|
-
displayName: 'Menu__MenuIcon',
|
|
41
|
-
componentId: 'sc-183o83v-1'
|
|
42
|
-
})(['background:transparent;border:none;margin:0px;&:hover,&:focus{background:transparent;svg path{fill:#00cec6;}}']);
|
|
43
|
-
|
|
44
|
-
function Menu(_ref) {
|
|
45
|
-
var style = _ref.style,
|
|
46
|
-
children = _ref.children,
|
|
47
|
-
icon = _ref.icon,
|
|
48
|
-
active = _ref.active,
|
|
49
|
-
position = _ref.position;
|
|
50
|
-
|
|
51
|
-
return _react2.default.createElement(
|
|
52
|
-
MenuContainer,
|
|
53
|
-
{ style: style },
|
|
54
|
-
_react2.default.createElement(MenuIcon, {
|
|
55
|
-
display: 'rounded',
|
|
56
|
-
appearance: 'cta',
|
|
57
|
-
icon: icon,
|
|
58
|
-
iconWidth: 16,
|
|
59
|
-
iconHeight: 16,
|
|
60
|
-
width: 20,
|
|
61
|
-
height: 20
|
|
62
|
-
}),
|
|
63
|
-
_react2.default.createElement(
|
|
64
|
-
'div',
|
|
65
|
-
{ className: active ? 'menu-popup active ' + position : 'menu-popup ' + position },
|
|
66
|
-
_react2.default.createElement(
|
|
67
|
-
'div',
|
|
68
|
-
{ className: 'menu-list' },
|
|
69
|
-
children
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
Menu.propTypes = propTypes;
|
|
76
|
-
Menu.defaultProps = defaultProps;
|
|
77
|
-
Menu.displayName = 'Menu';
|