@desynova-digital/player 4.0.1 → 4.0.3
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/Manager.js +99 -0
- package/actions/player.js +331 -0
- package/actions/video.js +206 -0
- package/{utils/colors.js → colors.js} +1 -2
- package/{media → components}/AudioMeter.js +96 -109
- package/components/BigPlayButton.js +84 -0
- package/components/ImageViewer.js +272 -0
- package/{control → components}/MarkerBar.js +33 -24
- package/{utils → components}/Menu.js +13 -4
- package/components/Player.js +706 -0
- package/{header/Header.js → components/PlayerHeader.js} +104 -78
- package/components/Playlist.js +95 -0
- package/{control → components}/PointersBar.js +122 -61
- package/components/PosterImage.js +50 -0
- package/{media → components}/SDOutline.js +13 -49
- package/components/Shortcut.js +821 -0
- package/{control → components}/Slider.js +27 -23
- package/components/TagsBar.js +81 -0
- package/components/Video.js +1280 -0
- package/{control → components/control-bar}/AudioTracksMenuButton.js +32 -28
- package/components/control-bar/CameraButton.js +75 -0
- package/components/control-bar/CommentsButton.js +186 -0
- package/components/control-bar/ControlBar.js +266 -0
- package/components/control-bar/EditorControlMenuButton.js +317 -0
- package/components/control-bar/ForwardControl.js +12 -0
- package/components/control-bar/ForwardReplayControl.js +106 -0
- package/{control → components/control-bar}/FullscreenToggle.js +26 -21
- package/components/control-bar/PlayToggle.js +85 -0
- package/components/control-bar/ReplayControl.js +12 -0
- package/components/control-bar/SettingsMenuButton.js +41 -0
- package/components/control-bar/SubtitleLanguagesMenuButton.js +149 -0
- package/components/control-bar/SubtitleMovementMenu.js +140 -0
- package/{control/VolumneMenuButton.js → components/control-bar/VolumeMenuButton.js} +26 -27
- package/components/control-bar/ZoomMenuButton.js +90 -0
- package/{control → components/marking-controls}/MarkInControl.js +32 -25
- package/{control → components/marking-controls}/MarkOutControl.js +35 -26
- package/components/marking-controls/MarkingAddButton.js +79 -0
- package/components/marking-controls/MarkingControl.js +95 -0
- package/components/marking-controls/MarkingDeleteButton.js +70 -0
- package/{control → components/marking-controls}/MarkingDuration.js +12 -5
- package/components/marking-controls/MarkingPreview.js +72 -0
- package/components/progress-bar/AudioWaveform.js +126 -0
- package/components/progress-bar/LoadProgressBar.js +67 -0
- package/components/progress-bar/MouseTimeDisplay.js +36 -0
- package/{control → components/progress-bar}/PlayProgressBar.js +4 -4
- package/components/progress-bar/ProgressControl.js +186 -0
- package/{control → components/progress-bar}/SeekBar.js +113 -72
- package/{control → components/progress-bar}/Timeline.js +43 -32
- package/{control/PlayBackRateControl.js → components/settings-menu-control/PlaybackRateControl.js} +44 -30
- package/components/settings-menu-control/SafeAreaControl.js +81 -0
- package/components/settings-menu-control/SettingsMenu.js +56 -0
- package/components/settings-menu-control/SubtitleControl.js +1 -0
- package/components/time-controls/CurrentTimeDisplay.js +83 -0
- package/{control → components/time-controls}/DurationDisplay.js +8 -15
- package/components/time-controls/TimeDivider.js +25 -0
- package/{control → components/volume-control}/VolumeBar.js +62 -80
- package/components/volume-control/VolumeControl.js +19 -0
- package/{control → components/volume-control}/VolumeLevel.js +2 -3
- package/components/zoom-control/ZoomBar.js +155 -0
- package/components/zoom-control/ZoomLevel.js +55 -0
- package/index.js +198 -1
- package/package.json +5 -8
- package/reducers/index.js +19 -0
- package/reducers/operation.js +35 -0
- package/reducers/player.js +222 -0
- package/utils/browser.js +30 -0
- package/utils/dom.js +1 -2
- package/utils/fullscreen.js +72 -0
- package/utils/index.js +156 -57
- package/Player.js +0 -945
- package/control/AudioTracksMenuButton.jsx +0 -80
- package/control/ControlBar.js +0 -303
- package/control/ControlBar.jsx +0 -264
- package/control/CurrentTimeDisplay.js +0 -34
- package/control/CurrentTimeDisplay.jsx +0 -35
- package/control/DurationDisplay.jsx +0 -48
- package/control/ForwardBackwardControl.js +0 -76
- package/control/ForwardBackwardControl.jsx +0 -79
- package/control/FullscreenToggle.jsx +0 -83
- package/control/MarkInControl.jsx +0 -109
- package/control/MarkOutControl.jsx +0 -131
- package/control/MarkerBar.jsx +0 -107
- package/control/MarkingControl.js +0 -82
- package/control/MarkingControl.jsx +0 -143
- package/control/MarkingPreview.js +0 -49
- package/control/MarkingPreview.jsx +0 -60
- package/control/PlayBackRateControl.jsx +0 -106
- package/control/PlayProgressBar.jsx +0 -92
- package/control/PlayToggle.js +0 -56
- package/control/PlayToggle.jsx +0 -57
- package/control/PointersBar.jsx +0 -286
- package/control/ProgressControl.js +0 -127
- package/control/ProgressControl.jsx +0 -155
- package/control/SeekBar.jsx +0 -229
- package/control/SettingsMenuButton.js +0 -63
- package/control/SettingsMenuButton.jsx +0 -69
- package/control/Slider.jsx +0 -243
- package/control/Timeline.jsx +0 -131
- package/control/VolumeBar.jsx +0 -174
- package/control/VolumeLevel.jsx +0 -66
- package/control/VolumneMenuButton.jsx +0 -111
- package/header/Header.jsx +0 -479
- package/media/AudioMeter.jsx +0 -411
- package/media/SDOutline.jsx +0 -90
- package/media/Video.js +0 -684
- package/media/Video.jsx +0 -714
- package/playlist/Playlist.js +0 -67
- package/playlist/Playlist.jsx +0 -91
- package/playlist/index.js +0 -13
- package/shortcuts/Shortcut.js +0 -662
- package/utils/Menu.jsx +0 -105
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -7,28 +8,26 @@ exports["default"] = void 0;
|
|
|
7
8
|
var _propTypes = require("prop-types");
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var _templateObject
|
|
11
|
+
var _Slider = _interopRequireDefault(require("../Slider"));
|
|
12
|
+
var _VolumeLevel = _interopRequireDefault(require("./VolumeLevel"));
|
|
13
|
+
var _templateObject;
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
16
|
-
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); }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
17
17
|
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); }
|
|
18
18
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
19
|
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); } }
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
-
function
|
|
22
|
-
function
|
|
23
|
-
function
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
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
|
|
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; } }
|
|
25
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
26
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
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); }
|
|
29
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
28
30
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
29
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
31
|
-
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); }
|
|
32
31
|
var propTypes = {
|
|
33
32
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
34
33
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
@@ -36,37 +35,20 @@ var propTypes = {
|
|
|
36
35
|
onFocus: _propTypes.PropTypes.func,
|
|
37
36
|
onBlur: _propTypes.PropTypes.func
|
|
38
37
|
};
|
|
39
|
-
var defaultProps =
|
|
38
|
+
var defaultProps = {
|
|
40
39
|
actions: {},
|
|
41
40
|
player: {},
|
|
42
41
|
vertical: false,
|
|
43
42
|
onFocus: null,
|
|
44
|
-
onBlur: null
|
|
45
|
-
|
|
46
|
-
}, "vertical", false);
|
|
43
|
+
onBlur: null
|
|
44
|
+
};
|
|
47
45
|
var VolumeControlBar = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 85%;\n position: absolute;\n cursor: pointer;\n z-index: 1;\n width: 2px;\n margin: 0 auto;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
48
|
-
var VolumeLevelBar = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n width: ", ";\n height: ", ";\n left: 0;\n top: ", ";\n bottom: ", ";\n background: ", ";\n &:after {\n content: '';\n width: 8px;\n height: 8px;\n position: absolute;\n background: ", ";\n border-radius: 100%;\n right: -3px;\n top: -4px;\n box-shadow: 0 0 14px 1px ", ";\n }\n"])), function (props) {
|
|
49
|
-
return props.vertical ? '100%' : '0px';
|
|
50
|
-
}, function (props) {
|
|
51
|
-
return props.vertical ? '0' : '100%';
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.vertical ? 'initial' : '0px';
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.vertical ? '0px' : 'initial';
|
|
56
|
-
}, function (props) {
|
|
57
|
-
return _colors["default"].common.video[props.assetType].base;
|
|
58
|
-
}, function (props) {
|
|
59
|
-
return _colors["default"].common.video[props.assetType].base;
|
|
60
|
-
}, function (props) {
|
|
61
|
-
return _colors["default"].common.video[props.assetType].base;
|
|
62
|
-
});
|
|
63
46
|
var VolumeBar = /*#__PURE__*/function (_Component) {
|
|
64
47
|
_inherits(VolumeBar, _Component);
|
|
65
|
-
var _super = _createSuper(VolumeBar);
|
|
66
48
|
function VolumeBar(props, context) {
|
|
67
49
|
var _this;
|
|
68
50
|
_classCallCheck(this, VolumeBar);
|
|
69
|
-
_this =
|
|
51
|
+
_this = _callSuper(this, VolumeBar, [props, context]);
|
|
70
52
|
_this.state = {
|
|
71
53
|
percentage: '0%'
|
|
72
54
|
};
|
|
@@ -76,8 +58,8 @@ var VolumeBar = /*#__PURE__*/function (_Component) {
|
|
|
76
58
|
_this.getPercent = _this.getPercent.bind(_assertThisInitialized(_this));
|
|
77
59
|
_this.stepForward = _this.stepForward.bind(_assertThisInitialized(_this));
|
|
78
60
|
_this.stepBack = _this.stepBack.bind(_assertThisInitialized(_this));
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
62
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
81
63
|
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
82
64
|
return _this;
|
|
83
65
|
}
|
|
@@ -87,51 +69,63 @@ var VolumeBar = /*#__PURE__*/function (_Component) {
|
|
|
87
69
|
}, {
|
|
88
70
|
key: "getPercent",
|
|
89
71
|
value: function getPercent() {
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
volume = _this$props.volume;
|
|
93
|
-
if (muted) {
|
|
72
|
+
var player = this.props.player;
|
|
73
|
+
if (player.muted) {
|
|
94
74
|
return 0;
|
|
95
75
|
}
|
|
96
|
-
return volume;
|
|
76
|
+
return player.volume;
|
|
97
77
|
}
|
|
98
78
|
}, {
|
|
99
79
|
key: "checkMuted",
|
|
100
80
|
value: function checkMuted() {
|
|
101
|
-
var _this$
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (muted) {
|
|
105
|
-
|
|
106
|
-
action: 'mute',
|
|
107
|
-
value: false
|
|
108
|
-
});
|
|
81
|
+
var _this$props = this.props,
|
|
82
|
+
player = _this$props.player,
|
|
83
|
+
actions = _this$props.actions;
|
|
84
|
+
if (player.muted) {
|
|
85
|
+
actions.mute(false);
|
|
109
86
|
}
|
|
110
87
|
}
|
|
111
88
|
}, {
|
|
112
89
|
key: "handleMouseMove",
|
|
113
90
|
value: function handleMouseMove(event) {
|
|
114
|
-
var
|
|
91
|
+
var actions = this.props.actions;
|
|
115
92
|
this.checkMuted();
|
|
116
93
|
var distance = this.slider.calculateDistance(event);
|
|
117
|
-
|
|
118
|
-
action: 'volume',
|
|
119
|
-
value: distance
|
|
120
|
-
});
|
|
94
|
+
actions.changeVolume(distance);
|
|
121
95
|
}
|
|
122
96
|
}, {
|
|
123
97
|
key: "stepForward",
|
|
124
98
|
value: function stepForward() {
|
|
125
|
-
var
|
|
99
|
+
var _this$props2 = this.props,
|
|
100
|
+
player = _this$props2.player,
|
|
101
|
+
actions = _this$props2.actions;
|
|
126
102
|
this.checkMuted();
|
|
127
|
-
actions.changeVolume(volume + 0.1);
|
|
103
|
+
actions.changeVolume(player.volume + 0.1);
|
|
128
104
|
}
|
|
129
105
|
}, {
|
|
130
106
|
key: "stepBack",
|
|
131
107
|
value: function stepBack() {
|
|
132
|
-
var
|
|
108
|
+
var _this$props3 = this.props,
|
|
109
|
+
player = _this$props3.player,
|
|
110
|
+
actions = _this$props3.actions;
|
|
133
111
|
this.checkMuted();
|
|
134
|
-
actions.changeVolume(volume - 0.1);
|
|
112
|
+
actions.changeVolume(player.volume - 0.1);
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
key: "handleFocus",
|
|
116
|
+
value: function handleFocus(e) {
|
|
117
|
+
var onFocus = this.props.onFocus;
|
|
118
|
+
if (onFocus) {
|
|
119
|
+
onFocus(e);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "handleBlur",
|
|
124
|
+
value: function handleBlur(e) {
|
|
125
|
+
var onBlur = this.props.onBlur;
|
|
126
|
+
if (onBlur) {
|
|
127
|
+
onBlur(e);
|
|
128
|
+
}
|
|
135
129
|
}
|
|
136
130
|
}, {
|
|
137
131
|
key: "handlePercentageChange",
|
|
@@ -152,25 +146,17 @@ var VolumeBar = /*#__PURE__*/function (_Component) {
|
|
|
152
146
|
key: "render",
|
|
153
147
|
value: function render() {
|
|
154
148
|
var _this2 = this;
|
|
155
|
-
var _this$
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
volume = _this$props3.volume;
|
|
160
|
-
var style = {};
|
|
161
|
-
if (vertical) {
|
|
162
|
-
style.height = this.getPercent() * 100;
|
|
163
|
-
} else {
|
|
164
|
-
style.width = this.getPercent() * 100;
|
|
165
|
-
}
|
|
166
|
-
var volumeData = (volume * 100).toFixed(2);
|
|
149
|
+
var _this$props4 = this.props,
|
|
150
|
+
player = _this$props4.player,
|
|
151
|
+
vertical = _this$props4.vertical;
|
|
152
|
+
var volume = (player.volume * 100).toFixed(2);
|
|
167
153
|
return /*#__PURE__*/_react["default"].createElement(VolumeControlBar, null, /*#__PURE__*/_react["default"].createElement(_Slider["default"], _extends({
|
|
168
154
|
ref: function ref(c) {
|
|
169
155
|
_this2.slider = c;
|
|
170
156
|
},
|
|
171
157
|
label: "volume level",
|
|
172
|
-
valuenow:
|
|
173
|
-
valuetext: "".concat(
|
|
158
|
+
valuenow: volume,
|
|
159
|
+
valuetext: "".concat(volume, "%"),
|
|
174
160
|
onMouseMove: this.handleMouseMove,
|
|
175
161
|
onFocus: this.handleFocus,
|
|
176
162
|
onBlur: this.handleBlur,
|
|
@@ -181,12 +167,9 @@ var VolumeBar = /*#__PURE__*/function (_Component) {
|
|
|
181
167
|
onPercentageChange: this.handlePercentageChange,
|
|
182
168
|
stepForward: this.stepForward,
|
|
183
169
|
stepBack: this.stepBack
|
|
184
|
-
}, this.props), /*#__PURE__*/_react["default"].createElement(
|
|
185
|
-
style: style,
|
|
186
|
-
assetType: assetType,
|
|
187
|
-
playerType: playerType,
|
|
170
|
+
}, this.props), /*#__PURE__*/_react["default"].createElement(_VolumeLevel["default"], _extends({
|
|
188
171
|
vertical: vertical
|
|
189
|
-
})));
|
|
172
|
+
}, this.props))));
|
|
190
173
|
}
|
|
191
174
|
}]);
|
|
192
175
|
return VolumeBar;
|
|
@@ -194,5 +177,4 @@ var VolumeBar = /*#__PURE__*/function (_Component) {
|
|
|
194
177
|
VolumeBar.propTypes = propTypes;
|
|
195
178
|
VolumeBar.defaultProps = defaultProps;
|
|
196
179
|
VolumeBar.displayName = 'VolumeBar';
|
|
197
|
-
var _default = VolumeBar;
|
|
198
|
-
exports["default"] = _default;
|
|
180
|
+
var _default = exports["default"] = VolumeBar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = VolumeControl;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = require("prop-types");
|
|
9
|
+
var _VolumeBar = _interopRequireDefault(require("./VolumeBar"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
var propTypes = {
|
|
12
|
+
props: _propTypes.PropTypes.instanceOf(Object)
|
|
13
|
+
};
|
|
14
|
+
function VolumeControl(_ref) {
|
|
15
|
+
var props = _ref.props;
|
|
16
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_VolumeBar["default"], props));
|
|
17
|
+
}
|
|
18
|
+
VolumeControl.displayName = 'VolumeControl';
|
|
19
|
+
VolumeControl.propTypes = propTypes;
|
|
@@ -21,7 +21,7 @@ var defaultProps = {
|
|
|
21
21
|
percentage: '100%',
|
|
22
22
|
vertical: false
|
|
23
23
|
};
|
|
24
|
-
var VolumeLevelBar = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n width: ", ";\n height: ", ";\n left: 0;\n top: ", ";\n bottom: ", ";\n background: ", ";\n &:after {\n content: '';\n width: 8px;\n height: 8px;\n position: absolute;\n background: ", ";\n border-radius: 100%;\n right: -3px;\n top: -4px;\n box-shadow: 0 0 14px 1px
|
|
24
|
+
var VolumeLevelBar = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n width: ", ";\n height: ", ";\n left: 0;\n top: ", ";\n bottom: ", ";\n background: ", ";\n &:after {\n content: '';\n width: 8px;\n height: 8px;\n position: absolute;\n background: ", ";\n border-radius: 100%;\n right: -3px;\n top: -4px;\n box-shadow: 0 0 14px 1px\n ", ";\n }\n"])), function (props) {
|
|
25
25
|
return props.vertical ? '100%' : '0px';
|
|
26
26
|
}, function (props) {
|
|
27
27
|
return props.vertical ? '0' : '100%';
|
|
@@ -57,5 +57,4 @@ function VolumeLevel(_ref) {
|
|
|
57
57
|
VolumeLevel.propTypes = propTypes;
|
|
58
58
|
VolumeLevel.defaultProps = defaultProps;
|
|
59
59
|
VolumeLevel.displayName = 'VolumeLevel';
|
|
60
|
-
var _default = VolumeLevel;
|
|
61
|
-
exports["default"] = _default;
|
|
60
|
+
var _default = exports["default"] = VolumeLevel;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
var _Slider = _interopRequireDefault(require("../Slider"));
|
|
12
|
+
var _ZoomLevel = _interopRequireDefault(require("./ZoomLevel"));
|
|
13
|
+
var _templateObject;
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
17
|
+
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); }
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
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); } }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
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 _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
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); }
|
|
29
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
31
|
+
var ZoomControlBar = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 100%;\n position: relative;\n cursor: pointer;\n z-index: 1;\n width: 100%;\n"])));
|
|
32
|
+
var propTypes = {
|
|
33
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
34
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
35
|
+
vertical: _propTypes.PropTypes.bool,
|
|
36
|
+
onFocus: _propTypes.PropTypes.func,
|
|
37
|
+
onBlur: _propTypes.PropTypes.func
|
|
38
|
+
};
|
|
39
|
+
var ZoomBar = /*#__PURE__*/function (_Component) {
|
|
40
|
+
_inherits(ZoomBar, _Component);
|
|
41
|
+
function ZoomBar(props, context) {
|
|
42
|
+
var _this;
|
|
43
|
+
_classCallCheck(this, ZoomBar);
|
|
44
|
+
_this = _callSuper(this, ZoomBar, [props, context]);
|
|
45
|
+
_this.state = {
|
|
46
|
+
percentage: '0%'
|
|
47
|
+
};
|
|
48
|
+
_this.handleMouseMove = _this.handleMouseMove.bind(_assertThisInitialized(_this));
|
|
49
|
+
_this.handlePercentageChange = _this.handlePercentageChange.bind(_assertThisInitialized(_this));
|
|
50
|
+
_this.getPercent = _this.getPercent.bind(_assertThisInitialized(_this));
|
|
51
|
+
_this.stepForward = _this.stepForward.bind(_assertThisInitialized(_this));
|
|
52
|
+
_this.stepBack = _this.stepBack.bind(_assertThisInitialized(_this));
|
|
53
|
+
_this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
|
|
54
|
+
_this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
|
|
55
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
_createClass(ZoomBar, [{
|
|
59
|
+
key: "componentDidMount",
|
|
60
|
+
value: function componentDidMount() {}
|
|
61
|
+
}, {
|
|
62
|
+
key: "getPercent",
|
|
63
|
+
value: function getPercent() {
|
|
64
|
+
var player = this.props.player;
|
|
65
|
+
return player.zoom;
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "handleMouseMove",
|
|
69
|
+
value: function handleMouseMove(event) {
|
|
70
|
+
var actions = this.props.actions;
|
|
71
|
+
var distance = this.slider.calculateDistance(event);
|
|
72
|
+
actions.handleZoomChange(distance);
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "stepForward",
|
|
76
|
+
value: function stepForward() {
|
|
77
|
+
var _this$props = this.props,
|
|
78
|
+
player = _this$props.player,
|
|
79
|
+
actions = _this$props.actions;
|
|
80
|
+
actions.handleZoomChange(player.zoom + 0.1);
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
key: "stepBack",
|
|
84
|
+
value: function stepBack() {
|
|
85
|
+
var _this$props2 = this.props,
|
|
86
|
+
player = _this$props2.player,
|
|
87
|
+
actions = _this$props2.actions;
|
|
88
|
+
actions.handleZoomChange(player.zoom - 0.1);
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "handleFocus",
|
|
92
|
+
value: function handleFocus(e) {
|
|
93
|
+
var onFocus = this.props.onFocus;
|
|
94
|
+
if (onFocus) {
|
|
95
|
+
onFocus(e);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "handleBlur",
|
|
100
|
+
value: function handleBlur(e) {
|
|
101
|
+
var onBlur = this.props.onBlur;
|
|
102
|
+
if (onBlur) {
|
|
103
|
+
onBlur(e);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "handlePercentageChange",
|
|
108
|
+
value: function handlePercentageChange(percent) {
|
|
109
|
+
var percentage = this.state.percentage;
|
|
110
|
+
if (percent !== percentage) {
|
|
111
|
+
this.setState({
|
|
112
|
+
percentage: percent
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "handleClick",
|
|
118
|
+
value: function handleClick(event) {
|
|
119
|
+
event.stopPropagation();
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "render",
|
|
123
|
+
value: function render() {
|
|
124
|
+
var _this2 = this;
|
|
125
|
+
var _this$props3 = this.props,
|
|
126
|
+
player = _this$props3.player,
|
|
127
|
+
vertical = _this$props3.vertical;
|
|
128
|
+
var zoom = (player.zoom * 100).toFixed(2);
|
|
129
|
+
return /*#__PURE__*/_react["default"].createElement(ZoomControlBar, null, /*#__PURE__*/_react["default"].createElement(_Slider["default"], _extends({
|
|
130
|
+
ref: function ref(c) {
|
|
131
|
+
_this2.slider = c;
|
|
132
|
+
},
|
|
133
|
+
label: "zoom level",
|
|
134
|
+
valuenow: zoom,
|
|
135
|
+
valuetext: "".concat(zoom, "%"),
|
|
136
|
+
onMouseMove: this.handleMouseMove,
|
|
137
|
+
onFocus: this.handleFocus,
|
|
138
|
+
onBlur: this.handleBlur,
|
|
139
|
+
onClick: this.handleClick,
|
|
140
|
+
sliderActive: this.handleFocus,
|
|
141
|
+
sliderInactive: this.handleBlur,
|
|
142
|
+
getPercent: this.getPercent,
|
|
143
|
+
onPercentageChange: this.handlePercentageChange,
|
|
144
|
+
stepForward: this.stepForward,
|
|
145
|
+
stepBack: this.stepBack
|
|
146
|
+
}, this.props), /*#__PURE__*/_react["default"].createElement(_ZoomLevel["default"], _extends({
|
|
147
|
+
vertical: vertical
|
|
148
|
+
}, this.props))));
|
|
149
|
+
}
|
|
150
|
+
}]);
|
|
151
|
+
return ZoomBar;
|
|
152
|
+
}(_react.Component);
|
|
153
|
+
ZoomBar.displayName = 'ZoomBar';
|
|
154
|
+
ZoomBar.propTypes = propTypes;
|
|
155
|
+
var _default = exports["default"] = ZoomBar;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 _colors = _interopRequireDefault(require("../../colors"));
|
|
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
|
+
playerType: _propTypes.PropTypes.oneOf(['dubbing_review', 'clipping_default', 'default', 'tagging', 'qc', 'subtitle', 'snp_edit', 'archive', 'restore', 'clipping', 'storyboard', 'panel']),
|
|
16
|
+
percentage: _propTypes.PropTypes.string,
|
|
17
|
+
vertical: _propTypes.PropTypes.bool
|
|
18
|
+
};
|
|
19
|
+
var defaultProps = {
|
|
20
|
+
percentage: '100%',
|
|
21
|
+
vertical: false
|
|
22
|
+
};
|
|
23
|
+
var ZoomLevelBar = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: ", ";\n bottom: ", ";\n background: ", ";\n &:after {\n content: '';\n width: 8px;\n height: 8px;\n position: absolute;\n background: ", ";\n border-radius: 100%;\n right: -3px;\n top: -3px;\n box-shadow: 0 0 14px 1px\n ", ";\n }\n"])), function (props) {
|
|
24
|
+
return props.vertical ? 'initial' : '0px';
|
|
25
|
+
}, function (props) {
|
|
26
|
+
return props.vertical ? '0px' : 'initial';
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return _colors["default"].common.video[props.assetType].base;
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return _colors["default"].common.video[props.assetType].base;
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return _colors["default"].common.video[props.assetType].base;
|
|
33
|
+
});
|
|
34
|
+
function ZoomLevel(_ref) {
|
|
35
|
+
var percentage = _ref.percentage,
|
|
36
|
+
vertical = _ref.vertical,
|
|
37
|
+
playerType = _ref.playerType,
|
|
38
|
+
assetType = _ref.assetType;
|
|
39
|
+
var style = {};
|
|
40
|
+
if (vertical) {
|
|
41
|
+
style.height = percentage;
|
|
42
|
+
} else {
|
|
43
|
+
style.width = percentage;
|
|
44
|
+
}
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement(ZoomLevelBar, {
|
|
46
|
+
style: style,
|
|
47
|
+
playerType: playerType,
|
|
48
|
+
vertical: vertical,
|
|
49
|
+
assetType: assetType
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
ZoomLevel.propTypes = propTypes;
|
|
53
|
+
ZoomLevel.defaultProps = defaultProps;
|
|
54
|
+
ZoomLevel.displayName = 'ZoomLevel';
|
|
55
|
+
var _default = exports["default"] = ZoomLevel;
|