@desynova-digital/player 3.9.7 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/Player.js +945 -0
  2. package/control/AudioTracksMenuButton.js +91 -0
  3. package/control/AudioTracksMenuButton.jsx +80 -0
  4. package/control/ControlBar.js +303 -0
  5. package/control/ControlBar.jsx +264 -0
  6. package/control/CurrentTimeDisplay.js +34 -0
  7. package/control/CurrentTimeDisplay.jsx +35 -0
  8. package/control/DurationDisplay.js +38 -0
  9. package/control/DurationDisplay.jsx +48 -0
  10. package/control/ForwardBackwardControl.js +76 -0
  11. package/control/ForwardBackwardControl.jsx +79 -0
  12. package/control/FullscreenToggle.js +82 -0
  13. package/control/FullscreenToggle.jsx +83 -0
  14. package/control/MarkInControl.js +124 -0
  15. package/control/MarkInControl.jsx +109 -0
  16. package/control/MarkOutControl.js +137 -0
  17. package/control/MarkOutControl.jsx +131 -0
  18. package/control/MarkerBar.js +127 -0
  19. package/control/MarkerBar.jsx +107 -0
  20. package/control/MarkingControl.js +82 -0
  21. package/control/MarkingControl.jsx +143 -0
  22. package/control/MarkingDuration.js +44 -0
  23. package/control/MarkingPreview.js +49 -0
  24. package/control/MarkingPreview.jsx +60 -0
  25. package/control/PlayBackRateControl.js +106 -0
  26. package/control/PlayBackRateControl.jsx +106 -0
  27. package/control/PlayProgressBar.js +61 -0
  28. package/control/PlayProgressBar.jsx +92 -0
  29. package/control/PlayToggle.js +56 -0
  30. package/control/PlayToggle.jsx +57 -0
  31. package/control/PointersBar.js +231 -0
  32. package/control/PointersBar.jsx +286 -0
  33. package/control/ProgressControl.js +127 -0
  34. package/control/ProgressControl.jsx +155 -0
  35. package/control/SeekBar.js +204 -0
  36. package/control/SeekBar.jsx +229 -0
  37. package/control/SettingsMenuButton.js +63 -0
  38. package/control/SettingsMenuButton.jsx +69 -0
  39. package/control/Slider.js +274 -0
  40. package/control/Slider.jsx +243 -0
  41. package/control/Timeline.js +118 -0
  42. package/control/Timeline.jsx +131 -0
  43. package/control/VolumeBar.js +198 -0
  44. package/control/VolumeBar.jsx +174 -0
  45. package/control/VolumeLevel.js +61 -0
  46. package/control/VolumeLevel.jsx +66 -0
  47. package/control/VolumneMenuButton.js +112 -0
  48. package/control/VolumneMenuButton.jsx +111 -0
  49. package/header/Header.js +309 -0
  50. package/header/Header.jsx +479 -0
  51. package/index.js +9 -151
  52. package/media/AudioMeter.js +381 -0
  53. package/media/AudioMeter.jsx +411 -0
  54. package/media/SDOutline.js +82 -0
  55. package/media/SDOutline.jsx +90 -0
  56. package/media/Video.js +684 -0
  57. package/media/Video.jsx +714 -0
  58. package/package.json +5 -1
  59. package/playlist/Playlist.js +67 -0
  60. package/playlist/Playlist.jsx +91 -0
  61. package/playlist/index.js +13 -0
  62. package/shortcuts/Shortcut.js +662 -0
  63. package/utils/Menu.js +50 -0
  64. package/utils/Menu.jsx +105 -0
  65. package/{colors.js → utils/colors.js} +13 -13
  66. package/utils/index.js +52 -122
  67. package/Manager.js +0 -124
  68. package/actions/player.js +0 -375
  69. package/actions/video.js +0 -230
  70. package/components/AudioMeter.js +0 -414
  71. package/components/BigPlayButton.js +0 -110
  72. package/components/ImageViewer.js +0 -318
  73. package/components/MarkerBar.js +0 -138
  74. package/components/Menu.js +0 -77
  75. package/components/Player.js +0 -821
  76. package/components/PlayerHeader.js +0 -472
  77. package/components/Playlist.js +0 -133
  78. package/components/PointersBar.js +0 -299
  79. package/components/PosterImage.js +0 -61
  80. package/components/SDOutline.js +0 -68
  81. package/components/Shortcut.js +0 -621
  82. package/components/Slider.js +0 -317
  83. package/components/TagsBar.js +0 -100
  84. package/components/Video.js +0 -1431
  85. package/components/control-bar/AudioTracksMenuButton.js +0 -113
  86. package/components/control-bar/CameraButton.js +0 -88
  87. package/components/control-bar/CommentsButton.js +0 -216
  88. package/components/control-bar/ControlBar.js +0 -260
  89. package/components/control-bar/EditorControlMenuButton.js +0 -412
  90. package/components/control-bar/ForwardControl.js +0 -17
  91. package/components/control-bar/ForwardReplayControl.js +0 -122
  92. package/components/control-bar/FullscreenToggle.js +0 -101
  93. package/components/control-bar/PlayToggle.js +0 -98
  94. package/components/control-bar/ReplayControl.js +0 -17
  95. package/components/control-bar/SettingsMenuButton.js +0 -43
  96. package/components/control-bar/SubtitleLanguagesMenuButton.js +0 -174
  97. package/components/control-bar/VolumeMenuButton.js +0 -134
  98. package/components/control-bar/ZoomMenuButton.js +0 -116
  99. package/components/marking-controls/MarkInControl.js +0 -140
  100. package/components/marking-controls/MarkOutControl.js +0 -155
  101. package/components/marking-controls/MarkingAddButton.js +0 -94
  102. package/components/marking-controls/MarkingControl.js +0 -135
  103. package/components/marking-controls/MarkingDeleteButton.js +0 -84
  104. package/components/marking-controls/MarkingDuration.js +0 -77
  105. package/components/marking-controls/MarkingPreview.js +0 -86
  106. package/components/progress-bar/AudioWaveform.js +0 -144
  107. package/components/progress-bar/LoadProgressBar.js +0 -90
  108. package/components/progress-bar/MouseTimeDisplay.js +0 -53
  109. package/components/progress-bar/PlayProgressBar.js +0 -79
  110. package/components/progress-bar/ProgressControl.js +0 -222
  111. package/components/progress-bar/SeekBar.js +0 -261
  112. package/components/progress-bar/Timeline.js +0 -134
  113. package/components/settings-menu-control/PlaybackRateControl.js +0 -147
  114. package/components/settings-menu-control/SafeAreaControl.js +0 -92
  115. package/components/settings-menu-control/SettingsMenu.js +0 -68
  116. package/components/settings-menu-control/SubtitleControl.js +0 -1
  117. package/components/time-controls/CurrentTimeDisplay.js +0 -53
  118. package/components/time-controls/DurationDisplay.js +0 -51
  119. package/components/time-controls/TimeDivider.js +0 -41
  120. package/components/volume-control/VolumeBar.js +0 -216
  121. package/components/volume-control/VolumeControl.js +0 -35
  122. package/components/volume-control/VolumeLevel.js +0 -78
  123. package/components/zoom-control/ZoomBar.js +0 -189
  124. package/components/zoom-control/ZoomLevel.js +0 -68
  125. package/reducers/index.js +0 -23
  126. package/reducers/operation.js +0 -36
  127. package/reducers/player.js +0 -222
  128. package/utils/browser.js +0 -29
  129. package/utils/dom.js +0 -104
  130. package/utils/fullscreen.js +0 -73
