@desynova-digital/player 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Manager.js +99 -0
- package/actions/player.js +331 -0
- package/actions/video.js +206 -0
- package/{utils/colors.js → colors.js} +1 -2
- package/{media → components}/AudioMeter.js +96 -109
- package/components/BigPlayButton.js +84 -0
- package/components/ImageViewer.js +272 -0
- package/{control → components}/MarkerBar.js +33 -24
- package/{utils → components}/Menu.js +13 -4
- package/components/Player.js +706 -0
- package/{header/Header.js → components/PlayerHeader.js} +104 -78
- package/components/Playlist.js +95 -0
- package/{control → components}/PointersBar.js +122 -61
- package/components/PosterImage.js +50 -0
- package/{media → components}/SDOutline.js +13 -49
- package/components/Shortcut.js +821 -0
- package/{control → components}/Slider.js +27 -23
- package/components/TagsBar.js +81 -0
- package/components/Video.js +1280 -0
- package/{control → components/control-bar}/AudioTracksMenuButton.js +32 -28
- package/components/control-bar/CameraButton.js +75 -0
- package/components/control-bar/CommentsButton.js +186 -0
- package/components/control-bar/ControlBar.js +266 -0
- package/components/control-bar/EditorControlMenuButton.js +317 -0
- package/components/control-bar/ForwardControl.js +12 -0
- package/components/control-bar/ForwardReplayControl.js +106 -0
- package/{control → components/control-bar}/FullscreenToggle.js +26 -21
- package/components/control-bar/PlayToggle.js +85 -0
- package/components/control-bar/ReplayControl.js +12 -0
- package/components/control-bar/SettingsMenuButton.js +41 -0
- package/components/control-bar/SubtitleLanguagesMenuButton.js +149 -0
- package/components/control-bar/SubtitleMovementMenu.js +140 -0
- package/{control/VolumneMenuButton.js → components/control-bar/VolumeMenuButton.js} +26 -27
- package/components/control-bar/ZoomMenuButton.js +90 -0
- package/{control → components/marking-controls}/MarkInControl.js +32 -25
- package/{control → components/marking-controls}/MarkOutControl.js +35 -26
- package/components/marking-controls/MarkingAddButton.js +79 -0
- package/components/marking-controls/MarkingControl.js +95 -0
- package/components/marking-controls/MarkingDeleteButton.js +70 -0
- package/{control → components/marking-controls}/MarkingDuration.js +12 -5
- package/components/marking-controls/MarkingPreview.js +72 -0
- package/components/progress-bar/AudioWaveform.js +126 -0
- package/components/progress-bar/LoadProgressBar.js +67 -0
- package/components/progress-bar/MouseTimeDisplay.js +36 -0
- package/{control → components/progress-bar}/PlayProgressBar.js +4 -4
- package/components/progress-bar/ProgressControl.js +186 -0
- package/{control → components/progress-bar}/SeekBar.js +113 -72
- package/{control → components/progress-bar}/Timeline.js +43 -32
- package/{control/PlayBackRateControl.js → components/settings-menu-control/PlaybackRateControl.js} +44 -30
- package/components/settings-menu-control/SafeAreaControl.js +81 -0
- package/components/settings-menu-control/SettingsMenu.js +56 -0
- package/components/settings-menu-control/SubtitleControl.js +1 -0
- package/components/time-controls/CurrentTimeDisplay.js +83 -0
- package/{control → components/time-controls}/DurationDisplay.js +8 -15
- package/components/time-controls/TimeDivider.js +25 -0
- package/{control → components/volume-control}/VolumeBar.js +62 -80
- package/components/volume-control/VolumeControl.js +19 -0
- package/{control → components/volume-control}/VolumeLevel.js +2 -3
- package/components/zoom-control/ZoomBar.js +155 -0
- package/components/zoom-control/ZoomLevel.js +55 -0
- package/index.js +198 -1
- package/package.json +5 -8
- package/reducers/index.js +19 -0
- package/reducers/operation.js +35 -0
- package/reducers/player.js +222 -0
- package/utils/browser.js +30 -0
- package/utils/dom.js +1 -2
- package/utils/fullscreen.js +72 -0
- package/utils/index.js +156 -57
- package/Player.js +0 -945
- package/control/AudioTracksMenuButton.jsx +0 -80
- package/control/ControlBar.js +0 -303
- package/control/ControlBar.jsx +0 -264
- package/control/CurrentTimeDisplay.js +0 -34
- package/control/CurrentTimeDisplay.jsx +0 -35
- package/control/DurationDisplay.jsx +0 -48
- package/control/ForwardBackwardControl.js +0 -76
- package/control/ForwardBackwardControl.jsx +0 -79
- package/control/FullscreenToggle.jsx +0 -83
- package/control/MarkInControl.jsx +0 -109
- package/control/MarkOutControl.jsx +0 -131
- package/control/MarkerBar.jsx +0 -107
- package/control/MarkingControl.js +0 -82
- package/control/MarkingControl.jsx +0 -143
- package/control/MarkingPreview.js +0 -49
- package/control/MarkingPreview.jsx +0 -60
- package/control/PlayBackRateControl.jsx +0 -106
- package/control/PlayProgressBar.jsx +0 -92
- package/control/PlayToggle.js +0 -56
- package/control/PlayToggle.jsx +0 -57
- package/control/PointersBar.jsx +0 -286
- package/control/ProgressControl.js +0 -127
- package/control/ProgressControl.jsx +0 -155
- package/control/SeekBar.jsx +0 -229
- package/control/SettingsMenuButton.js +0 -63
- package/control/SettingsMenuButton.jsx +0 -69
- package/control/Slider.jsx +0 -243
- package/control/Timeline.jsx +0 -131
- package/control/VolumeBar.jsx +0 -174
- package/control/VolumeLevel.jsx +0 -66
- package/control/VolumneMenuButton.jsx +0 -111
- package/header/Header.jsx +0 -479
- package/media/AudioMeter.jsx +0 -411
- package/media/SDOutline.jsx +0 -90
- package/media/Video.js +0 -684
- package/media/Video.jsx +0 -714
- package/playlist/Playlist.js +0 -67
- package/playlist/Playlist.jsx +0 -91
- package/playlist/index.js +0 -13
- package/shortcuts/Shortcut.js +0 -662
- package/utils/Menu.jsx +0 -105
package/media/Video.js
DELETED
|
@@ -1,684 +0,0 @@
|
|
|
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 _hls = _interopRequireDefault(require("hls.js"));
|
|
12
|
-
var _colors = _interopRequireDefault(require("../utils/colors"));
|
|
13
|
-
var _components = require("@desynova-digital/components");
|
|
14
|
-
var _components2 = require("@desynova-digital/components/components");
|
|
15
|
-
var _SDOutline = _interopRequireDefault(require("./SDOutline"));
|
|
16
|
-
var _AudioMeter = _interopRequireDefault(require("./AudioMeter"));
|
|
17
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
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); }
|
|
20
|
-
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; }
|
|
21
|
-
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; }
|
|
22
|
-
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; }
|
|
23
|
-
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); }
|
|
24
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
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); } }
|
|
26
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
function _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); }; }
|
|
30
|
-
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); }
|
|
31
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
-
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; } }
|
|
33
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
34
|
-
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; }
|
|
35
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
-
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); }
|
|
37
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
38
|
-
var propTypes = {
|
|
39
|
-
actions: _propTypes.PropTypes.instanceOf(Object),
|
|
40
|
-
player: _propTypes.PropTypes.instanceOf(Object),
|
|
41
|
-
startTime: _propTypes.PropTypes.number,
|
|
42
|
-
loop: _propTypes.PropTypes.bool,
|
|
43
|
-
muted: _propTypes.PropTypes.bool,
|
|
44
|
-
autoPlay: _propTypes.PropTypes.bool,
|
|
45
|
-
playsInline: _propTypes.PropTypes.bool,
|
|
46
|
-
src: _propTypes.PropTypes.string,
|
|
47
|
-
poster: _propTypes.PropTypes.string,
|
|
48
|
-
className: _propTypes.PropTypes.string,
|
|
49
|
-
fileType: _propTypes.PropTypes.oneOf(['video', 'image', 'audio']),
|
|
50
|
-
preload: _propTypes.PropTypes.oneOf(['auto', 'metadata', 'none']),
|
|
51
|
-
crossOrigin: _propTypes.PropTypes.string,
|
|
52
|
-
fluid: _propTypes.PropTypes.bool,
|
|
53
|
-
children: _propTypes.PropTypes.arrayOf(_propTypes.PropTypes.element),
|
|
54
|
-
store: _propTypes.PropTypes.instanceOf(Object),
|
|
55
|
-
width: _propTypes.PropTypes.number,
|
|
56
|
-
activeTrackIndex: _propTypes.PropTypes.number,
|
|
57
|
-
height: _propTypes.PropTypes.number,
|
|
58
|
-
videoId: _propTypes.PropTypes.string,
|
|
59
|
-
onLoadStart: _propTypes.PropTypes.func,
|
|
60
|
-
onWaiting: _propTypes.PropTypes.func,
|
|
61
|
-
onCanPlay: _propTypes.PropTypes.func,
|
|
62
|
-
onCanPlayThrough: _propTypes.PropTypes.func,
|
|
63
|
-
onPlaying: _propTypes.PropTypes.func,
|
|
64
|
-
onEnded: _propTypes.PropTypes.func,
|
|
65
|
-
onSeeking: _propTypes.PropTypes.func,
|
|
66
|
-
onSeeked: _propTypes.PropTypes.func,
|
|
67
|
-
onPlay: _propTypes.PropTypes.func,
|
|
68
|
-
onPause: _propTypes.PropTypes.func,
|
|
69
|
-
onProgress: _propTypes.PropTypes.func,
|
|
70
|
-
onDurationChange: _propTypes.PropTypes.func,
|
|
71
|
-
onError: _propTypes.PropTypes.func,
|
|
72
|
-
onSuspend: _propTypes.PropTypes.func,
|
|
73
|
-
onAbort: _propTypes.PropTypes.func,
|
|
74
|
-
onEmptied: _propTypes.PropTypes.func,
|
|
75
|
-
onStalled: _propTypes.PropTypes.func,
|
|
76
|
-
onLoadedMetadata: _propTypes.PropTypes.func,
|
|
77
|
-
onLoadedData: _propTypes.PropTypes.func,
|
|
78
|
-
onTimeUpdate: _propTypes.PropTypes.func,
|
|
79
|
-
onRateChange: _propTypes.PropTypes.func,
|
|
80
|
-
onVolumeChange: _propTypes.PropTypes.func,
|
|
81
|
-
onResize: _propTypes.PropTypes.func,
|
|
82
|
-
aspectRatio: _propTypes.PropTypes.string,
|
|
83
|
-
onPlayerClose: _propTypes.PropTypes.func,
|
|
84
|
-
userEmail: _propTypes.PropTypes.string,
|
|
85
|
-
playerSelectedMarker: _propTypes.PropTypes.instanceOf(Object)
|
|
86
|
-
};
|
|
87
|
-
var defaultProps = {
|
|
88
|
-
startTime: 0,
|
|
89
|
-
loop: false,
|
|
90
|
-
muted: false,
|
|
91
|
-
autoPlay: false,
|
|
92
|
-
playsInline: false,
|
|
93
|
-
preload: 'auto',
|
|
94
|
-
aspectRatio: 'auto',
|
|
95
|
-
crossOrigin: 'anonymous'
|
|
96
|
-
};
|
|
97
|
-
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"])));
|
|
98
|
-
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"])));
|
|
99
|
-
var PlayButton = (0, _styledComponents["default"])(_components.Button)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n width: 100px;\n height: 100px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: none;\n z-index: 1;\n &:hover,\n &:focus {\n background: ", ";\n }\n"])), function (props) {
|
|
100
|
-
return _colors["default"].common.video[props.assetType].buttonGradient;
|
|
101
|
-
}, function (props) {
|
|
102
|
-
return _colors["default"].common.video[props.assetType].buttonGradient;
|
|
103
|
-
});
|
|
104
|
-
var AudioMeterBlock = (0, _styledComponents["default"])('div')(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: ", ";\n height: ", ";\n position: absolute;\n bottom: ", ";\n right: 15px;\n padding: ", ";\n box-sizing: border-box;\n background: ", ";\n border-radius: ", ";\n display: ", ";\n margin: ", ";\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"])), function (props) {
|
|
105
|
-
return !props.active ? '50px' : '55px';
|
|
106
|
-
}, function (props) {
|
|
107
|
-
return !props.active ? '50px !important' : 'calc(100% - 80px)';
|
|
108
|
-
}, function (props) {
|
|
109
|
-
return !props.active ? '5px' : '0px';
|
|
110
|
-
}, function (props) {
|
|
111
|
-
return !props.active ? '5px' : '0px';
|
|
112
|
-
}, function (props) {
|
|
113
|
-
return !props.active ? 'rgba(243, 243, 243, 0.5)' : 'rgba(0, 0, 0, 1)';
|
|
114
|
-
}, function (props) {
|
|
115
|
-
return !props.active ? '5px' : '0px';
|
|
116
|
-
}, function (props) {
|
|
117
|
-
return !props.active ? 'block' : 'inline-block';
|
|
118
|
-
}, function (props) {
|
|
119
|
-
return !props.active ? '0' : '20px 0';
|
|
120
|
-
});
|
|
121
|
-
var Video = /*#__PURE__*/function (_Component) {
|
|
122
|
-
_inherits(Video, _Component);
|
|
123
|
-
var _super = _createSuper(Video);
|
|
124
|
-
function Video(props) {
|
|
125
|
-
var _this;
|
|
126
|
-
_classCallCheck(this, Video);
|
|
127
|
-
_this = _super.call(this, props);
|
|
128
|
-
/*
|
|
129
|
-
* Fires when the browser has loaded
|
|
130
|
-
* meta data for the audio/video
|
|
131
|
-
*/
|
|
132
|
-
_defineProperty(_assertThisInitialized(_this), "handleLoadedMetaData", function () {
|
|
133
|
-
var actionClick = _this.props.actionClick;
|
|
134
|
-
actionClick({
|
|
135
|
-
action: 'handle_loaded_meta_data',
|
|
136
|
-
value: _this.video.duration
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
/*
|
|
140
|
-
* Fires when the current
|
|
141
|
-
* playback position has changed
|
|
142
|
-
*/
|
|
143
|
-
_defineProperty(_assertThisInitialized(_this), "handleTimeUpdate", function () {
|
|
144
|
-
var _this$props = _this.props,
|
|
145
|
-
actionClick = _this$props.actionClick,
|
|
146
|
-
previewActive = _this$props.previewActive,
|
|
147
|
-
rightMarker = _this$props.playerSelectedMarker.rightMarker;
|
|
148
|
-
if (previewActive && _this.video.currentTime >= rightMarker) {
|
|
149
|
-
actionClick({
|
|
150
|
-
action: 'pause'
|
|
151
|
-
});
|
|
152
|
-
actionClick({
|
|
153
|
-
action: 'seek',
|
|
154
|
-
value: rightMarker
|
|
155
|
-
});
|
|
156
|
-
actionClick({
|
|
157
|
-
action: 'handle_video_preview',
|
|
158
|
-
value: false
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
actionClick({
|
|
162
|
-
action: 'handle_time_update',
|
|
163
|
-
value: _this.video.currentTime
|
|
164
|
-
});
|
|
165
|
-
_this.displaySubtitle();
|
|
166
|
-
});
|
|
167
|
-
_this.state = {
|
|
168
|
-
audioTracks: [],
|
|
169
|
-
isM3U8: false,
|
|
170
|
-
watermark: {
|
|
171
|
-
color: 'rgb(255, 255, 255)',
|
|
172
|
-
position: 'absolute',
|
|
173
|
-
'font-family': 'SFUIText-Regular',
|
|
174
|
-
'text-shadow': '0 0 4px rgb(0 0 0 / 50%)',
|
|
175
|
-
'font-size': '12px',
|
|
176
|
-
opacity: '0.6',
|
|
177
|
-
display: 'block',
|
|
178
|
-
top: '0px',
|
|
179
|
-
left: '0px'
|
|
180
|
-
},
|
|
181
|
-
watermarkInterval: -1,
|
|
182
|
-
isBuffering: false,
|
|
183
|
-
currentSubtitleObj: {}
|
|
184
|
-
};
|
|
185
|
-
_this.video = null; // the html5 video
|
|
186
|
-
// this.manager = new Manager(props.store);
|
|
187
|
-
_this.play = _this.play.bind(_assertThisInitialized(_this));
|
|
188
|
-
_this.pause = _this.pause.bind(_assertThisInitialized(_this));
|
|
189
|
-
_this.seek = _this.seek.bind(_assertThisInitialized(_this));
|
|
190
|
-
_this.forward = _this.forward.bind(_assertThisInitialized(_this));
|
|
191
|
-
_this.replay = _this.replay.bind(_assertThisInitialized(_this));
|
|
192
|
-
_this.toggleFullscreen = _this.toggleFullscreen.bind(_assertThisInitialized(_this));
|
|
193
|
-
_this.handleEnded = _this.handleEnded.bind(_assertThisInitialized(_this));
|
|
194
|
-
_this.handleLoadedMetaData = _this.handleLoadedMetaData.bind(_assertThisInitialized(_this));
|
|
195
|
-
_this.handleTimeUpdate = _this.handleTimeUpdate.bind(_assertThisInitialized(_this));
|
|
196
|
-
_this.checkWatermark = _this.checkWatermark.bind(_assertThisInitialized(_this));
|
|
197
|
-
return _this;
|
|
198
|
-
}
|
|
199
|
-
_createClass(Video, [{
|
|
200
|
-
key: "componentDidMount",
|
|
201
|
-
value: function componentDidMount() {
|
|
202
|
-
var src = this.props.src;
|
|
203
|
-
var isM3U8 = src.split('.').pop() === 'm3u8' ? true : false;
|
|
204
|
-
this.setState({
|
|
205
|
-
isM3U8: isM3U8
|
|
206
|
-
});
|
|
207
|
-
if (_hls["default"].isSupported() && isM3U8) {
|
|
208
|
-
var HLSConfig = this.props.HLSConfig;
|
|
209
|
-
this.hls = new _hls["default"](HLSConfig);
|
|
210
|
-
this.setupHLS(src);
|
|
211
|
-
} else {
|
|
212
|
-
this.video.src = src;
|
|
213
|
-
}
|
|
214
|
-
// this.forceUpdate(); // make sure the children can get the video property
|
|
215
|
-
var watermarkInterval = setInterval(this.checkWatermark, 20000);
|
|
216
|
-
this.setState({
|
|
217
|
-
watermarkInterval: watermarkInterval
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
}, {
|
|
221
|
-
key: "componentWillUnmount",
|
|
222
|
-
value: function componentWillUnmount() {
|
|
223
|
-
var _this$state = this.state,
|
|
224
|
-
isM3U8 = _this$state.isM3U8,
|
|
225
|
-
watermarkInterval = _this$state.watermarkInterval;
|
|
226
|
-
if (_hls["default"].isSupported() && isM3U8) {
|
|
227
|
-
this.hls.detachMedia();
|
|
228
|
-
} else {
|
|
229
|
-
this.video.src = '';
|
|
230
|
-
}
|
|
231
|
-
clearInterval(watermarkInterval);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* This function is triggered on interval to shuffle the position of watermark on Player area
|
|
236
|
-
*/
|
|
237
|
-
}, {
|
|
238
|
-
key: "checkWatermark",
|
|
239
|
-
value: function checkWatermark() {
|
|
240
|
-
var watermark = this.state.watermark;
|
|
241
|
-
var _this$props2 = this.props,
|
|
242
|
-
onPlayerClose = _this$props2.onPlayerClose,
|
|
243
|
-
userEmail = _this$props2.userEmail;
|
|
244
|
-
var watermark_text = document.querySelector('#watermark-text');
|
|
245
|
-
var video_player = null;
|
|
246
|
-
var watermark_dimension = null;
|
|
247
|
-
var text_css = null;
|
|
248
|
-
var bool_text = false;
|
|
249
|
-
if (!watermark_text) {
|
|
250
|
-
onPlayerClose();
|
|
251
|
-
} else {
|
|
252
|
-
video_player = document.querySelector('.video-react-player-block').getBoundingClientRect();
|
|
253
|
-
watermark_dimension = watermark_text.getBoundingClientRect();
|
|
254
|
-
text_css = watermark_text.style;
|
|
255
|
-
bool_text = text_css.position !== 'absolute' || text_css.opacity !== '0.6' || text_css['font-family'] !== 'SFUIText-Regular' && text_css['font-family'] !== '"SFUIText-Regular"';
|
|
256
|
-
bool_text = bool_text || text_css.display !== 'block';
|
|
257
|
-
bool_text = bool_text || text_css.top !== watermark.top;
|
|
258
|
-
bool_text = bool_text || text_css.left !== watermark.left;
|
|
259
|
-
bool_text = bool_text || text_css.length !== 9 || text_css['font-size'] !== '12px';
|
|
260
|
-
bool_text = bool_text || text_css.color !== 'rgb(255, 255, 255)';
|
|
261
|
-
bool_text = bool_text || userEmail !== watermark_text.innerText;
|
|
262
|
-
if (bool_text) {
|
|
263
|
-
onPlayerClose();
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
watermark.left = (Math.random() * (video_player.width - watermark_dimension.width)).toFixed(0) + 'px';
|
|
267
|
-
watermark.top = (Math.random() * (video_player.height - watermark_dimension.height)).toFixed(0) + 'px';
|
|
268
|
-
this.setState({
|
|
269
|
-
watermark: watermark
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
}, {
|
|
273
|
-
key: "setupHLS",
|
|
274
|
-
value: function setupHLS(src) {
|
|
275
|
-
var _this2 = this;
|
|
276
|
-
var _this$props3 = this.props,
|
|
277
|
-
actions = _this$props3.actions,
|
|
278
|
-
activeTrackIndex = _this$props3.activeTrackIndex,
|
|
279
|
-
actionClick = _this$props3.actionClick;
|
|
280
|
-
var self = this;
|
|
281
|
-
// bind them together
|
|
282
|
-
this.hls.attachMedia(this.video);
|
|
283
|
-
this.hls.on(_hls["default"].Events.MEDIA_ATTACHED, function () {
|
|
284
|
-
self.hls.loadSource(src);
|
|
285
|
-
});
|
|
286
|
-
this.hls.on(_hls["default"].Events.MANIFEST_PARSED, function (event, data) {
|
|
287
|
-
var trackIndex = activeTrackIndex || 0;
|
|
288
|
-
//todo handle below actions and merge it into same setstate.
|
|
289
|
-
actionClick({
|
|
290
|
-
action: 'handle_audio_tracks',
|
|
291
|
-
value: data.audioTracks
|
|
292
|
-
});
|
|
293
|
-
actionClick({
|
|
294
|
-
action: 'handle_audio_track_change',
|
|
295
|
-
value: data.audioTracks[trackIndex]
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
this.hls.on(_hls["default"].Events.ERROR, function (event, data) {
|
|
299
|
-
// eslint-disable-next-line no-console
|
|
300
|
-
console.log('HLS.Events.ERROR: ', event, data);
|
|
301
|
-
if (data.fatal) {
|
|
302
|
-
switch (data.type) {
|
|
303
|
-
case _hls["default"].ErrorTypes.NETWORK_ERROR:
|
|
304
|
-
// try to recover network error
|
|
305
|
-
_this2.hls.startLoad();
|
|
306
|
-
break;
|
|
307
|
-
case _hls["default"].ErrorTypes.MEDIA_ERROR:
|
|
308
|
-
_this2.hls.recoverMediaError();
|
|
309
|
-
break;
|
|
310
|
-
default:
|
|
311
|
-
// cannot recover
|
|
312
|
-
_this2.hls.destroy();
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
} else if (data.details === 'internalException' && data.type === 'otherError') {
|
|
316
|
-
_this2.hls.startLoad();
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}, {
|
|
321
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
322
|
-
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
323
|
-
var _this3 = this;
|
|
324
|
-
var _this$props4 = this.props,
|
|
325
|
-
src = _this$props4.src,
|
|
326
|
-
currentSubtitleObj = _this$props4.currentSubtitleObj,
|
|
327
|
-
markers = _this$props4.markers;
|
|
328
|
-
if (newProps.src !== src) {
|
|
329
|
-
var isM3U8 = this.state.isM3U8;
|
|
330
|
-
if (_hls["default"].isSupported() && isM3U8 && this.hls.media) {
|
|
331
|
-
this.hls.detachMedia();
|
|
332
|
-
} else {
|
|
333
|
-
this.video.src = '';
|
|
334
|
-
}
|
|
335
|
-
setTimeout(function () {
|
|
336
|
-
var m3u8 = newProps.src.split('.').pop() === 'm3u8' ? true : false;
|
|
337
|
-
_this3.setState({
|
|
338
|
-
isM3U8: m3u8
|
|
339
|
-
});
|
|
340
|
-
if (_hls["default"].isSupported() && m3u8) {
|
|
341
|
-
var HLSConfig = _this3.props.HLSConfig;
|
|
342
|
-
_this3.hls = new _hls["default"](HLSConfig);
|
|
343
|
-
_this3.setupHLS(newProps.src);
|
|
344
|
-
} else {
|
|
345
|
-
_this3.video.src = newProps.src;
|
|
346
|
-
}
|
|
347
|
-
_this3.forceUpdate();
|
|
348
|
-
}, 0); // make sure the children can get the video property
|
|
349
|
-
}
|
|
350
|
-
// if (newProps.player.activeAudio && activeAudio && activeAudio.id !== newProps.player.activeAudio.id) {
|
|
351
|
-
// this.hls.audioTrack = newProps.player.activeAudio.id;
|
|
352
|
-
// }
|
|
353
|
-
if (newProps.subtitleObj && newProps.subtitleObj.field && JSON.stringify(newProps.subtitleObj) !== JSON.stringify(currentSubtitleObj)) {
|
|
354
|
-
if (newProps.subtitleObj && newProps.subtitleObj.field && !newProps.subtitleObj.field.line1) {
|
|
355
|
-
this.setState({
|
|
356
|
-
currentSubtitleObj: {}
|
|
357
|
-
});
|
|
358
|
-
} else if (newProps.subtitleObj && newProps.subtitleObj.field && newProps.subtitleObj.field.line1) {
|
|
359
|
-
var style = this.getSubtitleStyle(newProps.subtitleObj.field);
|
|
360
|
-
this.setState({
|
|
361
|
-
currentSubtitleObj: {
|
|
362
|
-
line1: newProps.subtitleObj.field.line1,
|
|
363
|
-
line2: newProps.subtitleObj.field.line2,
|
|
364
|
-
start_time: newProps.subtitleObj.field.in_time,
|
|
365
|
-
end_time: newProps.subtitleObj.field.out_time,
|
|
366
|
-
style: style
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
if (newProps.markers.length && markers.length && newProps.markers[0].values.length !== markers[0].values.length) {
|
|
372
|
-
this.displaySubtitle(newProps.markers);
|
|
373
|
-
}
|
|
374
|
-
if (newProps.subtitleReadOnly && newProps.subtitleDataList) {
|
|
375
|
-
this.displaySubtitle(newProps.subtitleDataList);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// play the video
|
|
380
|
-
}, {
|
|
381
|
-
key: "play",
|
|
382
|
-
value: function play() {
|
|
383
|
-
var promise = this.video.play();
|
|
384
|
-
if (promise !== undefined) {
|
|
385
|
-
promise["catch"](function () {}).then(function () {});
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// pause the video
|
|
390
|
-
}, {
|
|
391
|
-
key: "pause",
|
|
392
|
-
value: function pause() {
|
|
393
|
-
var promise = this.video.pause();
|
|
394
|
-
if (promise !== undefined) {
|
|
395
|
-
promise["catch"](function () {}).then(function () {});
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// Change the video source and re-load the video:
|
|
400
|
-
}, {
|
|
401
|
-
key: "load",
|
|
402
|
-
value: function load() {
|
|
403
|
-
this.video.load();
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// Add a new text track to the video
|
|
407
|
-
}, {
|
|
408
|
-
key: "addTextTrack",
|
|
409
|
-
value: function addTextTrack() {
|
|
410
|
-
var _this$video;
|
|
411
|
-
(_this$video = this.video).addTextTrack.apply(_this$video, arguments);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
// Check if your browser can play different types of video:
|
|
415
|
-
}, {
|
|
416
|
-
key: "canPlayType",
|
|
417
|
-
value: function canPlayType() {
|
|
418
|
-
var _this$video2;
|
|
419
|
-
(_this$video2 = this.video).canPlayType.apply(_this$video2, arguments);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// toggle play
|
|
423
|
-
}, {
|
|
424
|
-
key: "togglePlay",
|
|
425
|
-
value: function togglePlay() {
|
|
426
|
-
if (this.video.paused) {
|
|
427
|
-
this.play();
|
|
428
|
-
} else {
|
|
429
|
-
this.pause();
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// seek video by time
|
|
434
|
-
}, {
|
|
435
|
-
key: "seek",
|
|
436
|
-
value: function seek(time) {
|
|
437
|
-
try {
|
|
438
|
-
this.video.currentTime = time;
|
|
439
|
-
} catch (e) {
|
|
440
|
-
// console.log(e, 'Video is not ready.')
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
// jump forward x seconds
|
|
445
|
-
}, {
|
|
446
|
-
key: "forward",
|
|
447
|
-
value: function forward(seconds) {
|
|
448
|
-
this.seek(this.video.currentTime + seconds);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
// jump back x seconds
|
|
452
|
-
}, {
|
|
453
|
-
key: "replay",
|
|
454
|
-
value: function replay(seconds) {
|
|
455
|
-
this.forward(-seconds);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
// enter or exist full screen
|
|
459
|
-
}, {
|
|
460
|
-
key: "toggleFullscreen",
|
|
461
|
-
value: function toggleFullscreen() {
|
|
462
|
-
var _this$props5 = this.props,
|
|
463
|
-
player = _this$props5.player,
|
|
464
|
-
actions = _this$props5.actions;
|
|
465
|
-
actions.toggleFullscreen(player);
|
|
466
|
-
}
|
|
467
|
-
}, {
|
|
468
|
-
key: "getSubtitleStyle",
|
|
469
|
-
value: function getSubtitleStyle(data) {
|
|
470
|
-
var style = {};
|
|
471
|
-
style.top = data && data.text_position === 'text_position_top' ? '0px' : '';
|
|
472
|
-
style.bottom = data && data.text_position === 'text_position_bottom' ? '0px' : '';
|
|
473
|
-
style.left = data && data.text_alignment === 'text_aligned_left' ? '0px' : '';
|
|
474
|
-
style.right = data && data.text_alignment === 'text_aligned_right' ? '0px' : '';
|
|
475
|
-
return style;
|
|
476
|
-
}
|
|
477
|
-
}, {
|
|
478
|
-
key: "displaySubtitle",
|
|
479
|
-
value: function displaySubtitle(marker) {
|
|
480
|
-
var _this$props6 = this.props,
|
|
481
|
-
markers = _this$props6.markers,
|
|
482
|
-
resetSubtitleData = _this$props6.resetSubtitleData,
|
|
483
|
-
subtitleReadOnly = _this$props6.subtitleReadOnly,
|
|
484
|
-
subtitleDataList = _this$props6.subtitleDataList;
|
|
485
|
-
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
486
|
-
if (resetSubtitleData) {
|
|
487
|
-
resetSubtitleData();
|
|
488
|
-
}
|
|
489
|
-
var currentTime = this.video.currentTime;
|
|
490
|
-
var currentMarker = marker || markers;
|
|
491
|
-
if (subtitleReadOnly) {
|
|
492
|
-
currentMarker = marker || subtitleDataList;
|
|
493
|
-
}
|
|
494
|
-
if (currentMarker && currentMarker[0] && currentMarker[0].name === 'Subtitle') {
|
|
495
|
-
var values = currentMarker[0].values;
|
|
496
|
-
var currentValue = values.filter(function (ele) {
|
|
497
|
-
return ele.start_time <= currentTime && ele.end_time >= currentTime;
|
|
498
|
-
});
|
|
499
|
-
var style = this.getSubtitleStyle(currentValue[0]);
|
|
500
|
-
var currentLine1 = currentSubtitleObj && currentSubtitleObj.line1 || '';
|
|
501
|
-
var propsLine1 = currentValue[0] && currentValue[0].line1 || '';
|
|
502
|
-
if (currentValue && currentValue.length && (currentSubtitleObj.start_time === currentValue[0].start_time || currentSubtitleObj.end_time === currentValue[0].end_time) && currentLine1 === propsLine1 || Object.keys(currentSubtitleObj).length && currentValue.length && currentValue.length === currentSubtitleObj.start_time.length && currentValue.length === currentSubtitleObj.end_time.length && currentLine1 === propsLine1) {
|
|
503
|
-
return;
|
|
504
|
-
} else {
|
|
505
|
-
this.setState({
|
|
506
|
-
currentSubtitleObj: {
|
|
507
|
-
line1: currentValue[0] && currentValue[0].line1 || '',
|
|
508
|
-
line2: currentValue[0] && currentValue[0].line2 || '',
|
|
509
|
-
start_time: currentValue[0] && currentValue[0].start_time || 0,
|
|
510
|
-
end_time: currentValue[0] && currentValue[0].end_time || 0,
|
|
511
|
-
style: style
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/*
|
|
519
|
-
* Fired when the end of the media resource
|
|
520
|
-
* is reached (currentTime == duration)
|
|
521
|
-
*/
|
|
522
|
-
}, {
|
|
523
|
-
key: "handleEnded",
|
|
524
|
-
value: function handleEnded() {
|
|
525
|
-
var _this$props7 = this.props,
|
|
526
|
-
loop = _this$props7.loop,
|
|
527
|
-
player = _this$props7.player,
|
|
528
|
-
actions = _this$props7.actions,
|
|
529
|
-
onEnded = _this$props7.onEnded;
|
|
530
|
-
if (loop) {
|
|
531
|
-
this.seek(0);
|
|
532
|
-
this.play();
|
|
533
|
-
} else if (!player.paused) {
|
|
534
|
-
this.pause();
|
|
535
|
-
}
|
|
536
|
-
actions.handleEnd(this.getProperties());
|
|
537
|
-
if (onEnded) {
|
|
538
|
-
onEnded.apply(void 0, arguments);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}, {
|
|
542
|
-
key: "handleSubtitleContainerClick",
|
|
543
|
-
value: function handleSubtitleContainerClick() {
|
|
544
|
-
var _this$props8 = this.props,
|
|
545
|
-
actionClick = _this$props8.actionClick,
|
|
546
|
-
paused = _this$props8.paused;
|
|
547
|
-
if (paused) {
|
|
548
|
-
actionClick({
|
|
549
|
-
action: 'play'
|
|
550
|
-
});
|
|
551
|
-
} else {
|
|
552
|
-
actionClick({
|
|
553
|
-
action: 'pause'
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}, {
|
|
558
|
-
key: "handleSubtitleClick",
|
|
559
|
-
value: function handleSubtitleClick(e) {
|
|
560
|
-
var _this$props9 = this.props,
|
|
561
|
-
actionClick = _this$props9.actionClick,
|
|
562
|
-
paused = _this$props9.paused,
|
|
563
|
-
onScreenSubtitleClick = _this$props9.onScreenSubtitleClick,
|
|
564
|
-
controlType = _this$props9.controlType;
|
|
565
|
-
var currentSubtitleObj = this.state.currentSubtitleObj;
|
|
566
|
-
if (controlType === 'advanced') {
|
|
567
|
-
if (onScreenSubtitleClick) {
|
|
568
|
-
onScreenSubtitleClick(currentSubtitleObj);
|
|
569
|
-
}
|
|
570
|
-
actionClick({
|
|
571
|
-
action: 'pause'
|
|
572
|
-
});
|
|
573
|
-
} else {
|
|
574
|
-
if (paused) {
|
|
575
|
-
actionClick({
|
|
576
|
-
action: 'play'
|
|
577
|
-
});
|
|
578
|
-
} else {
|
|
579
|
-
actionClick({
|
|
580
|
-
action: 'pause'
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
// actions.handleVideoRewind(false);
|
|
585
|
-
e.stopPropagation();
|
|
586
|
-
}
|
|
587
|
-
}, {
|
|
588
|
-
key: "render",
|
|
589
|
-
value: function render() {
|
|
590
|
-
var _this4 = this;
|
|
591
|
-
var _this$props10 = this.props,
|
|
592
|
-
crossOrigin = _this$props10.crossOrigin,
|
|
593
|
-
videoId = _this$props10.videoId,
|
|
594
|
-
userEmail = _this$props10.userEmail,
|
|
595
|
-
SDBorderActive = _this$props10.SDBorderActive,
|
|
596
|
-
actionClick = _this$props10.actionClick,
|
|
597
|
-
paused = _this$props10.paused;
|
|
598
|
-
var _this$state2 = this.state,
|
|
599
|
-
isBuffering = _this$state2.isBuffering,
|
|
600
|
-
watermark = _this$state2.watermark,
|
|
601
|
-
currentSubtitleObj = _this$state2.currentSubtitleObj;
|
|
602
|
-
|
|
603
|
-
// const children = this.getChildren(this.props);
|
|
604
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(VideoBlock, {
|
|
605
|
-
className: "video-react-player-block",
|
|
606
|
-
id: "media-container",
|
|
607
|
-
ref: function ref(c) {
|
|
608
|
-
_this4.playerBlock = c;
|
|
609
|
-
}
|
|
610
|
-
// style={this.getStyle()}
|
|
611
|
-
}, /*#__PURE__*/_react["default"].createElement("video", {
|
|
612
|
-
id: videoId
|
|
613
|
-
// crossOrigin={crossOrigin}
|
|
614
|
-
,
|
|
615
|
-
src: this.props.src,
|
|
616
|
-
ref: function ref(c) {
|
|
617
|
-
_this4.video = c;
|
|
618
|
-
},
|
|
619
|
-
onPlay: function onPlay() {
|
|
620
|
-
actionClick({
|
|
621
|
-
action: 'play'
|
|
622
|
-
});
|
|
623
|
-
},
|
|
624
|
-
onPause: function onPause() {
|
|
625
|
-
actionClick({
|
|
626
|
-
action: 'pause'
|
|
627
|
-
});
|
|
628
|
-
},
|
|
629
|
-
onLoadedMetadata: this.handleLoadedMetaData,
|
|
630
|
-
onTimeUpdate: this.handleTimeUpdate
|
|
631
|
-
}, /*#__PURE__*/_react["default"].createElement("track", {
|
|
632
|
-
kind: "captions"
|
|
633
|
-
})), paused && /*#__PURE__*/_react["default"].createElement(PlayButton, _extends({
|
|
634
|
-
display: "rounded",
|
|
635
|
-
appearance: "cta",
|
|
636
|
-
icon: "play",
|
|
637
|
-
iconWidth: 20,
|
|
638
|
-
iconHeight: 26,
|
|
639
|
-
width: 100,
|
|
640
|
-
height: 100,
|
|
641
|
-
tabIndex: "0",
|
|
642
|
-
onClick: function onClick() {
|
|
643
|
-
actionClick({
|
|
644
|
-
action: 'play'
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
}, this.props)), /*#__PURE__*/_react["default"].createElement(_SDOutline["default"], {
|
|
648
|
-
SDBorderActive: SDBorderActive,
|
|
649
|
-
actionClick: actionClick,
|
|
650
|
-
paused: paused
|
|
651
|
-
}), /*#__PURE__*/_react["default"].createElement("p", {
|
|
652
|
-
className: "user-name-wrapper",
|
|
653
|
-
id: "watermark-text",
|
|
654
|
-
style: _objectSpread({}, watermark)
|
|
655
|
-
}, userEmail), currentSubtitleObj && currentSubtitleObj.line1 && currentSubtitleObj.line1.length && /*#__PURE__*/_react["default"].createElement(SubTitleSection, {
|
|
656
|
-
id: "outer",
|
|
657
|
-
onClick: function onClick() {
|
|
658
|
-
return _this4.handleSubtitleContainerClick();
|
|
659
|
-
}
|
|
660
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
661
|
-
onClick: function onClick(e) {
|
|
662
|
-
return _this4.handleSubtitleClick(e);
|
|
663
|
-
},
|
|
664
|
-
className: "subtitleContainer",
|
|
665
|
-
style: _objectSpread({}, currentSubtitleObj.style)
|
|
666
|
-
}, currentSubtitleObj.line1 && /*#__PURE__*/_react["default"].createElement("pre", null, " ", currentSubtitleObj.line1, " ") || null, currentSubtitleObj.line2 && /*#__PURE__*/_react["default"].createElement("pre", null, " ", currentSubtitleObj.line2, " ") || null))));
|
|
667
|
-
// <AudioMeterBlock
|
|
668
|
-
// id="audio-meter-block"
|
|
669
|
-
// onClick={() => {
|
|
670
|
-
// this.meterBlockClick();
|
|
671
|
-
// }}
|
|
672
|
-
// role="presentation"
|
|
673
|
-
// active>
|
|
674
|
-
// {/* <AudioMeter player={props.player} height={this.meterHeight} /> */}
|
|
675
|
-
// <AudioMeter height="40" {...this.props} />
|
|
676
|
-
// </AudioMeterBlock>
|
|
677
|
-
}
|
|
678
|
-
}]);
|
|
679
|
-
return Video;
|
|
680
|
-
}(_react.Component);
|
|
681
|
-
exports["default"] = Video;
|
|
682
|
-
Video.propTypes = propTypes;
|
|
683
|
-
Video.defaultProps = defaultProps;
|
|
684
|
-
Video.displayName = 'Video';
|