@desynova-digital/player 3.9.7 → 3.9.8

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 (68) hide show
  1. package/Manager.js +26 -50
  2. package/actions/player.js +58 -89
  3. package/actions/video.js +70 -69
  4. package/colors.js +13 -13
  5. package/components/AudioMeter.js +138 -182
  6. package/components/BigPlayButton.js +48 -72
  7. package/components/ImageViewer.js +120 -165
  8. package/components/MarkerBar.js +64 -75
  9. package/components/Menu.js +30 -57
  10. package/components/Player.js +267 -327
  11. package/components/PlayerHeader.js +213 -348
  12. package/components/Playlist.js +50 -89
  13. package/components/PointersBar.js +131 -203
  14. package/components/PosterImage.js +12 -22
  15. package/components/SDOutline.js +32 -54
  16. package/components/Shortcut.js +135 -140
  17. package/components/Slider.js +85 -128
  18. package/components/TagsBar.js +45 -62
  19. package/components/Video.js +479 -655
  20. package/components/control-bar/AudioTracksMenuButton.js +63 -86
  21. package/components/control-bar/CameraButton.js +65 -76
  22. package/components/control-bar/CommentsButton.js +97 -136
  23. package/components/control-bar/ControlBar.js +171 -164
  24. package/components/control-bar/EditorControlMenuButton.js +180 -280
  25. package/components/control-bar/ForwardControl.js +7 -11
  26. package/components/control-bar/ForwardReplayControl.js +41 -55
  27. package/components/control-bar/FullscreenToggle.js +48 -67
  28. package/components/control-bar/PlayToggle.js +39 -54
  29. package/components/control-bar/ReplayControl.js +7 -11
  30. package/components/control-bar/SettingsMenuButton.js +19 -29
  31. package/components/control-bar/SubtitleLanguagesMenuButton.js +90 -119
  32. package/components/control-bar/SubtitleMovementMenu.js +128 -0
  33. package/components/control-bar/VolumeMenuButton.js +71 -96
  34. package/components/control-bar/ZoomMenuButton.js +57 -81
  35. package/components/marking-controls/MarkInControl.js +49 -65
  36. package/components/marking-controls/MarkOutControl.js +53 -69
  37. package/components/marking-controls/MarkingAddButton.js +41 -54
  38. package/components/marking-controls/MarkingControl.js +58 -107
  39. package/components/marking-controls/MarkingDeleteButton.js +39 -51
  40. package/components/marking-controls/MarkingDuration.js +23 -56
  41. package/components/marking-controls/MarkingPreview.js +39 -51
  42. package/components/progress-bar/AudioWaveform.js +48 -64
  43. package/components/progress-bar/LoadProgressBar.js +14 -37
  44. package/components/progress-bar/MouseTimeDisplay.js +14 -30
  45. package/components/progress-bar/PlayProgressBar.js +23 -41
  46. package/components/progress-bar/ProgressControl.js +82 -141
  47. package/components/progress-bar/SeekBar.js +101 -169
  48. package/components/progress-bar/Timeline.js +57 -81
  49. package/components/settings-menu-control/PlaybackRateControl.js +70 -115
  50. package/components/settings-menu-control/SafeAreaControl.js +49 -65
  51. package/components/settings-menu-control/SettingsMenu.js +26 -50
  52. package/components/time-controls/CurrentTimeDisplay.js +15 -34
  53. package/components/time-controls/DurationDisplay.js +14 -33
  54. package/components/time-controls/TimeDivider.js +12 -28
  55. package/components/volume-control/VolumeBar.js +84 -118
  56. package/components/volume-control/VolumeControl.js +7 -23
  57. package/components/volume-control/VolumeLevel.js +19 -36
  58. package/components/zoom-control/ZoomBar.js +79 -111
  59. package/components/zoom-control/ZoomLevel.js +24 -36
  60. package/index.js +204 -149
  61. package/package.json +5 -1
  62. package/reducers/index.js +12 -14
  63. package/reducers/operation.js +14 -14
  64. package/reducers/player.js +40 -42
  65. package/utils/browser.js +10 -5
  66. package/utils/dom.js +4 -15
  67. package/utils/fullscreen.js +24 -24
  68. package/utils/index.js +35 -46
