@desynova-digital/player 4.0.4 → 4.0.5
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.
|
@@ -14,7 +14,8 @@ var propTypes = {
|
|
|
14
14
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
15
15
|
style: _propTypes.PropTypes.instanceOf(Object),
|
|
16
16
|
disablePlayerActions: _propTypes.PropTypes.instanceOf(Array),
|
|
17
|
-
theme: _propTypes.PropTypes.string
|
|
17
|
+
theme: _propTypes.PropTypes.string,
|
|
18
|
+
playerType: _propTypes.PropTypes.string
|
|
18
19
|
};
|
|
19
20
|
function SettingsMenuButton(_ref) {
|
|
20
21
|
var style = _ref.style,
|
|
@@ -22,7 +23,8 @@ function SettingsMenuButton(_ref) {
|
|
|
22
23
|
actions = _ref.actions,
|
|
23
24
|
_ref$disablePlayerAct = _ref.disablePlayerActions,
|
|
24
25
|
disablePlayerActions = _ref$disablePlayerAct === void 0 ? [] : _ref$disablePlayerAct,
|
|
25
|
-
theme = _ref.theme
|
|
26
|
+
theme = _ref.theme,
|
|
27
|
+
playerType = _ref.playerType;
|
|
26
28
|
return /*#__PURE__*/_react["default"].createElement(_Menu["default"], {
|
|
27
29
|
theme: theme,
|
|
28
30
|
icon: "settings",
|
|
@@ -34,7 +36,8 @@ function SettingsMenuButton(_ref) {
|
|
|
34
36
|
theme: theme,
|
|
35
37
|
player: player,
|
|
36
38
|
actions: actions,
|
|
37
|
-
disablePlayerActions: disablePlayerActions
|
|
39
|
+
disablePlayerActions: disablePlayerActions,
|
|
40
|
+
playerType: playerType
|
|
38
41
|
}));
|
|
39
42
|
}
|
|
40
43
|
SettingsMenuButton.propTypes = propTypes;
|
|
@@ -30,9 +30,10 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
30
30
|
var propTypes = {
|
|
31
31
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
32
32
|
player: _propTypes.PropTypes.instanceOf(Object),
|
|
33
|
-
theme: _propTypes.PropTypes.string
|
|
33
|
+
theme: _propTypes.PropTypes.string,
|
|
34
|
+
playerType: _propTypes.PropTypes.string
|
|
34
35
|
};
|
|
35
|
-
var PlaybackRateBlock = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n background: transparent;\n font-family: SFUIText-Medium;\n font-size: 12px;\n text-transform: uppercase;\n align-items: center;\n padding: 0 !important;\n .playback-block {\n display: flex;\n justify-content: flex-start;\n border-bottom: 1px solid #eeeeee;\n p {\n margin-left: 10px;\n white-space: nowrap;\n }\n }\n .playback-rate-body {\n padding: 0 !important;\n display: flex;\n justify-content: space-between;\n .playback-rate {\n border-right: 1px solid #eeeeee;\n &:last-child {\n border: none;\n }\n &:hover {\n background: ", ";\n }\n &.active {\n pointer-events: none;\n color:", ";\n }\n }\n }\n"])), function (props) {
|
|
36
|
+
var PlaybackRateBlock = (0, _styledComponents["default"])('div')(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n background: transparent;\n font-family: SFUIText-Medium;\n font-size: 12px;\n text-transform: uppercase;\n align-items: center;\n padding: 0 !important;\n .playback-block {\n display: flex;\n justify-content: flex-start;\n border-bottom: 1px solid #eeeeee;\n p {\n margin-left: 10px;\n white-space: nowrap;\n }\n }\n .playback-rate-body {\n padding: 0 !important;\n display: flex;\n justify-content: space-between;\n .playback-rate {\n border-right: 1px solid #eeeeee;\n &:last-child {\n border: none;\n }\n &:hover {\n background: ", ";\n }\n &.active {\n pointer-events: none;\n color: ", ";\n }\n }\n }\n"])), function (props) {
|
|
36
37
|
return props.disablePlayerActions.includes('playback_rate') ? '' : props.theme ? "".concat(_tokens.colors[props.theme].videoPlayer.rgbaThemeColor) : 'rgba(0, 206, 198, 0.1)';
|
|
37
38
|
}, function (props) {
|
|
38
39
|
return props.theme ? " ".concat(_tokens.colors[props.theme].videoPlayer.themeColor) : '#00cec6';
|
|
@@ -47,6 +48,20 @@ var PlaybackRateControl = exports["default"] = /*#__PURE__*/function (_Component
|
|
|
47
48
|
return _this;
|
|
48
49
|
}
|
|
49
50
|
_createClass(PlaybackRateControl, [{
|
|
51
|
+
key: "componentDidUpdate",
|
|
52
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
53
|
+
var _this$props = this.props,
|
|
54
|
+
playerType = _this$props.playerType,
|
|
55
|
+
player = _this$props.player,
|
|
56
|
+
actions = _this$props.actions;
|
|
57
|
+
if (prevProps.playerType !== playerType && player.playbackRate !== 1) {
|
|
58
|
+
actions.changeRate(1, {
|
|
59
|
+
action: 'fast-forward',
|
|
60
|
+
source: 'shortcut'
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
50
65
|
key: "changePlaybackRate",
|
|
51
66
|
value: function changePlaybackRate(playbackRate) {
|
|
52
67
|
var disablePlayerActions = this.props.disablePlayerActions;
|
|
@@ -61,10 +76,10 @@ var PlaybackRateControl = exports["default"] = /*#__PURE__*/function (_Component
|
|
|
61
76
|
key: "render",
|
|
62
77
|
value: function render() {
|
|
63
78
|
var _this2 = this;
|
|
64
|
-
var _this$
|
|
65
|
-
player = _this$
|
|
66
|
-
disablePlayerActions = _this$
|
|
67
|
-
theme = _this$
|
|
79
|
+
var _this$props2 = this.props,
|
|
80
|
+
player = _this$props2.player,
|
|
81
|
+
disablePlayerActions = _this$props2.disablePlayerActions,
|
|
82
|
+
theme = _this$props2.theme;
|
|
68
83
|
return /*#__PURE__*/_react["default"].createElement(PlaybackRateBlock, {
|
|
69
84
|
theme: theme,
|
|
70
85
|
disablePlayerActions: disablePlayerActions
|
|
@@ -21,9 +21,10 @@ var propTypes = {
|
|
|
21
21
|
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
22
22
|
style: _propTypes.PropTypes.instanceOf(Object),
|
|
23
23
|
disablePlayerActions: _propTypes.PropTypes.instanceOf(Array),
|
|
24
|
-
theme: _propTypes.PropTypes.string
|
|
24
|
+
theme: _propTypes.PropTypes.string,
|
|
25
|
+
playerType: _propTypes.PropTypes.string
|
|
25
26
|
};
|
|
26
|
-
var SettingsMenuContainer = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n position: relative;\n .settings-menu-tile {\n background: transparent;\n div {\n padding: 15px;\n
|
|
27
|
+
var SettingsMenuContainer = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n position: relative;\n .safe-area {\n cursor: pointer;\n }\n .settings-menu-tile {\n background: transparent;\n div {\n padding: 15px;\n }\n }\n .playback {\n cursor: ", ";\n }\n"])), function (props) {
|
|
27
28
|
return props.disablePlayerActions.includes('playback_rate') ? 'not-allowed' : 'pointer';
|
|
28
29
|
});
|
|
29
30
|
function SettingsMenu(_ref) {
|
|
@@ -32,7 +33,8 @@ function SettingsMenu(_ref) {
|
|
|
32
33
|
style = _ref.style,
|
|
33
34
|
_ref$disablePlayerAct = _ref.disablePlayerActions,
|
|
34
35
|
disablePlayerActions = _ref$disablePlayerAct === void 0 ? [] : _ref$disablePlayerAct,
|
|
35
|
-
theme = _ref.theme
|
|
36
|
+
theme = _ref.theme,
|
|
37
|
+
playerType = _ref.playerType;
|
|
36
38
|
return /*#__PURE__*/_react["default"].createElement(SettingsMenuContainer, {
|
|
37
39
|
theme: theme,
|
|
38
40
|
style: style,
|
|
@@ -49,7 +51,8 @@ function SettingsMenu(_ref) {
|
|
|
49
51
|
theme: theme,
|
|
50
52
|
player: player,
|
|
51
53
|
actions: actions,
|
|
52
|
-
disablePlayerActions: disablePlayerActions
|
|
54
|
+
disablePlayerActions: disablePlayerActions,
|
|
55
|
+
playerType: playerType
|
|
53
56
|
})));
|
|
54
57
|
}
|
|
55
58
|
SettingsMenu.propTypes = propTypes;
|