@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,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
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
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -8,73 +8,78 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
var _Menu = _interopRequireDefault(require("../
|
|
11
|
+
var _Menu = _interopRequireDefault(require("../Menu"));
|
|
12
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
12
13
|
var _templateObject;
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
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; }
|
|
16
17
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
18
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
19
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
-
function _toPropertyKey(
|
|
20
|
-
function _toPrimitive(
|
|
21
|
-
function
|
|
22
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
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); }
|
|
22
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24
23
|
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
24
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
-
function _isNativeReflectConstruct() {
|
|
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 _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); }
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
28
29
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
29
30
|
var propTypes = {
|
|
30
31
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
31
|
-
player: _propTypes.PropTypes.instanceOf(Object)
|
|
32
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
33
|
+
theme: _propTypes.PropTypes.string
|
|
32
34
|
};
|
|
33
|
-
var AudioTrackBlock = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: left;\n background: transparent;\n cursor: pointer;\n border-bottom: 1px solid #eeeeee;\n &:last-child {\n border: none;\n }\n &:hover,\n &:focus {\n background:
|
|
35
|
+
var AudioTrackBlock = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: left;\n background: transparent;\n cursor: pointer;\n border-bottom: 1px solid #eeeeee;\n &:last-child {\n border: none;\n }\n &:hover,\n &:focus {\n background: ", ";\n }\n p {\n padding 15px;\n font-family: SFUIText-Medium;\n font-size: 12px;\n white-space: nowrap;\n }\n"])), function (props) {
|
|
36
|
+
return props.theme ? " ".concat(_tokens.colors[props.theme].videoPlayer.rgbaThemeColor) : 'rgba(0, 206, 198, 0.1)';
|
|
37
|
+
});
|
|
34
38
|
var AudioTracksMenuButton = /*#__PURE__*/function (_Component) {
|
|
35
39
|
_inherits(AudioTracksMenuButton, _Component);
|
|
36
|
-
var _super = _createSuper(AudioTracksMenuButton);
|
|
37
40
|
function AudioTracksMenuButton(props, context) {
|
|
38
41
|
_classCallCheck(this, AudioTracksMenuButton);
|
|
39
|
-
return
|
|
42
|
+
return _callSuper(this, AudioTracksMenuButton, [props, context]);
|
|
40
43
|
}
|
|
41
44
|
_createClass(AudioTracksMenuButton, [{
|
|
42
45
|
key: "changeTrack",
|
|
43
46
|
value: function changeTrack(track) {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
action: 'handle_audio_track_change',
|
|
47
|
-
value: track
|
|
48
|
-
});
|
|
47
|
+
var actions = this.props.actions;
|
|
48
|
+
actions.handleAudioTrackChange(track);
|
|
49
49
|
}
|
|
50
50
|
}, {
|
|
51
51
|
key: "render",
|
|
52
52
|
value: function render() {
|
|
53
53
|
var _this = this;
|
|
54
54
|
var _this$props = this.props,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
player = _this$props.player,
|
|
56
|
+
actions = _this$props.actions,
|
|
57
|
+
theme = _this$props.theme;
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, player.audioTracksArr && player.audioTracksArr.length ? /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
59
|
+
theme: theme,
|
|
58
60
|
icon: "audio-track",
|
|
61
|
+
player: player,
|
|
62
|
+
actions: actions,
|
|
59
63
|
style: {
|
|
60
64
|
marginRight: '10px'
|
|
61
65
|
},
|
|
62
66
|
position: "left"
|
|
63
67
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
64
68
|
className: "menu-container"
|
|
65
|
-
}, audioTracksArr.map(function (track) {
|
|
69
|
+
}, player.audioTracksArr.map(function (track) {
|
|
66
70
|
return /*#__PURE__*/_react["default"].createElement(AudioTrackBlock, {
|
|
71
|
+
theme: theme,
|
|
67
72
|
onClick: function onClick() {
|
|
68
73
|
return _this.changeTrack(track);
|
|
69
74
|
},
|
|
70
75
|
role: "presentation",
|
|
71
76
|
key: track.id,
|
|
72
|
-
style: activeAudio && activeAudio.id === track.id ? {
|
|
77
|
+
style: player.activeAudio && player.activeAudio.id === track.id ? {
|
|
73
78
|
pointerEvents: 'none'
|
|
74
79
|
} : null
|
|
75
80
|
}, /*#__PURE__*/_react["default"].createElement("p", {
|
|
76
|
-
style: activeAudio && activeAudio.id === track.id ? {
|
|
77
|
-
color: '#00cec6',
|
|
81
|
+
style: player.activeAudio && player.activeAudio.id === track.id ? {
|
|
82
|
+
color: theme ? " ".concat(_tokens.colors[theme].videoPlayer.themeColor) : '#00cec6',
|
|
78
83
|
pointerEvents: 'none'
|
|
79
84
|
} : {
|
|
80
85
|
color: '#333333'
|
|
@@ -87,5 +92,4 @@ var AudioTracksMenuButton = /*#__PURE__*/function (_Component) {
|
|
|
87
92
|
}(_react.Component);
|
|
88
93
|
AudioTracksMenuButton.propTypes = propTypes;
|
|
89
94
|
AudioTracksMenuButton.displayName = 'AudioTracksMenuButton';
|
|
90
|
-
var _default = AudioTracksMenuButton;
|
|
91
|
-
exports["default"] = _default;
|
|
95
|
+
var _default = exports["default"] = AudioTracksMenuButton;
|
|
@@ -0,0 +1,75 @@
|
|
|
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 _propTypes = require("prop-types");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _components = require("@desynova-digital/components");
|
|
12
|
+
var _utils = require("../../utils");
|
|
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
+
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); } }
|
|
19
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
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); }
|
|
22
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
23
|
+
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); }
|
|
24
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
27
|
+
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); }
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
+
var CameraButtonIcon = (0, _styledComponents["default"])(_components.Button)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0px;\n margin-right: 10px;\n &:hover,\n &:focus {\n background: transparent;\n }\n"])));
|
|
31
|
+
var propTypes = {
|
|
32
|
+
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
33
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
34
|
+
handleClick: _propTypes.PropTypes.func
|
|
35
|
+
};
|
|
36
|
+
var CameraButton = /*#__PURE__*/function (_Component) {
|
|
37
|
+
_inherits(CameraButton, _Component);
|
|
38
|
+
function CameraButton(props, context) {
|
|
39
|
+
var _this;
|
|
40
|
+
_classCallCheck(this, CameraButton);
|
|
41
|
+
_this = _callSuper(this, CameraButton, [props, context]);
|
|
42
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
_createClass(CameraButton, [{
|
|
46
|
+
key: "handleClick",
|
|
47
|
+
value: function handleClick() {
|
|
48
|
+
var _this$props = this.props,
|
|
49
|
+
onTakeSnapshot = _this$props.onTakeSnapshot,
|
|
50
|
+
video = _this$props.video;
|
|
51
|
+
var timeObj = {
|
|
52
|
+
"thumbnail": (0, _utils.secondsToTime)(this.props.video.currentTime, this.props.frameRate, this.props.initialTime),
|
|
53
|
+
"thumbnail_seconds": this.props.video.currentTime
|
|
54
|
+
};
|
|
55
|
+
onTakeSnapshot(timeObj);
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "render",
|
|
59
|
+
value: function render() {
|
|
60
|
+
var playerType = this.props.playerType;
|
|
61
|
+
return playerType === 'tagging' && /*#__PURE__*/_react["default"].createElement(CameraButtonIcon, {
|
|
62
|
+
display: "rounded",
|
|
63
|
+
appearance: "cta",
|
|
64
|
+
icon: "camera",
|
|
65
|
+
iconWidth: 18,
|
|
66
|
+
iconHeight: 18,
|
|
67
|
+
width: 20,
|
|
68
|
+
height: 20,
|
|
69
|
+
onClick: this.handleClick
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}]);
|
|
73
|
+
return CameraButton;
|
|
74
|
+
}(_react.Component);
|
|
75
|
+
var _default = exports["default"] = CameraButton;
|
|
@@ -0,0 +1,186 @@
|
|
|
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 _propTypes = require("prop-types");
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _components = require("@desynova-digital/components");
|
|
12
|
+
var _tokens = require("@desynova-digital/tokens");
|
|
13
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
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 propTypes = {
|
|
32
|
+
player: _propTypes.PropTypes.instanceOf(Object),
|
|
33
|
+
onCommentsAdd: _propTypes.PropTypes.func,
|
|
34
|
+
theme: _propTypes.PropTypes.string
|
|
35
|
+
};
|
|
36
|
+
var CommentsContainer = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
37
|
+
var CommentButton = (0, _styledComponents["default"])(_components.Button)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0 10px !important;\n &:hover,\n &:focus {\n background: transparent;\n ", " {\n svg path {\n fill: ", ";\n }\n }\n }\n ", " {\n transform: translate(-50%, -50%);\n top: 50%;\n left: 50%;\n position: absolute;\n }\n"])), _components.Icon.Element, function (props) {
|
|
38
|
+
return props.theme ? " ".concat(_tokens.colors[props.theme].videoPlayer.themeColor) : '#00cec6';
|
|
39
|
+
}, _components.Icon.Element);
|
|
40
|
+
var CommentBlock = (0, _styledComponents["default"])('div')(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n width: ", ";\n padding: ", ";\n height: ", ";\n overflow: ", ";\n transition: all 250ms ease-in-out;\n background: #fff;\n z-index: 10;\n border-radius: 10px;\n top: ", ";\n left: 50%;\n transform: translateX(-50%);\n ", " {\n border: none;\n resize: none;\n }\n &:after {\n content: '';\n border-left: 6px solid transparent;\n position: absolute;\n border-right: 6px solid transparent;\n border-top: 6px solid rgb(0, 206, 198);\n bottom: -6px;\n left: 50%;\n transform: translateX(-50%);\n }\n"])), function (props) {
|
|
41
|
+
return props.active ? '300px' : '0px';
|
|
42
|
+
}, function (props) {
|
|
43
|
+
return props.active ? '15px 45px 15px 15px' : '0px';
|
|
44
|
+
}, function (props) {
|
|
45
|
+
return props.active ? '100px' : '0px';
|
|
46
|
+
}, function (props) {
|
|
47
|
+
return props.active ? 'visible' : 'hidden';
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return props.active ? '-110px' : '0px';
|
|
50
|
+
}, _components.Textarea.Element);
|
|
51
|
+
var BackButton = (0, _styledComponents["default"])(_components.Button)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0 !important;\n width: 20px;\n height: 20px;\n padding: 0;\n right: 15px;\n top: 10px;\n position: absolute;\n &:hover,\n &:focus {\n background: transparent;\n ", " {\n svg path {\n fill: #000;\n }\n }\n }\n ", " {\n transform: translate(-50%, -50%);\n top: 50%;\n left: 50%;\n position: absolute;\n svg path {\n fill: #000;\n }\n }\n"])), _components.Icon.Element, _components.Icon.Element);
|
|
52
|
+
var SendButton = (0, _styledComponents["default"])(_components.Button)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: rgba(0, 206, 198, 0.1);\n border: none;\n margin: 0 !important;\n width: 30px;\n height: 30px;\n padding: 0;\n position: absolute;\n right: 15px;\n top: calc(100% - 45px);\n &:hover,\n &:focus {\n background: rgba(0, 206, 198, 0.1);\n ", " {\n svg path {\n fill: ", ";\n }\n }\n }\n ", " {\n transform: translate(-50%, -50%);\n top: 50%;\n left: 50%;\n position: absolute;\n svg path {\n fill: ", ";\n }\n }\n"])), _components.Icon.Element, function (props) {
|
|
53
|
+
return props.theme ? " ".concat(_tokens.colors[props.theme].videoPlayer.themeColor) : '#00cec6';
|
|
54
|
+
}, _components.Icon.Element, function (props) {
|
|
55
|
+
return props.theme ? " ".concat(_tokens.colors[props.theme].videoPlayer.themeColor) : '#00cec6';
|
|
56
|
+
});
|
|
57
|
+
var EditorControlMenuButton = exports["default"] = /*#__PURE__*/function (_Component) {
|
|
58
|
+
_inherits(EditorControlMenuButton, _Component);
|
|
59
|
+
function EditorControlMenuButton(props) {
|
|
60
|
+
var _this;
|
|
61
|
+
_classCallCheck(this, EditorControlMenuButton);
|
|
62
|
+
_this = _callSuper(this, EditorControlMenuButton, [props]);
|
|
63
|
+
_this.state = {
|
|
64
|
+
comment: '',
|
|
65
|
+
commentActive: false
|
|
66
|
+
};
|
|
67
|
+
_this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
|
|
68
|
+
return _this;
|
|
69
|
+
}
|
|
70
|
+
_createClass(EditorControlMenuButton, [{
|
|
71
|
+
key: "onCommentEnter",
|
|
72
|
+
value: function onCommentEnter() {
|
|
73
|
+
var _this$props = this.props,
|
|
74
|
+
player = _this$props.player,
|
|
75
|
+
onCommentsAdd = _this$props.onCommentsAdd;
|
|
76
|
+
var comment = this.state.comment;
|
|
77
|
+
var data = {
|
|
78
|
+
comment: comment,
|
|
79
|
+
position: player.currentTime
|
|
80
|
+
};
|
|
81
|
+
onCommentsAdd(data);
|
|
82
|
+
this.onCommentClose();
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "onCommentClose",
|
|
86
|
+
value: function onCommentClose() {
|
|
87
|
+
this.setState({
|
|
88
|
+
commentActive: false,
|
|
89
|
+
comment: ''
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}, {
|
|
93
|
+
key: "onKeyPress",
|
|
94
|
+
value: function onKeyPress(event) {
|
|
95
|
+
var keyCode = event.keyCode ? event.keyCode : event.which;
|
|
96
|
+
var isShiftKey = event.shiftKey;
|
|
97
|
+
if (keyCode === 13 && !isShiftKey) {
|
|
98
|
+
this.onCommentEnter();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "handleClick",
|
|
103
|
+
value: function handleClick() {
|
|
104
|
+
this.setState({
|
|
105
|
+
commentActive: true,
|
|
106
|
+
comment: ''
|
|
107
|
+
}, function () {
|
|
108
|
+
var inputElem = document.querySelectorAll('.comment-block textarea')[0];
|
|
109
|
+
if (inputElem) {
|
|
110
|
+
inputElem.focus();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
key: "updateComment",
|
|
116
|
+
value: function updateComment(event) {
|
|
117
|
+
this.setState({
|
|
118
|
+
comment: event.target.value
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
key: "render",
|
|
123
|
+
value: function render() {
|
|
124
|
+
var _this2 = this;
|
|
125
|
+
var _this$state = this.state,
|
|
126
|
+
comment = _this$state.comment,
|
|
127
|
+
commentActive = _this$state.commentActive;
|
|
128
|
+
var theme = this.props.theme;
|
|
129
|
+
return /*#__PURE__*/_react["default"].createElement(CommentsContainer, null, /*#__PURE__*/_react["default"].createElement(CommentButton, {
|
|
130
|
+
theme: theme,
|
|
131
|
+
display: "rounded",
|
|
132
|
+
appearance: "cta",
|
|
133
|
+
icon: "comment",
|
|
134
|
+
iconWidth: 14,
|
|
135
|
+
iconHeight: 14,
|
|
136
|
+
width: 16,
|
|
137
|
+
height: 16,
|
|
138
|
+
onClick: this.handleClick
|
|
139
|
+
}), /*#__PURE__*/_react["default"].createElement(CommentBlock, {
|
|
140
|
+
className: "comment-block",
|
|
141
|
+
active: commentActive
|
|
142
|
+
}, /*#__PURE__*/_react["default"].createElement(BackButton, _extends({
|
|
143
|
+
display: "rounded",
|
|
144
|
+
appearance: "cta",
|
|
145
|
+
icon: "cross",
|
|
146
|
+
width: 20,
|
|
147
|
+
height: 20,
|
|
148
|
+
iconWidth: 10,
|
|
149
|
+
iconHeight: 10,
|
|
150
|
+
tabIndex: "0",
|
|
151
|
+
onClick: function onClick() {
|
|
152
|
+
return _this2.onCommentClose();
|
|
153
|
+
}
|
|
154
|
+
}, this.props)), /*#__PURE__*/_react["default"].createElement(_components.Textarea, {
|
|
155
|
+
type: "text",
|
|
156
|
+
label: "Comment",
|
|
157
|
+
value: comment,
|
|
158
|
+
resize: false,
|
|
159
|
+
rows: "3",
|
|
160
|
+
onKeyPress: function onKeyPress(e) {
|
|
161
|
+
return _this2.onKeyPress(e);
|
|
162
|
+
},
|
|
163
|
+
onChange: function onChange(e) {
|
|
164
|
+
return _this2.updateComment(e);
|
|
165
|
+
},
|
|
166
|
+
placeholder: "Comment"
|
|
167
|
+
}), /*#__PURE__*/_react["default"].createElement(SendButton, _extends({
|
|
168
|
+
theme: theme,
|
|
169
|
+
display: "rounded",
|
|
170
|
+
appearance: "cta",
|
|
171
|
+
icon: "send",
|
|
172
|
+
width: 30,
|
|
173
|
+
height: 30,
|
|
174
|
+
iconWidth: 12,
|
|
175
|
+
iconHeight: 11,
|
|
176
|
+
tabIndex: "0",
|
|
177
|
+
onClick: function onClick() {
|
|
178
|
+
return _this2.onCommentEnter();
|
|
179
|
+
}
|
|
180
|
+
}, this.props))));
|
|
181
|
+
}
|
|
182
|
+
}]);
|
|
183
|
+
return EditorControlMenuButton;
|
|
184
|
+
}(_react.Component);
|
|
185
|
+
EditorControlMenuButton.propTypes = propTypes;
|
|
186
|
+
EditorControlMenuButton.displayName = 'EditorControlMenuButton';
|