@@ -1,57 +1,41 @@
1
- 'use strict';
1
+ "use strict";
2
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
-
7
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8
-
9
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
10
-
11
- var _propTypes = require('prop-types');
12
-
13
- var _react = require('react');
14
-
15
- var _react2 = _interopRequireDefault(_react);
16
-
17
- var _styledComponents = require('styled-components');
18
-
19
- var _styledComponents2 = _interopRequireDefault(_styledComponents);
20
-
21
- var _hls = require('hls.js');
22
-
23
- var _hls2 = _interopRequireDefault(_hls);
24
-
25
- var _Manager = require('../Manager');
26
-
27
- var _Manager2 = _interopRequireDefault(_Manager);
28
-
29
- var _utils = require('../utils');
30
-
31
- var _BigPlayButton = require('./BigPlayButton');
32
-
33
- var _BigPlayButton2 = _interopRequireDefault(_BigPlayButton);
34
-
35
- var _PosterImage = require('./PosterImage');
36
-
37
- var _PosterImage2 = _interopRequireDefault(_PosterImage);
38
-
39
- var _SDOutline = require('./SDOutline');
40
-
41
- var _SDOutline2 = _interopRequireDefault(_SDOutline);
42
-
43
- var _components = require('@desynova-digital/components/components');
44
-
45
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
46
-
47
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
48
-
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 _hls = _interopRequireDefault(require("hls.js"));
12
+ var _Manager = _interopRequireDefault(require("../Manager"));
13
+ var _utils = require("../utils");
14
+ var _BigPlayButton = _interopRequireDefault(require("./BigPlayButton"));
15
+ var _PosterImage = _interopRequireDefault(require("./PosterImage"));
16
+ var _SDOutline = _interopRequireDefault(require("./SDOutline"));
17
+ var _components = require("@desynova-digital/components/components");
18
+ var _templateObject, _templateObject2;
19
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20
+ 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); }
21
+ 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; }
22
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24
+ 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; }
25
+ 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); }
49
26
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
50
-
51
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
52
-
53
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
54
-
27
+ 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); } }
28
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
+ 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); }
31
+ 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); }
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+ 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); }; }
34
+ 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); }
35
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
36
+ 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; } }
37
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
38
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
55
39
  var propTypes = {
56
40
  actions: _propTypes.PropTypes.instanceOf(Object),
57
41
  player: _propTypes.PropTypes.instanceOf(Object),
@@ -101,7 +85,6 @@ var propTypes = {
101
85
  userEmail: _propTypes.PropTypes.string,
102
86
  playerSelectedMarker: _propTypes.PropTypes.instanceOf(Object)
103
87
  };
104
-
105
88
  var defaultProps = {
106
89
  startTime: 0,
107
90
  loop: false,
@@ -112,25 +95,15 @@ var defaultProps = {
112
95
  aspectRatio: 'auto',
113
96
  crossOrigin: 'anonymous'
114
97
  };
115
-
116
- var SubTitleSection = _styledComponents2.default.div.withConfig({
117
- displayName: 'Video__SubTitleSection',
118
- componentId: 'sc-omlcc3-0'
119
- })(['position:absolute;font-family:SFUIText-Regular;font-size:16px;bottom:20px;width:100%;display:flex;justify-content:center;text-align:center;color:#FFFFFF;height:90%;align-items:center;.subtitleContainer{border-radius:4px;width:fit-content;background:#000000;opacity:0.9;padding:8px 10px;line-height:20px;position:absolute;}']);
120
-
121
- var VideoBlock = _styledComponents2.default.div.withConfig({
122
- displayName: 'Video__VideoBlock',
123
- componentId: 'sc-omlcc3-1'
124
- })(['position:relative;&.video-react-player-block{position:relative;transition:all 0.1s ease-in-out;-moz-transition:all 0.1s ease-in-out;-webkit-transition:all 0.1s ease-in-out;-ms-transition:all 0.1s ease-in-out;-o-transition:all 0.1s ease-in-out;video{position:absolute;top:0;left:0;width:100%;height:100%;right:0;bottom:0;}.audio-tracks{position:relative;display:flex;background:rgba(0,0,0,0.5);color:#fff;z-index:10;position:absolute;width:100%;bottom:0;p{cursor:pointer;padding:10px;}}.loader-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center;position:absolute;z-index:10;background:rgba(0,0,0,0.5)}}&.ratio-border{border:1px solid rgba(255,255,255,0.5);&:after{content:\'16:9 Safe Area\';position:absolute;color:#fff;font-family:SFUIText-Regular;font-size:12px;transform:rotate(-90deg);top:20%;left:-50px;}}']);
125
-
126
- var Video = function (_Component) {
98
+ var SubTitleSection = _styledComponents["default"].div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n font-family: SFUIText-Regular;\n font-size: 16px;\n bottom: 20px;\n width: 100%;\n display: flex;\n justify-content: center;\n text-align: center;\n color: #FFFFFF;\n height: 90%;\n align-items: center;\n \n .subtitleContainer{\n border-radius: 4px;\n width: fit-content;\n background: #000000;\n opacity: 0.9;\n padding: 8px 10px;\n line-height: 20px;\n position: absolute;\n }\n"])));
99
+ var VideoBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n &.video-react-player-block {\n position: relative;\n transition: all 0.1s ease-in-out;\n -moz-transition: all 0.1s ease-in-out;\n -webkit-transition: all 0.1s ease-in-out;\n -ms-transition: all 0.1s ease-in-out;\n -o-transition: all 0.1s ease-in-out;\n video {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n right: 0;\n bottom: 0;\n }\n .audio-tracks {\n position: relative;\n display: flex;\n background: rgba(0, 0, 0, 0.5);\n color: #fff;\n z-index: 10;\n position: absolute;\n width: 100%;\n bottom: 0;\n p {\n cursor: pointer;\n padding: 10px;\n }\n }\n .loader-container {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n z-index: 10;\n background: rgba(0,0,0,0.5)\n }\n }\n &.ratio-border {\n border: 1px solid rgba(255, 255, 255, 0.5);\n &:after {\n content: '16:9 Safe Area';\n position: absolute;\n color: #fff;\n font-family: SFUIText-Regular;\n font-size: 12px;\n transform: rotate(-90deg);\n top: 20%;\n left: -50px;\n }\n }\n"])));
100
+ var Video = /*#__PURE__*/function (_Component) {
127
101
  _inherits(Video, _Component);
128
-
102
+ var _super = _createSuper(Video);
129
103
  function Video(props) {
104
+ var _this;
130
105
  _classCallCheck(this, Video);
131
-
132
- var _this = _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).call(this, props));
133
-
106
+ _this = _super.call(this, props);
134
107
  _this.state = {
135
108
  audioTracks: [],
136
109
  isM3U8: false,
@@ -150,60 +123,57 @@ var Video = function (_Component) {
150
123
  currentSubtitleObj: {}
151
124
  };
152
125
  _this.video = null; // the html5 video
153
- _this.manager = new _Manager2.default(props.store);
154
- _this.getStyle = _this.getStyle.bind(_this);
155
- _this.getChildren = _this.getChildren.bind(_this);
156
- _this.play = _this.play.bind(_this);
157
- _this.pause = _this.pause.bind(_this);
158
- _this.seek = _this.seek.bind(_this);
159
- _this.forward = _this.forward.bind(_this);
160
- _this.replay = _this.replay.bind(_this);
161
- _this.toggleFullscreen = _this.toggleFullscreen.bind(_this);
162
- _this.getProperties = _this.getProperties.bind(_this);
163
- _this.renderChildren = _this.renderChildren.bind(_this);
164
- _this.handleLoadStart = _this.handleLoadStart.bind(_this);
165
- _this.handleCanPlay = _this.handleCanPlay.bind(_this);
166
- _this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_this);
167
- _this.handlePlay = _this.handlePlay.bind(_this);
168
- _this.handlePlaying = _this.handlePlaying.bind(_this);
169
- _this.handlePause = _this.handlePause.bind(_this);
170
- _this.handleEnded = _this.handleEnded.bind(_this);
171
- _this.handleWaiting = _this.handleWaiting.bind(_this);
172
- _this.handleSeeking = _this.handleSeeking.bind(_this);
173
- _this.handleSeeked = _this.handleSeeked.bind(_this);
174
- _this.handleFullscreenChange = _this.handleFullscreenChange.bind(_this);
175
- _this.handleError = _this.handleError.bind(_this);
176
- _this.handleSuspend = _this.handleSuspend.bind(_this);
177
- _this.handleAbort = _this.handleAbort.bind(_this);
178
- _this.handleEmptied = _this.handleEmptied.bind(_this);
179
- _this.handleStalled = _this.handleStalled.bind(_this);
180
- _this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_this);
181
- _this.handleLoadedData = _this.handleLoadedData.bind(_this);
182
- _this.handleTimeUpdate = _this.handleTimeUpdate.bind(_this);
183
- _this.handleRateChange = _this.handleRateChange.bind(_this);
184
- _this.handleVolumeChange = _this.handleVolumeChange.bind(_this);
185
- _this.handleDurationChange = _this.handleDurationChange.bind(_this);
186
- _this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_this), 250);
187
- _this.handleKeypress = _this.handleKeypress.bind(_this);
188
- _this.audioVisualizer = _this.audioVisualizer.bind(_this);
189
- _this.checkWatermark = _this.checkWatermark.bind(_this);
126
+ _this.manager = new _Manager["default"](props.store);
127
+ _this.getStyle = _this.getStyle.bind(_assertThisInitialized(_this));
128
+ _this.getChildren = _this.getChildren.bind(_assertThisInitialized(_this));
129
+ _this.play = _this.play.bind(_assertThisInitialized(_this));
130
+ _this.pause = _this.pause.bind(_assertThisInitialized(_this));
131
+ _this.seek = _this.seek.bind(_assertThisInitialized(_this));
132
+ _this.forward = _this.forward.bind(_assertThisInitialized(_this));
133
+ _this.replay = _this.replay.bind(_assertThisInitialized(_this));
134
+ _this.toggleFullscreen = _this.toggleFullscreen.bind(_assertThisInitialized(_this));
135
+ _this.getProperties = _this.getProperties.bind(_assertThisInitialized(_this));
136
+ _this.renderChildren = _this.renderChildren.bind(_assertThisInitialized(_this));
137
+ _this.handleLoadStart = _this.handleLoadStart.bind(_assertThisInitialized(_this));
138
+ _this.handleCanPlay = _this.handleCanPlay.bind(_assertThisInitialized(_this));
139
+ _this.handleCanPlayThrough = _this.handleCanPlayThrough.bind(_assertThisInitialized(_this));
140
+ _this.handlePlay = _this.handlePlay.bind(_assertThisInitialized(_this));
141
+ _this.handlePlaying = _this.handlePlaying.bind(_assertThisInitialized(_this));
142
+ _this.handlePause = _this.handlePause.bind(_assertThisInitialized(_this));
143
+ _this.handleEnded = _this.handleEnded.bind(_assertThisInitialized(_this));
144
+ _this.handleWaiting = _this.handleWaiting.bind(_assertThisInitialized(_this));
145
+ _this.handleSeeking = _this.handleSeeking.bind(_assertThisInitialized(_this));
146
+ _this.handleSeeked = _this.handleSeeked.bind(_assertThisInitialized(_this));
147
+ _this.handleFullscreenChange = _this.handleFullscreenChange.bind(_assertThisInitialized(_this));
148
+ _this.handleError = _this.handleError.bind(_assertThisInitialized(_this));
149
+ _this.handleSuspend = _this.handleSuspend.bind(_assertThisInitialized(_this));
150
+ _this.handleAbort = _this.handleAbort.bind(_assertThisInitialized(_this));
151
+ _this.handleEmptied = _this.handleEmptied.bind(_assertThisInitialized(_this));
152
+ _this.handleStalled = _this.handleStalled.bind(_assertThisInitialized(_this));
153
+ _this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_assertThisInitialized(_this));
154
+ _this.handleLoadedData = _this.handleLoadedData.bind(_assertThisInitialized(_this));
155
+ _this.handleTimeUpdate = _this.handleTimeUpdate.bind(_assertThisInitialized(_this));
156
+ _this.handleRateChange = _this.handleRateChange.bind(_assertThisInitialized(_this));
157
+ _this.handleVolumeChange = _this.handleVolumeChange.bind(_assertThisInitialized(_this));
158
+ _this.handleDurationChange = _this.handleDurationChange.bind(_assertThisInitialized(_this));
159
+ _this.handleProgress = (0, _utils.throttle)(_this.handleProgress.bind(_assertThisInitialized(_this)), 250);
160
+ _this.handleKeypress = _this.handleKeypress.bind(_assertThisInitialized(_this));
161
+ _this.audioVisualizer = _this.audioVisualizer.bind(_assertThisInitialized(_this));
162
+ _this.checkWatermark = _this.checkWatermark.bind(_assertThisInitialized(_this));
190
163
  return _this;
191
164
  }