@@ -0,0 +1,61 @@
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
+ assetType: _propTypes.PropTypes.oneOf(['fc', 'rc']),
17
+ percentage: _propTypes.PropTypes.string,
18
+ vertical: _propTypes.PropTypes.bool
19
+ };
20
+ var defaultProps = {
21
+ percentage: '100%',
22
+ vertical: false
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 ", ";\n }\n"])), function (props) {
25
+ return props.vertical ? '100%' : '0px';
26
+ }, function (props) {
27
+ return props.vertical ? '0' : '100%';
28
+ }, function (props) {
29
+ return props.vertical ? 'initial' : '0px';
30
+ }, function (props) {
31
+ return props.vertical ? '0px' : 'initial';
32
+ }, function (props) {
33
+ return _colors["default"].common.video[props.assetType].base;
34
+ }, function (props) {
35
+ return _colors["default"].common.video[props.assetType].base;
36
+ }, function (props) {
37
+ return _colors["default"].common.video[props.assetType].base;
38
+ });
39
+ function VolumeLevel(_ref) {
40
+ var percentage = _ref.percentage,
41
+ vertical = _ref.vertical,
42
+ assetType = _ref.assetType,
43
+ playerType = _ref.playerType;
44
+ var style = {};
45
+ if (vertical) {
46
+ style.height = percentage;
47
+ } else {
48
+ style.width = percentage;
49
+ }
50
+ return /*#__PURE__*/_react["default"].createElement(VolumeLevelBar, {
51
+ style: style,
52
+ assetType: assetType,
53
+ playerType: playerType,
54
+ vertical: vertical
55
+ });
56
+ }
57
+ VolumeLevel.propTypes = propTypes;
58
+ VolumeLevel.defaultProps = defaultProps;
59
+ VolumeLevel.displayName = 'VolumeLevel';
60
+ var _default = VolumeLevel;
61
+ exports["default"] = _default;
@@ -0,0 +1,66 @@
1
+ import { PropTypes } from 'prop-types';
2
+ import React from 'react';
3
+ import styled from 'styled-components';
4
+ import colors from '../../colors';
5
+
6
+ const propTypes = {
7
+ playerType: PropTypes.oneOf([
8
+ 'dubbing_review',
9
+ 'clipping_default',
10
+ 'default',
11
+ 'tagging',
12
+ 'qc',
13
+ 'subtitle',
14
+ 'snp_edit',
15
+ 'archive',
16
+ 'restore',
17
+ 'clipping',
18
+ 'storyboard',
19
+ 'panel'
20
+ ]),
21
+ assetType: PropTypes.oneOf(['fc', 'rc']),
22
+ percentage: PropTypes.string,
23
+ vertical: PropTypes.bool
24
+ };
25
+
26
+ const defaultProps = {
27
+ percentage: '100%',
28
+ vertical: false
29
+ };
30
+
31
+ const VolumeLevelBar = styled.div`
32
+ position: absolute;
33
+ width: ${(props) => (props.vertical ? '100%' : '0px')};
34
+ height: ${(props) => (props.vertical ? '0' : '100%')};
35
+ left: 0;
36
+ top: ${(props) => (props.vertical ? 'initial' : '0px')};
37
+ bottom: ${(props) => (props.vertical ? '0px' : 'initial')};
38
+ background: ${(props) => colors.common.video[props.assetType].base};
39
+ &:after {
40
+ content: '';
41
+ width: 8px;
42
+ height: 8px;
43
+ position: absolute;
44
+ background: ${(props) => colors.common.video[props.assetType].base};
45
+ border-radius: 100%;
46
+ right: -3px;
47
+ top: -4px;
48
+ box-shadow: 0 0 14px 1px ${(props) => colors.common.video[props.assetType].base};
49
+ }
50
+ `;
51
+
52
+ function VolumeLevel({ percentage, vertical, assetType, playerType }) {
53
+ const style = {};
54
+ if (vertical) {
55
+ style.height = percentage;
56
+ } else {
57
+ style.width = percentage;
58
+ }
59
+
60
+ return <VolumeLevelBar style={style} assetType={assetType} playerType={playerType} vertical={vertical} />;
61
+ }
62
+
63
+ VolumeLevel.propTypes = propTypes;
64
+ VolumeLevel.defaultProps = defaultProps;
65
+ VolumeLevel.displayName = 'VolumeLevel';
66
+ export default VolumeLevel;
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _propTypes = require("prop-types");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
11
+ var _components = require("@desynova-digital/components");
12
+ var _VolumeBar = _interopRequireDefault(require("./VolumeBar"));
13
+ var _templateObject, _templateObject2;
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ 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); }
23
+ 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); }
24
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
+ 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); }; }
26
+ 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); }
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 _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; } }
29
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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
+ actions: _propTypes.PropTypes.instanceOf(Object),
34
+ style: _propTypes.PropTypes.instanceOf(Object)
35
+ };
36
+ var defaultProps = {
37
+ player: {},
38
+ actions: {},
39
+ style: {}
40
+ };
41
+ var VolumeMenu = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 20px;\n position: relative;\n .volume-control-bar {\n width: 30px;\n height: 0px;\n position: absolute;\n bottom: 20px;\n overflow: hidden;\n transition: all 0.5s ease-in-out;\n z-index: 10;\n left: 50%;\n transform: translateX(-50%);\n padding: 0;\n }\n &:hover {\n .volume-control-bar {\n height: 120px;\n overflow: visible;\n padding: 15px;\n }\n svg path {\n fill: #00cec6;\n }\n }\n"])));
42
+ var VolumeButton = (0, _styledComponents["default"])(_components.Button)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: transparent;\n border: none;\n margin: 0px;\n &:hover,\n &:focus {\n background: transparent;\n }\n"])));
43
+ var VolumeMenuButton = /*#__PURE__*/function (_Component) {
44
+ _inherits(VolumeMenuButton, _Component);
45
+ var _super = _createSuper(VolumeMenuButton);
46
+ function VolumeMenuButton(props, context) {
47
+ var _this;
48
+ _classCallCheck(this, VolumeMenuButton);
49
+ _this = _super.call(this, props, context);
50
+ _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
51
+ return _this;
52
+ }
53
+ _createClass(VolumeMenuButton, [{
54
+ key: "volumeLevel",
55
+ get: function get() {
56
+ var _this$props = this.props,
57
+ volume = _this$props.volume,
58
+ muted = _this$props.muted;
59
+ var level = 3;
60
+ if (volume === 0 || muted) {
61
+ level = 0;
62
+ } else if (volume < 0.33) {
63
+ level = 1;
64
+ } else if (volume < 0.67) {
65
+ level = 2;
66
+ }
67
+ return level;
68
+ }
69
+ }, {
70
+ key: "handleClick",
71
+ value: function handleClick() {
72
+ var _this$props2 = this.props,
73
+ actionClick = _this$props2.actionClick,
74
+ muted = _this$props2.muted;
75
+ actionClick({
76
+ action: 'mute',
77
+ value: !muted
78
+ });
79
+ }
80
+ }, {
81
+ key: "render",
82
+ value: function render() {
83
+ var style = this.props.style;
84
+ // const level = this.volumeLevel;
85
+ var vertical = true;
86
+ return /*#__PURE__*/_react["default"].createElement(VolumeMenu, {
87
+ style: style
88
+ }, /*#__PURE__*/_react["default"].createElement(VolumeButton, {
89
+ display: "rounded",
90
+ appearance: "cta",
91
+ icon: "volume",
92
+ iconWidth: 18,
93
+ iconHeight: 18,
94
+ width: 20,
95
+ height: 20,
96
+ onClick: this.handleClick
97
+ }), /*#__PURE__*/_react["default"].createElement("div", {
98
+ className: "volume-control-bar"
99
+ }, /*#__PURE__*/_react["default"].createElement(_VolumeBar["default"], _extends({
100
+ onFocus: this.handleFocus,
101
+ onBlur: this.handleBlur,
102
+ vertical: vertical
103
+ }, this.props))));
104
+ }
105
+ }]);
106
+ return VolumeMenuButton;
107
+ }(_react.Component);
108
+ VolumeMenuButton.propTypes = propTypes;
109
+ VolumeMenuButton.defaultProps = defaultProps;
110
+ VolumeMenuButton.displayName = 'VolumeMenuButton';
111
+ var _default = VolumeMenuButton;
112
+ exports["default"] = _default;
@@ -0,0 +1,111 @@
1
+ import { PropTypes } from 'prop-types';
2
+ import React, { Component } from 'react';
3
+ import styled from 'styled-components';
4
+ import { Button } from '@desynova-digital/components';
5
+ import VolumeBar from './VolumeBar';
6
+
7
+ const propTypes = {
8
+ player: PropTypes.instanceOf(Object),
9
+ actions: PropTypes.instanceOf(Object),
10
+ style: PropTypes.instanceOf(Object)
11
+ };
12
+
13
+ const defaultProps = {
14
+ player: {},
15
+ actions: {},
16
+ style: {}
17
+ };
18
+
19
+ const VolumeMenu = styled.div`
20
+ width: 20px;
21
+ position: relative;
22
+ .volume-control-bar {
23
+ width: 30px;
24
+ height: 0px;
25
+ position: absolute;
26
+ bottom: 20px;
27
+ overflow: hidden;
28
+ transition: all 0.5s ease-in-out;
29
+ z-index: 10;
30
+ left: 50%;
31
+ transform: translateX(-50%);
32
+ padding: 0;
33
+ }
34
+ &:hover {
35
+ .volume-control-bar {
36
+ height: 120px;
37
+ overflow: visible;
38
+ padding: 15px;
39
+ }
40
+ svg path {
41
+ fill: #00cec6;
42
+ }
43
+ }
44
+ `;
45
+
46
+ const VolumeButton = styled(Button)`
47
+ background: transparent;
48
+ border: none;
49
+ margin: 0px;
50
+ &:hover,
51
+ &:focus {
52
+ background: transparent;
53
+ }
54
+ `;
55
+
56
+ class VolumeMenuButton extends Component {
57
+ constructor(props, context) {
58
+ super(props, context);
59
+
60
+ this.handleClick = this.handleClick.bind(this);
61
+ }
62
+
63
+ get volumeLevel() {
64
+ const { volume, muted } = this.props;
65
+ let level = 3;
66
+ if (volume === 0 || muted) {
67
+ level = 0;
68
+ } else if (volume < 0.33) {
69
+ level = 1;
70
+ } else if (volume < 0.67) {
71
+ level = 2;
72
+ }
73
+ return level;
74
+ }
75
+
76
+ handleClick() {
77
+ const { actionClick, muted } = this.props;
78
+ actionClick({
79
+ action: 'mute',
80
+ value: !muted
81
+ });
82
+ }
83
+
84
+ render() {
85
+ const { style } = this.props;
86
+ // const level = this.volumeLevel;
87
+ const vertical = true;
88
+ return (
89
+ <VolumeMenu style={style}>
90
+ <VolumeButton
91
+ display="rounded"
92
+ appearance="cta"
93
+ icon="volume"
94
+ iconWidth={18}
95
+ iconHeight={18}
96
+ width={20}
97
+ height={20}
98
+ onClick={this.handleClick}
99
+ />
100
+ <div className="volume-control-bar">
101
+ <VolumeBar onFocus={this.handleFocus} onBlur={this.handleBlur} vertical={vertical} {...this.props} />
102
+ </div>
103
+ </VolumeMenu>
104
+ );
105
+ }
106
+ }
107
+
108
+ VolumeMenuButton.propTypes = propTypes;
109
+ VolumeMenuButton.defaultProps = defaultProps;
110
+ VolumeMenuButton.displayName = 'VolumeMenuButton';
111
+ export default VolumeMenuButton;