192
-
193
165
  _createClass(Video, [{
194
- key: 'componentDidMount',
166
+ key: "componentDidMount",
195
167
  value: function componentDidMount() {
196
168
  var src = this.props.src;
197
-
198
169
  var isM3U8 = src.split('.').pop() === 'm3u8' ? true : false;
199
170
  this.setState({
200
171
  isM3U8: isM3U8
201
172
  });
202
- if (_hls2.default.isSupported() && isM3U8) {
203
- var _manager$getState = this.manager.getState(),
204
- HLSConfig = _manager$getState.player.HLSConfig;
205
-
206
- this.hls = new _hls2.default(HLSConfig);
173
+ if (_hls["default"].isSupported() && isM3U8) {
174
+ var _this$manager$getStat = this.manager.getState(),
175
+ HLSConfig = _this$manager$getStat.player.HLSConfig;
176
+ this.hls = new _hls["default"](HLSConfig);
207
177
  this.setupHLS(src);
208
178
  } else {
209
179
  this.video.src = src;
@@ -215,13 +185,12 @@ var Video = function (_Component) {
215
185
  });
216
186
  }
217
187
  }, {
218
- key: 'componentWillUnmount',
188
+ key: "componentWillUnmount",
219
189
  value: function componentWillUnmount() {
220
- var _state = this.state,
221
- isM3U8 = _state.isM3U8,
222
- watermarkInterval = _state.watermarkInterval;
223
-
224
- if (_hls2.default.isSupported() && isM3U8) {
190
+ var _this$state = this.state,
191
+ isM3U8 = _this$state.isM3U8,
192
+ watermarkInterval = _this$state.watermarkInterval;
193
+ if (_hls["default"].isSupported() && isM3U8) {
225
194
  this.hls.detachMedia();
226
195
  } else {
227
196
  this.video.src = '';
@@ -232,21 +201,18 @@ var Video = function (_Component) {
232
201
  /**
233
202
  * This function is triggered on interval to shuffle the position of watermark on Player area
234
203
  */
235
-
236
204
  }, {
237
- key: 'checkWatermark',
205
+ key: "checkWatermark",
238
206
  value: function checkWatermark() {
239
207
  var watermark = this.state.watermark;
240
- var _props = this.props,
241
- onPlayerClose = _props.onPlayerClose,
242
- userEmail = _props.userEmail;
243
-
208
+ var _this$props = this.props,
209
+ onPlayerClose = _this$props.onPlayerClose,
210
+ userEmail = _this$props.userEmail;
244
211
  var watermark_text = document.querySelector('#watermark-text');
245
212
  var video_player = null;
246
213
  var watermark_dimension = null;
247
214
  var text_css = null;
248
215
  var bool_text = false;
249
-
250
216
  if (!watermark_text) {
251
217
  onPlayerClose();
252
218
  } else {
@@ -271,35 +237,33 @@ var Video = function (_Component) {
271
237
  });
272
238
  }
273
239
  }, {
274
- key: 'setupHLS',
240
+ key: "setupHLS",
275
241
  value: function setupHLS(src) {
276
242
  var _this2 = this;
277
-
278
- var _props2 = this.props,
279
- actions = _props2.actions,
280
- activeTrackIndex = _props2.activeTrackIndex;
281
-
243
+ var _this$props2 = this.props,
244
+ actions = _this$props2.actions,
245
+ activeTrackIndex = _this$props2.activeTrackIndex;
282
246
  var self = this;
283
247
  // bind them together
284
248
  this.hls.attachMedia(this.video);
285
- this.hls.on(_hls2.default.Events.MEDIA_ATTACHED, function () {
249
+ this.hls.on(_hls["default"].Events.MEDIA_ATTACHED, function () {
286
250
  self.hls.loadSource(src);
287
251
  });
288
- this.hls.on(_hls2.default.Events.MANIFEST_PARSED, function (event, data) {
252
+ this.hls.on(_hls["default"].Events.MANIFEST_PARSED, function (event, data) {
289
253
  var trackIndex = activeTrackIndex || 0;
290
254
  actions.handleAudioTracks(data.audioTracks);
291
255
  actions.handleAudioTrackChange(data.audioTracks[trackIndex]);
292
256
  });
293
- this.hls.on(_hls2.default.Events.ERROR, function (event, data) {
257
+ this.hls.on(_hls["default"].Events.ERROR, function (event, data) {
294
258
  // eslint-disable-next-line no-console
295
259
  console.log('HLS.Events.ERROR: ', event, data);
296
260
  if (data.fatal) {
297
261
  switch (data.type) {
298
- case _hls2.default.ErrorTypes.NETWORK_ERROR:
262
+ case _hls["default"].ErrorTypes.NETWORK_ERROR:
299
263
  // try to recover network error
300
264
  _this2.hls.startLoad();
301
265
  break;
302
- case _hls2.default.ErrorTypes.MEDIA_ERROR:
266
+ case _hls["default"].ErrorTypes.MEDIA_ERROR:
303
267
  _this2.hls.recoverMediaError();
304
268
  break;
305
269
  default:
@@ -313,28 +277,36 @@ var Video = function (_Component) {
313
277
  });
314
278
  }
315
279
  }, {
316
- key: 'getDefaultChildren',
280
+ key: "getDefaultChildren",
317
281
  value: function getDefaultChildren(props) {
318
- return [_react2.default.createElement(_PosterImage2.default, _extends({ key: 'poster-image', order: 1.0 }, props)), _react2.default.createElement(_SDOutline2.default, _extends({ key: 'sd-outline', order: 2.0 }, props)), _react2.default.createElement(_BigPlayButton2.default, _extends({ key: 'big-play-button', order: 5.0 }, props))];
282
+ return [/*#__PURE__*/_react["default"].createElement(_PosterImage["default"], _extends({
283
+ key: "poster-image",
284
+ order: 1.0
285
+ }, props)), /*#__PURE__*/_react["default"].createElement(_SDOutline["default"], _extends({
286
+ key: "sd-outline",
287
+ order: 2.0
288
+ }, props)), /*#__PURE__*/_react["default"].createElement(_BigPlayButton["default"], _extends({
289
+ key: "big-play-button",
290
+ order: 5.0
291
+ }, props))];
319
292
  }
320
293
  }, {
321
- key: 'getChildren',
294
+ key: "getChildren",
322
295
  value: function getChildren(props) {
323
- var propsWithoutChildren = _extends({}, props, {
296
+ var propsWithoutChildren = _objectSpread(_objectSpread({}, props), {}, {
324
297
  children: null
325
298
  });
326
299
  var children = this.props.children;
327
-
328
- var childs = _react2.default.Children.toArray(children).filter(function (e) {
300
+ var childs = _react["default"].Children.toArray(children).filter(function (e) {
329
301
  return !(0, _utils.isVideoChild)(e);
330
302
  });
331
303
  var defaultChildren = this.getDefaultChildren(propsWithoutChildren, props);
332
304
  return (0, _utils.mergeAndSortChildren)(defaultChildren, childs, propsWithoutChildren);
333
305
  }
334
306
  }, {
335
- key: 'setWidthOrHeight',
307
+ key: "setWidthOrHeight",
336
308
  value: function setWidthOrHeight(style, name, value) {
337
- var styleVal = void 0;
309
+ var styleVal;
338
310
  if (typeof value === 'string') {
339
311
  if (value === 'auto') {
340
312
  styleVal = 'auto';
@@ -342,28 +314,25 @@ var Video = function (_Component) {
342
314
  styleVal = value;
343
315
  }
344
316
  } else if (typeof value === 'number') {
345
- styleVal = value + 'px';
317
+ styleVal = "".concat(value, "px");
346
318
  }
347
319
  Object.assign(style, _defineProperty({}, name, styleVal));
348
320
  }
349
321
  }, {
350
- key: 'getStyle',
322
+ key: "getStyle",
351
323
  value: function getStyle() {
352
324
  var fluid = this.props.fluid;
353
-
354
- var _manager$getState2 = this.manager.getState(),
355
- player = _manager$getState2.player;
356
-
325
+ var _this$manager$getStat2 = this.manager.getState(),
326
+ player = _this$manager$getStat2.player;
357
327
  var style = {};
358
- var _props3 = this.props,
359
- aspectRatio = _props3.aspectRatio,
360
- width = _props3.width,
361
- height = _props3.height;
328
+ var _this$props3 = this.props,
329
+ aspectRatio = _this$props3.aspectRatio,
330
+ width = _this$props3.width,
331
+ height = _this$props3.height;
362
332
  /*
363
333
  * The aspect ratio is either used directly
364
334
  * or to calculate width and height.
365
335
  */
366
-
367
336
  if (player.videoWidth) {
368
337
  // Otherwise try to get the aspect ratio from the video metadata
369
338
  aspectRatio = '16:9';
@@ -376,7 +345,6 @@ var Video = function (_Component) {
376
345
  // Get the ratio as a decimal we can use to calculate dimensions
377
346
  var ratioParts = aspectRatio.split(':');
378
347
  var ratioMultiplier = ratioParts[1] / ratioParts[0];
379
-
380
348
  if (height !== undefined) {
381
349
  // Or calulate the width from the aspect ratio if a height has been set
382
350
  width = height / ratioMultiplier;
@@ -385,9 +353,8 @@ var Video = function (_Component) {
385
353
  width = player.videoWidth || 400;
386
354
  height = width * ratioMultiplier;
387
355
  }
388
-
389
356
  if (fluid) {
390
- style.paddingTop = ratioMultiplier * 100 + '%';
357
+ style.paddingTop = "".concat(ratioMultiplier * 100, "%");
391
358
  } else {
392
359
  // If Width contains 'auto', set 'auto' in style
393
360
  this.setWidthOrHeight(style, 'width', width);
@@ -398,16 +365,13 @@ var Video = function (_Component) {
398
365
  }
399
366
 
400
367
  // get all video properties
401
-
402
368
  }, {
403
- key: 'getProperties',
369
+ key: "getProperties",
404
370
  value: function getProperties() {
405
371
  var _this3 = this;
406
-
407
372
  if (!this.video) {
408
373
  return null;
409
374
  }
410
-
411
375
  return _utils.mediaProperties.reduce(function (properties, key) {
412
376
  properties[key] = _this3.video[key];
413
377
  return properties;
@@ -415,20 +379,66 @@ var Video = function (_Component) {
415
379
  }
416
380
 
417
381
  // get playback rate
382
+ }, {
383
+ key: "playbackRate",
384
+ get: function get() {
385
+ return this.video.playbackRate;
386
+ }
418
387
 
388
+ /*
389
+ * set playback rate
390
+ * speed of video
391
+ */,
392
+ set: function set(rate) {
393
+ this.video.playbackRate = rate;
394
+ }
419
395
  }, {
420
- key: 'UNSAFE_componentWillReceiveProps',
421
- value: function UNSAFE_componentWillReceiveProps(newProps) {
422
- var _props4 = this.props,
423
- src = _props4.src,
424
- activeAudio = _props4.player.activeAudio,
425
- currentSubtitleObj = _props4.currentSubtitleObj,
426
- markers = _props4.markers;
396
+ key: "muted",
397
+ get: function get() {
398
+ return this.video.muted;
399
+ },
400
+ set: function set(val) {
401
+ this.video.muted = val;
402
+ }
403
+ }, {
404
+ key: "volume",
405
+ get: function get() {
406
+ return this.video.volume;
407
+ },
408
+ set: function set(val) {
409
+ if (val > 1) {
410
+ val = 1;
411
+ }
412
+ if (val < 0) {
413
+ val = 0;
414
+ }
415
+ this.video.volume = val;
416
+ }
417
+
418
+ // video width
419
+ }, {
420
+ key: "videoWidth",
421
+ get: function get() {
422
+ return this.video.videoWidth;
423
+ }
427
424
 
425
+ // video height
426
+ }, {
427
+ key: "videoHeight",
428
+ get: function get() {
429
+ return this.video.videoHeight;
430
+ }
431
+ }, {
432
+ key: "UNSAFE_componentWillReceiveProps",
433
+ value: function UNSAFE_componentWillReceiveProps(newProps) {
434
+ var _this$props4 = this.props,
435
+ src = _this$props4.src,
436
+ activeAudio = _this$props4.player.activeAudio,
437
+ currentSubtitleObj = _this$props4.currentSubtitleObj,
438
+ markers = _this$props4.markers;
428
439
  if (newProps.src !== src) {
429
440
  var isM3U8 = this.state.isM3U8;
430
-
431
- if (_hls2.default.isSupported() && isM3U8) {
441
+ if (_hls["default"].isSupported() && isM3U8) {
432
442
  this.hls.detachMedia();
433
443
  } else {
434
444
  this.video.src = '';
@@ -437,17 +447,17 @@ var Video = function (_Component) {
437
447
  this.setState({
438
448
  isM3U8: m3u8
439
449
  });
440
- if (_hls2.default.isSupported() && m3u8) {
441
- var _manager$getState3 = this.manager.getState(),
442
- HLSConfig = _manager$getState3.player.HLSConfig;
443
-
444
- this.hls = new _hls2.default(HLSConfig);
450
+ if (_hls["default"].isSupported() && m3u8) {
451
+ var _this$manager$getStat3 = this.manager.getState(),
452
+ HLSConfig = _this$manager$getStat3.player.HLSConfig;
453
+ this.hls = new _hls["default"](HLSConfig);
445
454
  this.setupHLS(newProps.src);
446
455
  } else {
447
456
  this.video.src = newProps.src;
448
457
  }
449
458
  this.forceUpdate(); // make sure the children can get the video property
450
459
  }
460
+
451
461
  if (newProps.player.activeAudio && activeAudio && activeAudio.id !== newProps.player.activeAudio.id) {
452
462
  this.hls.audioTrack = newProps.player.activeAudio.id;
453
463
  }
@@ -478,59 +488,51 @@ var Video = function (_Component) {
478
488
  }
479
489
 
480
490
  // play the video
481
-
482
491
  }, {
483
- key: 'play',
492
+ key: "play",
484
493
  value: function play() {
485
494
  var promise = this.video.play();
486
495
  if (promise !== undefined) {
487
- promise.catch(function () {}).then(function () {});
496
+ promise["catch"](function () {}).then(function () {});
488
497
  }
489
498
  }
490
499
 
491
500
  // pause the video
492
-
493
501
  }, {
494
- key: 'pause',
502
+ key: "pause",
495
503
  value: function pause() {
496
504
  var promise = this.video.pause();
497
505
  if (promise !== undefined) {
498
- promise.catch(function () {}).then(function () {});
506
+ promise["catch"](function () {}).then(function () {});
499
507
  }
500
508
  }
501
509
 
502
510
  // Change the video source and re-load the video:
503
-
504
511
  }, {
505
- key: 'load',
512
+ key: "load",
506
513
  value: function load() {
507
514
  this.video.load();
508
515
  }
509
516
 
510
517
  // Add a new text track to the video
511
-
512
518
  }, {
513
- key: 'addTextTrack',
519
+ key: "addTextTrack",
514
520
  value: function addTextTrack() {
515
- var _video;
516
-
517
- (_video = this.video).addTextTrack.apply(_video, arguments);
521
+ var _this$video;
522
+ (_this$video = this.video).addTextTrack.apply(_this$video, arguments);
518
523
  }
519
524
 
520
525
  // Check if your browser can play different types of video:
521
-
522
526
  }, {
523
- key: 'canPlayType',
527
+ key: "canPlayType",
524
528
  value: function canPlayType() {
525
- var _video2;
526
-
527
- (_video2 = this.video).canPlayType.apply(_video2, arguments);
529
+ var _this$video2;
530
+ (_this$video2 = this.video).canPlayType.apply(_this$video2, arguments);
528
531
  }
529
532
 
530
533
  // toggle play
531
-
532
534
  }, {
533
- key: 'togglePlay',
535
+ key: "togglePlay",
534
536
  value: function togglePlay() {
535
537
  if (this.video.paused) {
536
538
  this.play();
@@ -540,9 +542,8 @@ var Video = function (_Component) {
540
542
  }
541
543
 
542
544
  // seek video by time
543
-
544
545
  }, {
545
- key: 'seek',
546
+ key: "seek",
546
547
  value: function seek(time) {
547
548
  try {
548
549
  this.video.currentTime = time;
@@ -552,30 +553,26 @@ var Video = function (_Component) {
552
553
  }
553
554
 
554
555
  // jump forward x seconds
555
-
556
556
  }, {
557
- key: 'forward',
557
+ key: "forward",
558
558
  value: function forward(seconds) {
559
559
  this.seek(this.video.currentTime + seconds);
560
560
  }
561
561
 
562
562
  // jump back x seconds
563
-
564
563
  }, {
565
- key: 'replay',
564
+ key: "replay",
566
565
  value: function replay(seconds) {
567
566
  this.forward(-seconds);
568
567
  }
569
568
 
570
569
  // enter or exist full screen
571
-
572
570
  }, {
573
- key: 'toggleFullscreen',
571
+ key: "toggleFullscreen",
574
572
  value: function toggleFullscreen() {
575
- var _props5 = this.props,
576
- player = _props5.player,
577
- actions = _props5.actions;
578
-
573
+ var _this$props5 = this.props,
574
+ player = _this$props5.player,
575
+ actions = _this$props5.actions;
579
576
  actions.toggleFullscreen(player);
580
577
  }
581
578
 
@@ -583,23 +580,19 @@ var Video = function (_Component) {
583
580
  * Fired when the user agent
584
581
  * begins looking for media data
585
582
  */
586
-
587
583
  }, {
588
- key: 'handleLoadStart',
584
+ key: "handleLoadStart",
589
585
  value: function handleLoadStart() {
590
- var _props6 = this.props,
591
- actions = _props6.actions,
592
- onLoadStart = _props6.onLoadStart,
593
- fileType = _props6.fileType;
594
-
595
-
586
+ var _this$props6 = this.props,
587
+ actions = _this$props6.actions,
588
+ onLoadStart = _this$props6.onLoadStart,
589
+ fileType = _this$props6.fileType;
596
590
  if (fileType === 'audio') {
597
591
  this.audioVisualizer();
598
592
  }
599
-
600
593
  actions.handleLoadStart(this.getProperties());
601
594
  if (onLoadStart) {
602
- onLoadStart.apply(undefined, arguments);
595
+ onLoadStart.apply(void 0, arguments);
603
596
  }
604
597
  }
605
598
 
@@ -607,19 +600,15 @@ var Video = function (_Component) {
607
600
  * A handler for events that
608
601
  * signal that waiting has ended
609
602
  */
610
-
611
603
  }, {
612
- key: 'handleCanPlay',
604
+ key: "handleCanPlay",
613
605
  value: function handleCanPlay() {
614
- var _props7 = this.props,
615
- actions = _props7.actions,
616
- onCanPlay = _props7.onCanPlay;
617
-
618
-
606
+ var _this$props7 = this.props,
607
+ actions = _this$props7.actions,
608
+ onCanPlay = _this$props7.onCanPlay;
619
609
  actions.handleCanPlay(this.getProperties());
620
-
621
610
  if (onCanPlay) {
622
- onCanPlay.apply(undefined, arguments);
611
+ onCanPlay.apply(void 0, arguments);
623
612
  }
624
613
  }
625
614
 
@@ -627,18 +616,15 @@ var Video = function (_Component) {
627
616
  * A handler for events that
628
617
  * signal that waiting has ended
629
618
  */
630
-
631
619
  }, {
632
- key: 'handleCanPlayThrough',
620
+ key: "handleCanPlayThrough",
633
621
  value: function handleCanPlayThrough() {
634
- var _props8 = this.props,
635
- actions = _props8.actions,
636
- onCanPlayThrough = _props8.onCanPlayThrough;
637
-
622
+ var _this$props8 = this.props,
623
+ actions = _this$props8.actions,
624
+ onCanPlayThrough = _this$props8.onCanPlayThrough;
638
625
  actions.handleCanPlayThrough(this.getProperties());
639
-
640
626
  if (onCanPlayThrough) {
641
- onCanPlayThrough.apply(undefined, arguments);
627
+ onCanPlayThrough.apply(void 0, arguments);
642
628
  }
643
629
  }
644
630
 
@@ -646,50 +632,41 @@ var Video = function (_Component) {
646
632
  * A handler for events that
647
633
  * signal that waiting has ended
648
634
  */
649
-
650
635
  }, {
651
- key: 'handlePlaying',
636
+ key: "handlePlaying",
652
637
  value: function handlePlaying() {
653
- var _props9 = this.props,
654
- actions = _props9.actions,
655
- onPlaying = _props9.onPlaying;
656
-
638
+ var _this$props9 = this.props,
639
+ actions = _this$props9.actions,
640
+ onPlaying = _this$props9.onPlaying;
657
641
  actions.handlePlaying(this.getProperties());
658
-
659
642
  if (onPlaying) {
660
- onPlaying.apply(undefined, arguments);
643
+ onPlaying.apply(void 0, arguments);
661
644
  }
662
645
  }
663
646
 
664
647
  // Fired whenever the media has been started
665
-
666
648
  }, {
667
- key: 'handlePlay',
649
+ key: "handlePlay",
668
650
  value: function handlePlay() {
669
- var _props10 = this.props,
670
- actions = _props10.actions,
671
- onPlay = _props10.onPlay;
672
-
651
+ var _this$props10 = this.props,
652
+ actions = _this$props10.actions,
653
+ onPlay = _this$props10.onPlay;
673
654
  actions.handlePlay(this.getProperties());
674
-
675
655
  if (onPlay) {
676
- onPlay.apply(undefined, arguments);
656
+ onPlay.apply(void 0, arguments);
677
657
  }
678
658
  }
679
659
 
680
660
  // Fired whenever the media has been paused
681
-
682
661
  }, {
683
- key: 'handlePause',
662
+ key: "handlePause",
684
663
  value: function handlePause() {
685
- var _props11 = this.props,
686
- actions = _props11.actions,
687
- onPause = _props11.onPause;
688
-
664
+ var _this$props11 = this.props,
665
+ actions = _this$props11.actions,
666
+ onPause = _this$props11.onPause;
689
667
  actions.handlePause(this.getProperties());
690
-
691
668
  if (onPause) {
692
- onPause.apply(undefined, arguments);
669
+ onPause.apply(void 0, arguments);
693
670
  }
694
671
  }
695
672
 
@@ -697,18 +674,15 @@ var Video = function (_Component) {
697
674
  * Fired when the duration of
698
675
  * the media resource is first known or changed
699
676
  */
700
-
701
677
  }, {
702
- key: 'handleDurationChange',
678
+ key: "handleDurationChange",
703
679
  value: function handleDurationChange() {
704
- var _props12 = this.props,
705
- actions = _props12.actions,
706
- onDurationChange = _props12.onDurationChange;
707
-
680
+ var _this$props12 = this.props,
681
+ actions = _this$props12.actions,
682
+ onDurationChange = _this$props12.onDurationChange;
708
683
  actions.handleDurationChange(this.getProperties());
709
-
710
684
  if (onDurationChange) {
711
- onDurationChange.apply(undefined, arguments);
685
+ onDurationChange.apply(void 0, arguments);
712
686
  }
713
687
  }
714
688
 
@@ -716,24 +690,21 @@ var Video = function (_Component) {
716
690
  * Fired while the user agent
717
691
  * is downloading media data
718
692
  */
719
-
720
693
  }, {
721
- key: 'handleProgress',
694
+ key: "handleProgress",
722
695
  value: function handleProgress() {
723
- var _props13 = this.props,
724
- actions = _props13.actions,
725
- onProgress = _props13.onProgress;
726
-
696
+ var _this$props13 = this.props,
697
+ actions = _this$props13.actions,
698
+ onProgress = _this$props13.onProgress;
727
699
  if (this.video) {
728
700
  actions.handleProgressChange(this.getProperties());
729
701
  }
730
-
731
702
  if (onProgress) {
732
- onProgress.apply(undefined, arguments);
703
+ onProgress.apply(void 0, arguments);
733
704
  }
734
705
  }
735
706
  }, {
736
- key: 'getSubtitleStyle',
707
+ key: "getSubtitleStyle",
737
708
  value: function getSubtitleStyle(data) {
738
709
  var style = {};
739
710
  style.top = data && data.text_position === 'text_position_top' ? '0px' : '';
@@ -743,15 +714,14 @@ var Video = function (_Component) {
743
714
  return style;
744
715
  }
745
716
  }, {
746
- key: 'displaySubtitle',
717
+ key: "displaySubtitle",
747
718
  value: function displaySubtitle(marker) {
748
- var _props14 = this.props,
749
- markers = _props14.markers,
750
- resetSubtitleData = _props14.resetSubtitleData,
751
- subtitleReadOnly = _props14.subtitleReadOnly,
752
- subtitleDataList = _props14.subtitleDataList;
719
+ var _this$props14 = this.props,
720
+ markers = _this$props14.markers,
721
+ resetSubtitleData = _this$props14.resetSubtitleData,
722
+ subtitleReadOnly = _this$props14.subtitleReadOnly,
723
+ subtitleDataList = _this$props14.subtitleDataList;
753
724
  var currentSubtitleObj = this.state.currentSubtitleObj;
754
-
755
725
  if (resetSubtitleData) {
756
726
  resetSubtitleData();
757
727
  }
@@ -788,16 +758,14 @@ var Video = function (_Component) {
788
758
  * Fired when the end of the media resource
789
759
  * is reached (currentTime == duration)
790
760
  */
791
-
792
761
  }, {
793
- key: 'handleEnded',
762
+ key: "handleEnded",
794
763
  value: function handleEnded() {
795
- var _props15 = this.props,
796
- loop = _props15.loop,
797
- player = _props15.player,
798
- actions = _props15.actions,
799
- onEnded = _props15.onEnded;
800
-
764
+ var _this$props15 = this.props,
765
+ loop = _this$props15.loop,
766
+ player = _this$props15.player,
767
+ actions = _this$props15.actions,
768
+ onEnded = _this$props15.onEnded;
801
769
  if (loop) {
802
770
  this.seek(0);
803
771
  this.play();
@@ -805,25 +773,21 @@ var Video = function (_Component) {
805
773
  this.pause();
806
774
  }
807
775
  actions.handleEnd(this.getProperties());
808
-
809
776
  if (onEnded) {
810
- onEnded.apply(undefined, arguments);
777
+ onEnded.apply(void 0, arguments);
811
778
  }
812
779
  }
813
780
 
814
781
  // Fired whenever the media begins waiting
815
-
816
782
  }, {
817
- key: 'handleWaiting',
783
+ key: "handleWaiting",
818
784
  value: function handleWaiting() {
819
- var _props16 = this.props,
820
- actions = _props16.actions,
821
- onWaiting = _props16.onWaiting;
822
-
785
+ var _this$props16 = this.props,
786
+ actions = _this$props16.actions,
787
+ onWaiting = _this$props16.onWaiting;
823
788
  actions.handleWaiting(this.getProperties());
824
-
825
789
  if (onWaiting) {
826
- onWaiting.apply(undefined, arguments);
790
+ onWaiting.apply(void 0, arguments);
827
791
  }
828
792
  }
829
793
 
@@ -831,18 +795,15 @@ var Video = function (_Component) {
831
795
  * Fired whenever the player
832
796
  * is jumping to a new time
833
797
  */
834
-
835
798
  }, {
836
- key: 'handleSeeking',
799
+ key: "handleSeeking",
837
800
  value: function handleSeeking() {
838
- var _props17 = this.props,
839
- actions = _props17.actions,
840
- onSeeking = _props17.onSeeking;
841
-
801
+ var _this$props17 = this.props,
802
+ actions = _this$props17.actions,
803
+ onSeeking = _this$props17.onSeeking;
842
804
  actions.handleSeeking(this.getProperties());
843
-
844
805
  if (onSeeking) {
845
- onSeeking.apply(undefined, arguments);
806
+ onSeeking.apply(void 0, arguments);
846
807
  }
847
808
  }
848
809
 
@@ -850,72 +811,62 @@ var Video = function (_Component) {
850
811
  * Fired when the player has
851
812
  * finished jumping to a new time
852
813
  */
853
-
854
814
  }, {
855
- key: 'handleSeeked',
815
+ key: "handleSeeked",
856
816
  value: function handleSeeked() {
857
- var _props18 = this.props,
858
- actions = _props18.actions,
859
- onSeeked = _props18.onSeeked;
860
-
817
+ var _this$props18 = this.props,
818
+ actions = _this$props18.actions,
819
+ onSeeked = _this$props18.onSeeked;
861
820
  actions.handleSeeked(this.getProperties());
862
-
863
821
  if (onSeeked) {
864
- onSeeked.apply(undefined, arguments);
822
+ onSeeked.apply(void 0, arguments);
865
823
  }
866
824
  }
867
825
 
868
826
  // Handle Fullscreen Change
869
-
870
827
  }, {
871
- key: 'handleFullscreenChange',
828
+ key: "handleFullscreenChange",
872
829
  value: function handleFullscreenChange() {}
873
830
 
874
831
  /*
875
832
  * Fires when the browser is
876
833
  * intentionally not getting media data
877
834
  */
878
-
879
835
  }, {
880
- key: 'handleSuspend',
836
+ key: "handleSuspend",
881
837
  value: function handleSuspend() {
882
- var _props19 = this.props,
883
- actions = _props19.actions,
884
- onSuspend = _props19.onSuspend;
885
-
838
+ var _this$props19 = this.props,
839
+ actions = _this$props19.actions,
840
+ onSuspend = _this$props19.onSuspend;
886
841
  actions.handleSuspend(this.getProperties());
887
842
  if (onSuspend) {
888
- onSuspend.apply(undefined, arguments);
843
+ onSuspend.apply(void 0, arguments);
889
844
  }
890
845
  }
891
846
 
892
847
  // Fires when the loading of an audio/video is aborted
893
-
894
848
  }, {
895
- key: 'handleAbort',
849
+ key: "handleAbort",
896
850
  value: function handleAbort() {
897
- var _props20 = this.props,
898
- actions = _props20.actions,
899
- onAbort = _props20.onAbort;
900
-
851
+ var _this$props20 = this.props,
852
+ actions = _this$props20.actions,
853
+ onAbort = _this$props20.onAbort;
901
854
  actions.handleAbort(this.getProperties());
902
855
  if (onAbort) {
903
- onAbort.apply(undefined, arguments);
856
+ onAbort.apply(void 0, arguments);
904
857
  }
905
858
  }
906
859
 
907
860
  // Fires when the current playlist is empty
908
-
909
861
  }, {
910
- key: 'handleEmptied',
862
+ key: "handleEmptied",
911
863
  value: function handleEmptied() {
912
- var _props21 = this.props,
913
- actions = _props21.actions,
914
- onEmptied = _props21.onEmptied;
915
-
864
+ var _this$props21 = this.props,
865
+ actions = _this$props21.actions,
866
+ onEmptied = _this$props21.onEmptied;
916
867
  actions.handleEmptied(this.getProperties());
917
868
  if (onEmptied) {
918
- onEmptied.apply(undefined, arguments);
869
+ onEmptied.apply(void 0, arguments);
919
870
  }
920
871
  }
921
872
 
@@ -923,18 +874,15 @@ var Video = function (_Component) {
923
874
  * Fires when the browser is trying to
924
875
  * get media data, but data is not available
925
876
  */
926
-
927
877
  }, {
928
- key: 'handleStalled',
878
+ key: "handleStalled",
929
879
  value: function handleStalled() {
930
- var _props22 = this.props,
931
- actions = _props22.actions,
932
- onStalled = _props22.onStalled;
933
-
880
+ var _this$props22 = this.props,
881
+ actions = _this$props22.actions,
882
+ onStalled = _this$props22.onStalled;
934
883
  actions.handleStalled(this.getProperties());
935
-
936
884
  if (onStalled) {
937
- onStalled.apply(undefined, arguments);
885
+ onStalled.apply(void 0, arguments);
938
886
  }
939
887
  }
940
888
 
@@ -942,24 +890,19 @@ var Video = function (_Component) {
942
890
  * Fires when the browser has loaded
943
891
  * meta data for the audio/video
944
892
  */
945
-
946
893
  }, {
947
- key: 'handleLoadedMetaData',
894
+ key: "handleLoadedMetaData",
948
895
  value: function handleLoadedMetaData() {
949
- var _props23 = this.props,
950
- actions = _props23.actions,
951
- onLoadedMetadata = _props23.onLoadedMetadata,
952
- startTime = _props23.startTime;
953
-
954
-
896
+ var _this$props23 = this.props,
897
+ actions = _this$props23.actions,
898
+ onLoadedMetadata = _this$props23.onLoadedMetadata,
899
+ startTime = _this$props23.startTime;
955
900
  if (startTime && startTime > 0) {
956
901
  this.video.currentTime = startTime;
957
902
  }
958
-
959
903
  actions.handleLoadedMetaData(this.getProperties());
960
-
961
904
  if (onLoadedMetadata) {
962
- onLoadedMetadata.apply(undefined, arguments);
905
+ onLoadedMetadata.apply(void 0, arguments);
963
906
  }
964
907
  }
965
908
 
@@ -967,18 +910,15 @@ var Video = function (_Component) {
967
910
  * Fires when the browser has loaded
968
911
  * the current frame of the audio/video
969
912
  */
970
-
971
913
  }, {
972
- key: 'handleLoadedData',
914
+ key: "handleLoadedData",
973
915
  value: function handleLoadedData() {
974
- var _props24 = this.props,
975
- actions = _props24.actions,
976
- onLoadedData = _props24.onLoadedData;
977
-
916
+ var _this$props24 = this.props,
917
+ actions = _this$props24.actions,
918
+ onLoadedData = _this$props24.onLoadedData;
978
919
  actions.handleLoadedData(this.getProperties());
979
-
980
920
  if (onLoadedData) {
981
- onLoadedData.apply(undefined, arguments);
921
+ onLoadedData.apply(void 0, arguments);
982
922
  }
983
923
  }
984
924
 
@@ -986,16 +926,14 @@ var Video = function (_Component) {
986
926
  * Fires when the current
987
927
  * playback position has changed
988
928
  */
989
-
990
929
  }, {
991
- key: 'handleTimeUpdate',
930
+ key: "handleTimeUpdate",
992
931
  value: function handleTimeUpdate() {
993
- var _props25 = this.props,
994
- previewActive = _props25.player.previewActive,
995
- actions = _props25.actions,
996
- onTimeUpdate = _props25.onTimeUpdate,
997
- rightMarker = _props25.playerSelectedMarker.rightMarker;
998
-
932
+ var _this$props25 = this.props,
933
+ previewActive = _this$props25.player.previewActive,
934
+ actions = _this$props25.actions,
935
+ onTimeUpdate = _this$props25.onTimeUpdate,
936
+ rightMarker = _this$props25.playerSelectedMarker.rightMarker;
999
937
  actions.handleTimeUpdate(this.getProperties());
1000
938
  if (previewActive && this.video.currentTime >= rightMarker) {
1001
939
  this.video.pause();
@@ -1003,7 +941,7 @@ var Video = function (_Component) {
1003
941
  actions.handleVideoPreview(false);
1004
942
  }
1005
943
  if (onTimeUpdate) {
1006
- onTimeUpdate.apply(undefined, arguments);
944
+ onTimeUpdate.apply(void 0, arguments);
1007
945
  }
1008
946
  this.displaySubtitle();
1009
947
  }
@@ -1011,34 +949,28 @@ var Video = function (_Component) {
1011
949
  /**
1012
950
  * Fires when the playing speed of the audio/video is changed
1013
951
  */
1014
-
1015
952
  }, {
1016
- key: 'handleRateChange',
953
+ key: "handleRateChange",
1017
954
  value: function handleRateChange() {
1018
- var _props26 = this.props,
1019
- actions = _props26.actions,
1020
- onRateChange = _props26.onRateChange;
1021
-
955
+ var _this$props26 = this.props,
956
+ actions = _this$props26.actions,
957
+ onRateChange = _this$props26.onRateChange;
1022
958
  actions.handleRateChange(this.getProperties());
1023
-
1024
959
  if (onRateChange) {
1025
- onRateChange.apply(undefined, arguments);
960
+ onRateChange.apply(void 0, arguments);
1026
961
  }
1027
962
  }
1028
963
 
1029
964
  // Fires when the volume has been changed
1030
-
1031
965
  }, {
1032
- key: 'handleVolumeChange',
966
+ key: "handleVolumeChange",
1033
967
  value: function handleVolumeChange() {
1034
- var _props27 = this.props,
1035
- actions = _props27.actions,
1036
- onVolumeChange = _props27.onVolumeChange;
1037
-
968
+ var _this$props27 = this.props,
969
+ actions = _this$props27.actions,
970
+ onVolumeChange = _this$props27.onVolumeChange;
1038
971
  actions.handleVolumeChange(this.getProperties());
1039
-
1040
972
  if (onVolumeChange) {
1041
- onVolumeChange.apply(undefined, arguments);
973
+ onVolumeChange.apply(void 0, arguments);
1042
974
  }
1043
975
  }
1044
976
 
@@ -1046,24 +978,22 @@ var Video = function (_Component) {
1046
978
  * Fires when an error occurred
1047
979
  * during the loading of an audio/video
1048
980
  */
1049
-
1050
981
  }, {
1051
- key: 'handleError',
982
+ key: "handleError",
1052
983
  value: function handleError() {
1053
- var _props28 = this.props,
1054
- actions = _props28.actions,
1055
- onError = _props28.onError;
1056
-
984
+ var _this$props28 = this.props,
985
+ actions = _this$props28.actions,
986
+ onError = _this$props28.onError;
1057
987
  actions.handleError(this.getProperties());
1058
988
  if (onError) {
1059
- onError.apply(undefined, arguments);
989
+ onError.apply(void 0, arguments);
1060
990
  }
1061
991
  }
1062
992
  }, {
1063
- key: 'handleKeypress',
993
+ key: "handleKeypress",
1064
994
  value: function handleKeypress() {}
1065
995
  }, {
1066
- key: 'audioVisualizer',
996
+ key: "audioVisualizer",
1067
997
  value: function audioVisualizer() {
1068
998
  // getting audio nodes
1069
999
  var context = new AudioContext({
@@ -1078,33 +1008,22 @@ var Video = function (_Component) {
1078
1008
  canvas.width = this.playerBlock.offsetWidth;
1079
1009
  canvas.height = this.playerBlock.offsetHeight;
1080
1010
  var ctx = canvas.getContext('2d');
1081
-
1082
1011
  src.connect(analyser);
1083
1012
  analyser.connect(context.destination);
1084
-
1085
1013
  analyser.fftSize = 256;
1086
-
1087
1014
  var bufferLength = analyser.frequencyBinCount;
1088
-
1089
1015
  var dataArray = new Uint8Array(bufferLength);
1090
-
1091
1016
  var WIDTH = canvas.width;
1092
1017
  var HEIGHT = canvas.height;
1093
-
1094
1018
  var barWidth = WIDTH / bufferLength * 1;
1095
1019
  var barHeight;
1096
1020
  var x = 0;
1097
-
1098
1021
  function renderFrame() {
1099
1022
  requestAnimationFrame(renderFrame);
1100
-
1101
1023
  x = 0;
1102
-
1103
1024
  analyser.getByteFrequencyData(dataArray);
1104
-
1105
1025
  ctx.fillStyle = '#000';
1106
1026
  ctx.fillRect(0, 0, WIDTH, HEIGHT);
1107
-
1108
1027
  for (var i = 0; i < bufferLength; i++) {
1109
1028
  barHeight = dataArray[i] * 2;
1110
1029
 
@@ -1116,39 +1035,35 @@ var Video = function (_Component) {
1116
1035
 
1117
1036
  ctx.fillStyle = '#0c141d'; // 'rgb(' + r + ',' + g + ',' + b + ')';
1118
1037
  ctx.fillRect(x, HEIGHT - barHeight, barWidth, barHeight);
1119
-
1120
1038
  x += barWidth + 3;
1121
1039
  }
1122
1040
  }
1123
-
1124
1041
  renderFrame();
1125
1042
  }
1126
1043
  }, {
1127
- key: 'renderChildren',
1044
+ key: "renderChildren",
1128
1045
  value: function renderChildren() {
1129
1046
  var _this4 = this;
1130
-
1131
- var props = _extends({}, this.props, {
1047
+ var props = _objectSpread(_objectSpread({}, this.props), {}, {
1132
1048
  video: this.video
1133
1049
  });
1134
1050
  var children = this.props.children;
1135
1051
  // to make sure the children can get video property
1136
-
1137
1052
  if (!this.video) {
1138
1053
  return null;
1139
1054
  }
1140
1055
 
1141
1056
  // only keep <source />, <track />, <MyComponent isVideoChild /> elements
1142
- return _react2.default.Children.toArray(children).filter(_utils.isVideoChild).map(function (c) {
1143
- var cprops = void 0;
1057
+ return _react["default"].Children.toArray(children).filter(_utils.isVideoChild).map(function (c) {
1058
+ var cprops;
1144
1059
  if (typeof c.type === 'string') {
1145
1060
  // add onError to <source />
1146
1061
  if (c.type === 'source') {
1147
- cprops = _extends({}, c.props);
1062
+ cprops = _objectSpread({}, c.props);
1148
1063
  var preOnError = cprops.onError;
1149
1064
  cprops.onError = function () {
1150
1065
  if (preOnError) {
1151
- preOnError.apply(undefined, arguments);
1066
+ preOnError.apply(void 0, arguments);
1152
1067
  }
1153
1068
  _this4.handleError.apply(_this4, arguments);
1154
1069
  };
@@ -1156,16 +1071,15 @@ var Video = function (_Component) {
1156
1071
  } else {
1157
1072
  cprops = props;
1158
1073
  }
1159
- return _react2.default.cloneElement(c, cprops);
1074
+ return /*#__PURE__*/_react["default"].cloneElement(c, cprops);
1160
1075
  });
1161
1076
  }
1162
1077
  }, {
1163
- key: 'handleSubtitleContainerClick',
1078
+ key: "handleSubtitleContainerClick",
1164
1079
  value: function handleSubtitleContainerClick() {
1165
- var _props29 = this.props,
1166
- actions = _props29.actions,
1167
- player = _props29.player;
1168
-
1080
+ var _this$props29 = this.props,
1081
+ actions = _this$props29.actions,
1082
+ player = _this$props29.player;
1169
1083
  if (player.paused) {
1170
1084
  actions.play();
1171
1085
  } else {
@@ -1173,15 +1087,14 @@ var Video = function (_Component) {
1173
1087
  }
1174
1088
  }
1175
1089
  }, {
1176
- key: 'handleSubtitleClick',
1090
+ key: "handleSubtitleClick",
1177
1091
  value: function handleSubtitleClick(e) {
1178
- var _props30 = this.props,
1179
- actions = _props30.actions,
1180
- player = _props30.player,
1181
- onScreenSubtitleClick = _props30.onScreenSubtitleClick,
1182
- controlType = _props30.controlType;
1092
+ var _this$props30 = this.props,
1093
+ actions = _this$props30.actions,
1094
+ player = _this$props30.player,
1095
+ onScreenSubtitleClick = _this$props30.onScreenSubtitleClick,
1096
+ controlType = _this$props30.controlType;
1183
1097
  var currentSubtitleObj = this.state.currentSubtitleObj;
1184
-
1185
1098
  if (controlType === 'advanced') {
1186
1099
  if (onScreenSubtitleClick) {
1187
1100
  onScreenSubtitleClick(currentSubtitleObj);
@@ -1198,234 +1111,145 @@ var Video = function (_Component) {
1198
1111
  e.stopPropagation();
1199
1112
  }
1200
1113
  }, {
1201
- key: 'render',
1114
+ key: "render",
1202
1115
  value: function render() {
1203
1116
  var _this5 = this;
1204
-
1205
- var _props31 = this.props,
1206
- loop = _props31.loop,
1207
- poster = _props31.poster,
1208
- preload = _props31.preload,
1209
- autoPlay = _props31.autoPlay,
1210
- playsInline = _props31.playsInline,
1211
- muted = _props31.muted,
1212
- crossOrigin = _props31.crossOrigin,
1213
- videoId = _props31.videoId,
1214
- fileType = _props31.fileType,
1215
- userEmail = _props31.userEmail;
1216
- var _state2 = this.state,
1217
- isBuffering = _state2.isBuffering,
1218
- watermark = _state2.watermark,
1219
- currentSubtitleObj = _state2.currentSubtitleObj;
1220
-
1221
-
1117
+ var _this$props31 = this.props,
1118
+ loop = _this$props31.loop,
1119
+ poster = _this$props31.poster,
1120
+ preload = _this$props31.preload,
1121
+ autoPlay = _this$props31.autoPlay,
1122
+ playsInline = _this$props31.playsInline,
1123
+ muted = _this$props31.muted,
1124
+ crossOrigin = _this$props31.crossOrigin,
1125
+ videoId = _this$props31.videoId,
1126
+ fileType = _this$props31.fileType,
1127
+ userEmail = _this$props31.userEmail;
1128
+ var _this$state2 = this.state,
1129
+ isBuffering = _this$state2.isBuffering,
1130
+ watermark = _this$state2.watermark,
1131
+ currentSubtitleObj = _this$state2.currentSubtitleObj;
1222
1132
  var children = this.getChildren(this.props);
1223
- return _react2.default.createElement(
1224
- VideoBlock,
1225
- {
1226
- className: 'video-react-player-block',
1227
- ref: function ref(c) {
1228
- _this5.playerBlock = c;
1229
- },
1230
- style: this.getStyle() },
1231
- isBuffering && _react2.default.createElement(
1232
- 'div',
1233
- {
1234
- className: 'loader-container',
1235
- onClick: function onClick() {
1236
- return _this5.togglePlay();
1237
- }
1238
- },
1239
- _react2.default.createElement(_components.Loader, { loaderName: 'SpinningLoader' })
1240
- ) || null,
1241
- fileType === 'audio' ? _react2.default.createElement(
1242
- _react2.default.Fragment,
1243
- null,
1244
- _react2.default.createElement('canvas', {
1245
- id: 'canvas',
1246
- ref: function ref(c) {
1247
- _this5.canvas = c;
1248
- },
1249
- style: {
1250
- top: 0,
1251
- left: 0,
1252
- position: 'absolute'
1253
- }
1254
- }),
1255
- _react2.default.createElement(
1256
- 'audio',
1257
- {
1258
- id: videoId,
1259
- crossOrigin: 'anonymous',
1260
- ref: function ref(c) {
1261
- _this5.video = c;
1262
- },
1263
- muted: muted,
1264
- preload: preload,
1265
- loop: loop,
1266
- playsInline: playsInline,
1267
- autoPlay: autoPlay,
1268
- poster: poster,
1269
- onLoadStart: this.handleLoadStart,
1270
- onWaiting: this.handleWaiting,
1271
- onCanPlay: this.handleCanPlay,
1272
- onCanPlayThrough: this.handleCanPlayThrough,
1273
- onPlaying: this.handlePlaying,
1274
- onEnded: this.handleEnded,
1275
- onSeeking: this.handleSeeking,
1276
- onSeeked: this.handleSeeked,
1277
- onPlay: this.handlePlay,
1278
- onPause: this.handlePause,
1279
- onProgress: this.handleProgress,
1280
- onDurationChange: this.handleDurationChange,
1281
- onError: this.handleError,
1282
- onSuspend: this.handleSuspend,
1283
- onAbort: this.handleAbort,
1284
- onEmptied: this.handleEmptied,
1285
- onStalled: this.handleStalled,
1286
- onLoadedMetadata: this.handleLoadedMetaData,
1287
- onLoadedData: this.handleLoadedData,
1288
- onTimeUpdate: this.handleTimeUpdate,
1289
- onRateChange: this.handleRateChange,
1290
- onVolumeChange: this.handleVolumeChange
1291
- },
1292
- _react2.default.createElement('track', { kind: 'captions' }),
1293
- this.renderChildren()
1294
- )
1295
- ) : _react2.default.createElement(
1296
- 'video',
1297
- {
1298
- id: videoId,
1299
- crossOrigin: crossOrigin,
1300
- ref: function ref(c) {
1301
- _this5.video = c;
1302
- },
1303
- muted: muted,
1304
- preload: preload,
1305
- loop: loop,
1306
- playsInline: playsInline,
1307
- autoPlay: autoPlay,
1308
- poster: poster,
1309
- onLoadStart: this.handleLoadStart,
1310
- onWaiting: this.handleWaiting,
1311
- onCanPlay: this.handleCanPlay,
1312
- onCanPlayThrough: this.handleCanPlayThrough,
1313
- onPlaying: this.handlePlaying,
1314
- onEnded: this.handleEnded,
1315
- onSeeking: this.handleSeeking,
1316
- onSeeked: this.handleSeeked,
1317
- onPlay: this.handlePlay,
1318
- onPause: this.handlePause,
1319
- onProgress: this.handleProgress,
1320
- onDurationChange: this.handleDurationChange,
1321
- onError: this.handleError,
1322
- onSuspend: this.handleSuspend,
1323
- onAbort: this.handleAbort,
1324
- onEmptied: this.handleEmptied,
1325
- onStalled: this.handleStalled,
1326
- onLoadedMetadata: this.handleLoadedMetaData,
1327
- onLoadedData: this.handleLoadedData,
1328
- onTimeUpdate: this.handleTimeUpdate,
1329
- onRateChange: this.handleRateChange,
1330
- onVolumeChange: this.handleVolumeChange
1331
- },
1332
- _react2.default.createElement('track', { kind: 'captions' }),
1333
- this.renderChildren()
1334
- ),
1335
- children,
1336
- _react2.default.createElement(
1337
- 'p',
1338
- { className: 'user-name-wrapper', id: 'watermark-text', style: _extends({}, watermark) },
1339
- userEmail
1340
- ),
1341
- currentSubtitleObj && currentSubtitleObj.line1 && currentSubtitleObj.line1.length && _react2.default.createElement(
1342
- SubTitleSection,
1343
- { id: 'outer', onClick: function onClick() {
1344
- return _this5.handleSubtitleContainerClick();
1345
- } },
1346
- _react2.default.createElement(
1347
- 'span',
1348
- { onClick: function onClick(e) {
1349
- return _this5.handleSubtitleClick(e);
1350
- }, className: 'subtitleContainer', style: _extends({}, currentSubtitleObj.style) },
1351
- currentSubtitleObj.line1 && _react2.default.createElement(
1352
- 'pre',
1353
- null,
1354
- ' ',
1355
- currentSubtitleObj.line1,
1356
- ' '
1357
- ) || null,
1358
- currentSubtitleObj.line2 && _react2.default.createElement(
1359
- 'pre',
1360
- null,
1361
- ' ',
1362
- currentSubtitleObj.line2,
1363
- ' '
1364
- ) || null
1365
- )
1366
- )
1367
- );
1368
- }
1369
- }, {
1370
- key: 'playbackRate',
1371
- get: function get() {
1372
- return this.video.playbackRate;
1373
- }
1374
-
1375
- /*
1376
- * set playback rate
1377
- * speed of video
1378
- */
1379
- ,
1380
- set: function set(rate) {
1381
- this.video.playbackRate = rate;
1382
- }
1383
- }, {
1384
- key: 'muted',
1385
- get: function get() {
1386
- return this.video.muted;
1387
- },
1388
- set: function set(val) {
1389
- this.video.muted = val;
1390
- }
1391
- }, {
1392
- key: 'volume',
1393
- get: function get() {
1394
- return this.video.volume;
1395
- },
1396
- set: function set(val) {
1397
- if (val > 1) {
1398
- val = 1;
1399
- }
1400
- if (val < 0) {
1401
- val = 0;
1402
- }
1403
- this.video.volume = val;
1404
- }
1405
-
1406
- // video width
1407
-
1408
- }, {
1409
- key: 'videoWidth',
1410
- get: function get() {
1411
- return this.video.videoWidth;
1412
- }
1413
-
1414
- // video height
1415
-
1416
- }, {
1417
- key: 'videoHeight',
1418
- get: function get() {
1419
- return this.video.videoHeight;
1133
+ return /*#__PURE__*/_react["default"].createElement(VideoBlock, {
1134
+ className: "video-react-player-block",
1135
+ ref: function ref(c) {
1136
+ _this5.playerBlock = c;
1137
+ },
1138
+ style: this.getStyle()
1139
+ }, isBuffering && /*#__PURE__*/_react["default"].createElement("div", {
1140
+ className: "loader-container",
1141
+ onClick: function onClick() {
1142
+ return _this5.togglePlay();
1143
+ }
1144
+ }, /*#__PURE__*/_react["default"].createElement(_components.Loader, {
1145
+ loaderName: "SpinningLoader"
1146
+ })) || null, fileType === 'audio' ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("canvas", {
1147
+ id: "canvas",
1148
+ ref: function ref(c) {
1149
+ _this5.canvas = c;
1150
+ },
1151
+ style: {
1152
+ top: 0,
1153
+ left: 0,
1154
+ position: 'absolute'
1155
+ }
1156
+ }), /*#__PURE__*/_react["default"].createElement("audio", {
1157
+ id: videoId,
1158
+ crossOrigin: "anonymous",
1159
+ ref: function ref(c) {
1160
+ _this5.video = c;
1161
+ },
1162
+ muted: muted,
1163
+ preload: preload,
1164
+ loop: loop,
1165
+ playsInline: playsInline,
1166
+ autoPlay: autoPlay,
1167
+ poster: poster,
1168
+ onLoadStart: this.handleLoadStart,
1169
+ onWaiting: this.handleWaiting,
1170
+ onCanPlay: this.handleCanPlay,
1171
+ onCanPlayThrough: this.handleCanPlayThrough,
1172
+ onPlaying: this.handlePlaying,
1173
+ onEnded: this.handleEnded,
1174
+ onSeeking: this.handleSeeking,
1175
+ onSeeked: this.handleSeeked,
1176
+ onPlay: this.handlePlay,
1177
+ onPause: this.handlePause,
1178
+ onProgress: this.handleProgress,
1179
+ onDurationChange: this.handleDurationChange,
1180
+ onError: this.handleError,
1181
+ onSuspend: this.handleSuspend,
1182
+ onAbort: this.handleAbort,
1183
+ onEmptied: this.handleEmptied,
1184
+ onStalled: this.handleStalled,
1185
+ onLoadedMetadata: this.handleLoadedMetaData,
1186
+ onLoadedData: this.handleLoadedData,
1187
+ onTimeUpdate: this.handleTimeUpdate,
1188
+ onRateChange: this.handleRateChange,
1189
+ onVolumeChange: this.handleVolumeChange
1190
+ }, /*#__PURE__*/_react["default"].createElement("track", {
1191
+ kind: "captions"
1192
+ }), this.renderChildren())) : /*#__PURE__*/_react["default"].createElement("video", {
1193
+ id: videoId,
1194
+ crossOrigin: crossOrigin,
1195
+ ref: function ref(c) {
1196
+ _this5.video = c;
1197
+ },
1198
+ muted: muted,
1199
+ preload: preload,
1200
+ loop: loop,
1201
+ playsInline: playsInline,
1202
+ autoPlay: autoPlay,
1203
+ poster: poster,
1204
+ onLoadStart: this.handleLoadStart,
1205
+ onWaiting: this.handleWaiting,
1206
+ onCanPlay: this.handleCanPlay,
1207
+ onCanPlayThrough: this.handleCanPlayThrough,
1208
+ onPlaying: this.handlePlaying,
1209
+ onEnded: this.handleEnded,
1210
+ onSeeking: this.handleSeeking,
1211
+ onSeeked: this.handleSeeked,
1212
+ onPlay: this.handlePlay,
1213
+ onPause: this.handlePause,
1214
+ onProgress: this.handleProgress,
1215
+ onDurationChange: this.handleDurationChange,
1216
+ onError: this.handleError,
1217
+ onSuspend: this.handleSuspend,
1218
+ onAbort: this.handleAbort,
1219
+ onEmptied: this.handleEmptied,
1220
+ onStalled: this.handleStalled,
1221
+ onLoadedMetadata: this.handleLoadedMetaData,
1222
+ onLoadedData: this.handleLoadedData,
1223
+ onTimeUpdate: this.handleTimeUpdate,
1224
+ onRateChange: this.handleRateChange,
1225
+ onVolumeChange: this.handleVolumeChange
1226
+ }, /*#__PURE__*/_react["default"].createElement("track", {
1227
+ kind: "captions"
1228
+ }), this.renderChildren()), children, /*#__PURE__*/_react["default"].createElement("p", {
1229
+ className: "user-name-wrapper",
1230
+ id: "watermark-text",
1231
+ style: _objectSpread({}, watermark)
1232
+ }, userEmail), /*#__PURE__*/_react["default"].createElement(SubTitleSection, {
1233
+ id: "outer",
1234
+ onClick: function onClick() {
1235
+ return _this5.handleSubtitleContainerClick();
1236
+ }
1237
+ }, /*#__PURE__*/_react["default"].createElement("span", {
1238
+ onClick: function onClick(e) {
1239
+ return _this5.handleSubtitleClick(e);
1240
+ },
1241
+ className: "subtitleContainer",
1242
+ style: _objectSpread({}, currentSubtitleObj.style)
1243
+ }, currentSubtitleObj.line1 && /*#__PURE__*/_react["default"].createElement("pre", {
1244
+ id: "subtitleLineOne"
1245
+ }, " ", currentSubtitleObj.line1, " ") || null, currentSubtitleObj.line2 && /*#__PURE__*/_react["default"].createElement("pre", {
1246
+ id: "subtitleLineTwo"
1247
+ }, " ", currentSubtitleObj.line2, " ") || null)));
1420
1248
  }
1421
1249
  }]);
1422
-
1423
1250
  return Video;
1424
1251
  }(_react.Component);
1425
-
1426
- exports.default = Video;
1427
-
1428
-
1252
+ exports["default"] = Video;
1429
1253
  Video.propTypes = propTypes;
1430
1254
  Video.defaultProps = defaultProps;
1431
1255
  Video.displayName = 'Video';