@desynova-digital/player 3.9.7 → 3.9.9
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 +26 -50
- package/actions/player.js +58 -89
- package/actions/video.js +70 -69
- package/colors.js +13 -13
- package/components/AudioMeter.js +138 -182
- package/components/BigPlayButton.js +48 -72
- package/components/ImageViewer.js +120 -165
- package/components/MarkerBar.js +64 -75
- package/components/Menu.js +30 -57
- package/components/Player.js +239 -357
- package/components/PlayerHeader.js +213 -348
- package/components/Playlist.js +50 -89
- package/components/PointersBar.js +131 -203
- package/components/PosterImage.js +12 -22
- package/components/SDOutline.js +32 -54
- package/components/Shortcut.js +135 -140
- package/components/Slider.js +85 -128
- package/components/TagsBar.js +45 -62
- package/components/Video.js +479 -655
- package/components/control-bar/AudioTracksMenuButton.js +63 -86
- package/components/control-bar/CameraButton.js +65 -76
- package/components/control-bar/CommentsButton.js +97 -136
- package/components/control-bar/ControlBar.js +171 -164
- package/components/control-bar/EditorControlMenuButton.js +180 -280
- package/components/control-bar/ForwardControl.js +7 -11
- package/components/control-bar/ForwardReplayControl.js +41 -55
- package/components/control-bar/FullscreenToggle.js +48 -67
- package/components/control-bar/PlayToggle.js +39 -54
- package/components/control-bar/ReplayControl.js +7 -11
- package/components/control-bar/SettingsMenuButton.js +19 -29
- package/components/control-bar/SubtitleLanguagesMenuButton.js +90 -119
- package/components/control-bar/SubtitleMovementMenu.js +128 -0
- package/components/control-bar/VolumeMenuButton.js +71 -96
- package/components/control-bar/ZoomMenuButton.js +57 -81
- package/components/marking-controls/MarkInControl.js +49 -65
- package/components/marking-controls/MarkOutControl.js +53 -69
- package/components/marking-controls/MarkingAddButton.js +41 -54
- package/components/marking-controls/MarkingControl.js +58 -107
- package/components/marking-controls/MarkingDeleteButton.js +39 -51
- package/components/marking-controls/MarkingDuration.js +23 -56
- package/components/marking-controls/MarkingPreview.js +39 -51
- package/components/progress-bar/AudioWaveform.js +48 -64
- package/components/progress-bar/LoadProgressBar.js +14 -37
- package/components/progress-bar/MouseTimeDisplay.js +14 -30
- package/components/progress-bar/PlayProgressBar.js +23 -41
- package/components/progress-bar/ProgressControl.js +82 -141
- package/components/progress-bar/SeekBar.js +101 -169
- package/components/progress-bar/Timeline.js +57 -81
- package/components/settings-menu-control/PlaybackRateControl.js +70 -115
- package/components/settings-menu-control/SafeAreaControl.js +49 -65
- package/components/settings-menu-control/SettingsMenu.js +26 -50
- package/components/time-controls/CurrentTimeDisplay.js +15 -34
- package/components/time-controls/DurationDisplay.js +14 -33
- package/components/time-controls/TimeDivider.js +12 -28
- package/components/volume-control/VolumeBar.js +84 -118
- package/components/volume-control/VolumeControl.js +7 -23
- package/components/volume-control/VolumeLevel.js +19 -36
- package/components/zoom-control/ZoomBar.js +79 -111
- package/components/zoom-control/ZoomLevel.js +24 -36
- package/index.js +204 -149
- package/package.json +5 -1
- package/reducers/index.js +12 -14
- package/reducers/operation.js +14 -14
- package/reducers/player.js +40 -42
- package/utils/browser.js +10 -5
- package/utils/dom.js +4 -15
- package/utils/fullscreen.js +24 -24
- package/utils/index.js +35 -46
package/reducers/player.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
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
|
-
|
|
6
|
+
exports["default"] = void 0;
|
|
9
7
|
exports.player = player;
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
8
|
+
var _video = require("../actions/video");
|
|
9
|
+
var _player = require("../actions/player");
|
|
10
|
+
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); }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
15
16
|
var initialState = {
|
|
16
17
|
currentSrc: null,
|
|
17
18
|
duration: 0,
|
|
@@ -57,60 +58,58 @@ var initialState = {
|
|
|
57
58
|
enableCEA708Captions: false
|
|
58
59
|
}
|
|
59
60
|
};
|
|
60
|
-
|
|
61
61
|
function player() {
|
|
62
62
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
63
|
-
var action = arguments[1];
|
|
64
|
-
|
|
63
|
+
var action = arguments.length > 1 ? arguments[1] : undefined;
|
|
65
64
|
switch (action.type) {
|
|
66
65
|
case _player.USER_ACTIVATE:
|
|
67
|
-
return
|
|
66
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
68
67
|
userActivity: action.activity
|
|
69
68
|
});
|
|
70
69
|
case _player.PLAYER_ACTIVATE:
|
|
71
|
-
return
|
|
70
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
72
71
|
isActive: action.activity
|
|
73
72
|
});
|
|
74
73
|
case _player.FULLSCREEN_CHANGE:
|
|
75
|
-
return
|
|
74
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
76
75
|
isFullscreen: !!action.isFullscreen
|
|
77
76
|
});
|
|
78
77
|
case _player.PREVIEW_VIDEO:
|
|
79
|
-
return
|
|
78
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
80
79
|
previewActive: action.active
|
|
81
80
|
});
|
|
82
81
|
case _player.REWIND_VIDEO:
|
|
83
|
-
return
|
|
82
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
84
83
|
rewindActive: action.active
|
|
85
84
|
});
|
|
86
85
|
case _video.SEEKING_TIME:
|
|
87
|
-
return
|
|
86
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
88
87
|
seekingTime: action.time
|
|
89
88
|
});
|
|
90
89
|
case _video.END_SEEKING:
|
|
91
|
-
return
|
|
90
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
92
91
|
seekingTime: 0
|
|
93
92
|
});
|
|
94
93
|
case _video.LOAD_START:
|
|
95
|
-
return
|
|
94
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
96
95
|
hasStarted: false,
|
|
97
96
|
ended: false
|
|
98
97
|
});
|
|
99
98
|
case _video.CAN_PLAY:
|
|
100
|
-
return
|
|
99
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
101
100
|
waiting: false
|
|
102
101
|
});
|
|
103
102
|
case _video.WAITING:
|
|
104
|
-
return
|
|
103
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
105
104
|
waiting: true
|
|
106
105
|
});
|
|
107
106
|
case _video.CAN_PLAY_THROUGH:
|
|
108
107
|
case _video.PLAYING:
|
|
109
|
-
return
|
|
108
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
110
109
|
waiting: false
|
|
111
110
|
});
|
|
112
111
|
case _video.PLAY:
|
|
113
|
-
return
|
|
112
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
114
113
|
ended: false,
|
|
115
114
|
paused: false,
|
|
116
115
|
autoPaused: false,
|
|
@@ -118,52 +117,51 @@ function player() {
|
|
|
118
117
|
hasStarted: true
|
|
119
118
|
});
|
|
120
119
|
case _video.PAUSE:
|
|
121
|
-
return
|
|
120
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
122
121
|
paused: true
|
|
123
122
|
});
|
|
124
123
|
case _video.END:
|
|
125
|
-
return
|
|
124
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
126
125
|
ended: true
|
|
127
126
|
});
|
|
128
127
|
case _video.SEEKING:
|
|
129
|
-
return
|
|
128
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
130
129
|
seeking: true
|
|
131
130
|
});
|
|
132
131
|
case _video.SEEKED:
|
|
133
|
-
return
|
|
132
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
134
133
|
seeking: false
|
|
135
134
|
});
|
|
136
135
|
case _video.ERROR:
|
|
137
|
-
return
|
|
136
|
+
return _objectSpread(_objectSpread(_objectSpread({}, state), action.videoProps), {}, {
|
|
138
137
|
error: 'UNKNOWN ERROR',
|
|
139
138
|
ended: true
|
|
140
139
|
});
|
|
141
140
|
case _player.PLAYER_TYPE:
|
|
142
|
-
return
|
|
141
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
143
142
|
playerType: action.playerType
|
|
144
143
|
});
|
|
145
144
|
case _player.AUDIO_TRACKS:
|
|
146
|
-
return
|
|
145
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
147
146
|
audioTracksArr: action.tracks
|
|
148
147
|
});
|
|
149
148
|
case _player.ACTIVE_AUDIO_TRACK:
|
|
150
|
-
return
|
|
149
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
151
150
|
activeAudio: action.track
|
|
152
151
|
});
|
|
153
152
|
case _player.ZOOM_CHANGE:
|
|
154
|
-
return
|
|
153
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
155
154
|
zoom: action.z
|
|
156
155
|
});
|
|
157
156
|
case _player.MARKER_CREATE:
|
|
158
157
|
{
|
|
159
|
-
var markerState =
|
|
158
|
+
var markerState = _objectSpread({}, state);
|
|
160
159
|
markerState.markerCreate = action.markerCreate;
|
|
161
|
-
|
|
162
160
|
return markerState;
|
|
163
161
|
}
|
|
164
162
|
case _player.MARKER_POINT_CHANGE:
|
|
165
163
|
{
|
|
166
|
-
var _markerState =
|
|
164
|
+
var _markerState = _objectSpread({}, state);
|
|
167
165
|
if (action.leftMarker && action.rightMarker) {
|
|
168
166
|
_markerState.leftMarker = action.leftMarker;
|
|
169
167
|
_markerState.rightMarker = action.rightMarker;
|
|
@@ -179,7 +177,7 @@ function player() {
|
|
|
179
177
|
}
|
|
180
178
|
case _player.MARKER_UPDATE:
|
|
181
179
|
{
|
|
182
|
-
var _markerState2 =
|
|
180
|
+
var _markerState2 = _objectSpread({}, state);
|
|
183
181
|
_markerState2.leftMarker = action.leftMarker;
|
|
184
182
|
_markerState2.rightMarker = action.rightMarker;
|
|
185
183
|
_markerState2.markerType = 'update';
|
|
@@ -187,11 +185,11 @@ function player() {
|
|
|
187
185
|
return _markerState2;
|
|
188
186
|
}
|
|
189
187
|
case _player.CONTROL_TYPE:
|
|
190
|
-
return
|
|
188
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
191
189
|
controlType: action.controlType
|
|
192
190
|
});
|
|
193
191
|
case _player.SD_BORDER_SWITCH:
|
|
194
|
-
return
|
|
192
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
195
193
|
SDBorderActive: action.SDBorderActive
|
|
196
194
|
});
|
|
197
195
|
case _video.DURATION_CHANGE:
|
|
@@ -207,7 +205,7 @@ function player() {
|
|
|
207
205
|
case _video.LOADED_DATA:
|
|
208
206
|
case _video.RESIZE:
|
|
209
207
|
{
|
|
210
|
-
var newState =
|
|
208
|
+
var newState = _objectSpread(_objectSpread({}, state), action.videoProps);
|
|
211
209
|
if (action.videoProps.paused === false) {
|
|
212
210
|
newState.hasStarted = true;
|
|
213
211
|
newState.waiting = false;
|
|
@@ -218,5 +216,5 @@ function player() {
|
|
|
218
216
|
return state;
|
|
219
217
|
}
|
|
220
218
|
}
|
|
221
|
-
|
|
222
|
-
exports
|
|
219
|
+
var _default = player;
|
|
220
|
+
exports["default"] = _default;
|
package/utils/browser.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.IS_IPOD = exports.IS_IPHONE = exports.IS_IPAD = exports.IS_IOS = void 0;
|
|
6
7
|
var USER_AGENT = typeof window !== 'undefined' && window.navigator ? window.navigator.userAgent : '';
|
|
7
8
|
/*
|
|
8
9
|
* const webkitVersionMap = (/AppleWebKit\/([\d.]+)/i).exec(USER_AGENT);
|
|
@@ -17,13 +18,17 @@ var USER_AGENT = typeof window !== 'undefined' && window.navigator ? window.navi
|
|
|
17
18
|
* @constant
|
|
18
19
|
* @private
|
|
19
20
|
*/
|
|
20
|
-
var IS_IPAD =
|
|
21
|
+
var IS_IPAD = /iPad/i.test(USER_AGENT);
|
|
21
22
|
|
|
22
23
|
/*
|
|
23
24
|
* The Facebook app's UIWebView identifies as both an iPhone and iPad, so
|
|
24
25
|
* to identify iPhones, we need to exclude iPads.
|
|
25
26
|
* http://artsy.github.io/blog/2012/10/18/the-perils-of-ios-user-agent-sniffing/
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
28
|
+
exports.IS_IPAD = IS_IPAD;
|
|
29
|
+
var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;
|
|
30
|
+
exports.IS_IPHONE = IS_IPHONE;
|
|
31
|
+
var IS_IPOD = /iPod/i.test(USER_AGENT);
|
|
32
|
+
exports.IS_IPOD = IS_IPOD;
|
|
33
|
+
var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;
|
|
34
|
+
exports.IS_IOS = IS_IOS;
|
package/utils/dom.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.blurNode = blurNode;
|
|
6
7
|
exports.findElPosition = findElPosition;
|
|
7
8
|
exports.getPointerPosition = getPointerPosition;
|
|
8
|
-
exports.blurNode = blurNode;
|
|
9
9
|
exports.hasClass = hasClass;
|
|
10
|
-
|
|
11
|
-
var _reactDom = require('react-dom');
|
|
12
|
-
|
|
10
|
+
var _reactDom = require("react-dom");
|
|
13
11
|
/**
|
|
14
12
|
* Offset Left
|
|
15
13
|
* getBoundingClientRect technique from
|
|
@@ -20,26 +18,21 @@ var _reactDom = require('react-dom');
|
|
|
20
18
|
* @return {Object}
|
|
21
19
|
*/
|
|
22
20
|
function findElPosition(el) {
|
|
23
|
-
var box
|
|
24
|
-
|
|
21
|
+
var box;
|
|
25
22
|
if (el.getBoundingClientRect && el.parentNode) {
|
|
26
23
|
box = el.getBoundingClientRect();
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
if (!box) {
|
|
30
26
|
return {
|
|
31
27
|
left: 0,
|
|
32
28
|
top: 0
|
|
33
29
|
};
|
|
34
30
|
}
|
|
35
|
-
|
|
36
31
|
var docEl = document.documentElement;
|
|
37
32
|
var body = document.body;
|
|
38
|
-
|
|
39
33
|
var clientLeft = docEl.clientLeft || body.clientLeft || 0;
|
|
40
34
|
var scrollLeft = window.pageXOffset || body.scrollLeft;
|
|
41
35
|
var left = box.left + scrollLeft - clientLeft;
|
|
42
|
-
|
|
43
36
|
var clientTop = docEl.clientTop || body.clientTop || 0;
|
|
44
37
|
var scrollTop = window.pageYOffset || body.scrollTop;
|
|
45
38
|
var top = box.top + scrollTop - clientTop;
|
|
@@ -67,20 +60,16 @@ function getPointerPosition(el, event) {
|
|
|
67
60
|
var box = findElPosition(el);
|
|
68
61
|
var boxW = el.offsetWidth;
|
|
69
62
|
var boxH = el.offsetHeight;
|
|
70
|
-
|
|
71
63
|
var boxY = box.top;
|
|
72
64
|
var boxX = box.left;
|
|
73
65
|
var pageY = event.pageY;
|
|
74
66
|
var pageX = event.pageX;
|
|
75
|
-
|
|
76
67
|
if (event.changedTouches) {
|
|
77
68
|
pageX = event.changedTouches[0].pageX;
|
|
78
69
|
pageY = event.changedTouches[0].pageY;
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
position.y = Math.max(0, Math.min(1, (boxY - pageY + boxH) / boxH));
|
|
82
72
|
position.x = Math.max(0, Math.min(1, (pageX - boxX) / boxW));
|
|
83
|
-
|
|
84
73
|
return position;
|
|
85
74
|
}
|
|
86
75
|
|
package/utils/fullscreen.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
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); }
|
|
9
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
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); }
|
|
13
|
+
var Fullscreen = /*#__PURE__*/function () {
|
|
12
14
|
function Fullscreen() {
|
|
13
15
|
_classCallCheck(this, Fullscreen);
|
|
14
16
|
}
|
|
15
|
-
|
|
16
17
|
_createClass(Fullscreen, [{
|
|
17
|
-
key:
|
|
18
|
+
key: "request",
|
|
18
19
|
value: function request(elm) {
|
|
19
20
|
if (elm.requestFullscreen) {
|
|
20
21
|
elm.requestFullscreen();
|
|
@@ -27,7 +28,7 @@ var Fullscreen = function () {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
}, {
|
|
30
|
-
key:
|
|
31
|
+
key: "exit",
|
|
31
32
|
value: function exit() {
|
|
32
33
|
if (document.exitFullscreen) {
|
|
33
34
|
document.exitFullscreen();
|
|
@@ -40,7 +41,17 @@ var Fullscreen = function () {
|
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}, {
|
|
43
|
-
key:
|
|
44
|
+
key: "isFullscreen",
|
|
45
|
+
get: function get() {
|
|
46
|
+
return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "enabled",
|
|
50
|
+
get: function get() {
|
|
51
|
+
return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled;
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "addEventListener",
|
|
44
55
|
value: function addEventListener(handler) {
|
|
45
56
|
document.addEventListener('fullscreenchange', handler);
|
|
46
57
|
document.addEventListener('webkitfullscreenchange', handler);
|
|
@@ -48,26 +59,15 @@ var Fullscreen = function () {
|
|
|
48
59
|
document.addEventListener('MSFullscreenChange', handler);
|
|
49
60
|
}
|
|
50
61
|
}, {
|
|
51
|
-
key:
|
|
62
|
+
key: "removeEventListener",
|
|
52
63
|
value: function removeEventListener(handler) {
|
|
53
64
|
document.removeEventListener('fullscreenchange', handler);
|
|
54
65
|
document.removeEventListener('webkitfullscreenchange', handler);
|
|
55
66
|
document.removeEventListener('mozfullscreenchange', handler);
|
|
56
67
|
document.removeEventListener('MSFullscreenChange', handler);
|
|
57
68
|
}
|
|
58
|
-
}, {
|
|
59
|
-
key: 'isFullscreen',
|
|
60
|
-
get: function get() {
|
|
61
|
-
return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;
|
|
62
|
-
}
|
|
63
|
-
}, {
|
|
64
|
-
key: 'enabled',
|
|
65
|
-
get: function get() {
|
|
66
|
-
return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled;
|
|
67
|
-
}
|
|
68
69
|
}]);
|
|
69
|
-
|
|
70
70
|
return Fullscreen;
|
|
71
71
|
}();
|
|
72
|
-
|
|
73
|
-
exports
|
|
72
|
+
var _default = new Fullscreen();
|
|
73
|
+
exports["default"] = _default;
|
package/utils/index.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
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; };
|
|
9
|
-
|
|
10
|
-
exports.secondsToTime = secondsToTime;
|
|
11
|
-
exports.timeToSeconds = timeToSeconds;
|
|
6
|
+
exports.deprecatedWarning = deprecatedWarning;
|
|
12
7
|
exports.formatTime = formatTime;
|
|
13
8
|
exports.isVideoChild = isVideoChild;
|
|
9
|
+
exports.mediaProperties = void 0;
|
|
14
10
|
exports.mergeAndSortChildren = mergeAndSortChildren;
|
|
15
|
-
exports.
|
|
11
|
+
exports.secondsToTime = secondsToTime;
|
|
16
12
|
exports.throttle = throttle;
|
|
17
|
-
|
|
18
|
-
var _react = require(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
13
|
+
exports.timeToSeconds = timeToSeconds;
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
16
|
+
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); }
|
|
17
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
18
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
22
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
23
|
+
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; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
27
|
+
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); }
|
|
24
28
|
/**
|
|
25
29
|
* @file seconds-to-time.js
|
|
26
30
|
*
|
|
@@ -37,10 +41,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
37
41
|
*/
|
|
38
42
|
function secondsToTime() {
|
|
39
43
|
var _seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
var initialTime = arguments[2];
|
|
43
|
-
|
|
44
|
+
var frameRate = arguments.length > 1 ? arguments[1] : undefined;
|
|
45
|
+
var initialTime = arguments.length > 2 ? arguments[2] : undefined;
|
|
44
46
|
var time = '00:00:00:00';
|
|
45
47
|
_seconds = parseFloat(_seconds);
|
|
46
48
|
if (_seconds > -1) {
|
|
@@ -49,25 +51,21 @@ function secondsToTime() {
|
|
|
49
51
|
}
|
|
50
52
|
var date = new Date(null);
|
|
51
53
|
var currentFrame = Math.floor(_seconds * frameRate % frameRate);
|
|
52
|
-
var paddedFrame = currentFrame < 10 ?
|
|
54
|
+
var paddedFrame = currentFrame < 10 ? "0".concat(currentFrame) : currentFrame;
|
|
53
55
|
date.setSeconds(_seconds);
|
|
54
56
|
var timeString = date.toISOString().substr(11, 8);
|
|
55
|
-
var timeWithFrame = timeString
|
|
57
|
+
var timeWithFrame = "".concat(timeString, ":").concat(paddedFrame);
|
|
56
58
|
time = timeWithFrame;
|
|
57
59
|
}
|
|
58
|
-
|
|
59
60
|
return time;
|
|
60
61
|
}
|
|
61
|
-
|
|
62
62
|
function timeToSeconds() {
|
|
63
63
|
var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '00:00:00:00';
|
|
64
|
-
var frameRate = arguments[1];
|
|
65
|
-
|
|
64
|
+
var frameRate = arguments.length > 1 ? arguments[1] : undefined;
|
|
66
65
|
var timeObj = time.split(':'); // split it at the colons
|
|
67
66
|
|
|
68
67
|
// minutes are worth 60 seconds. Hours are worth 60 minutes.
|
|
69
68
|
var seconds = +timeObj[0] * 60 * 60 + +timeObj[1] * 60 + +timeObj[2];
|
|
70
|
-
|
|
71
69
|
if (timeObj.length > 3 && frameRate) {
|
|
72
70
|
var frames = timeObj[3] * (1 / frameRate);
|
|
73
71
|
seconds += frames;
|
|
@@ -91,7 +89,6 @@ function timeToSeconds() {
|
|
|
91
89
|
function formatTime() {
|
|
92
90
|
var seconds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
93
91
|
var guide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : seconds;
|
|
94
|
-
|
|
95
92
|
var s = Math.floor(seconds % 60);
|
|
96
93
|
var m = Math.floor(seconds / 60 % 60);
|
|
97
94
|
var h = Math.floor(seconds / 3600);
|
|
@@ -110,17 +107,16 @@ function formatTime() {
|
|
|
110
107
|
}
|
|
111
108
|
|
|
112
109
|
// Check if we need to show hours
|
|
113
|
-
h = h > 0 || gh > 0 ? h
|
|
110
|
+
h = h > 0 || gh > 0 ? "".concat(h, ":") : '';
|
|
114
111
|
|
|
115
112
|
/*
|
|
116
113
|
* If hours are showing, we may need to add a leading zero.
|
|
117
114
|
* Always show at least one digit of minutes.
|
|
118
115
|
*/
|
|
119
|
-
m = ((h || gm >= 10) && m < 10 ?
|
|
116
|
+
m = "".concat((h || gm >= 10) && m < 10 ? "0".concat(m) : m, ":");
|
|
120
117
|
|
|
121
118
|
// Check if leading zero is need for seconds
|
|
122
|
-
s = s < 10 ?
|
|
123
|
-
|
|
119
|
+
s = s < 10 ? "0".concat(s) : s;
|
|
124
120
|
return h + m + s;
|
|
125
121
|
}
|
|
126
122
|
|
|
@@ -136,7 +132,6 @@ function isVideoChild(c) {
|
|
|
136
132
|
}
|
|
137
133
|
return c.type === 'source' || c.type === 'track';
|
|
138
134
|
}
|
|
139
|
-
|
|
140
135
|
var find = function find(elements, func) {
|
|
141
136
|
return elements.filter(func)[0];
|
|
142
137
|
};
|
|
@@ -145,15 +140,12 @@ var find = function find(elements, func) {
|
|
|
145
140
|
var isTypeEqual = function isTypeEqual(component1, component2) {
|
|
146
141
|
var type1 = component1.type;
|
|
147
142
|
var type2 = component2.type;
|
|
148
|
-
|
|
149
143
|
if (typeof type1 === 'string' || typeof type2 === 'string') {
|
|
150
144
|
return type1 === type2;
|
|
151
145
|
}
|
|
152
|
-
|
|
153
146
|
if (typeof type1 === 'function' && typeof type2 === 'function') {
|
|
154
147
|
return type1.displayName === type2.displayName;
|
|
155
148
|
}
|
|
156
|
-
|
|
157
149
|
return false;
|
|
158
150
|
};
|
|
159
151
|
|
|
@@ -164,9 +156,8 @@ var isTypeEqual = function isTypeEqual(component1, component2) {
|
|
|
164
156
|
*/
|
|
165
157
|
function mergeAndSortChildren(defaultChildren, _children, _parentProps) {
|
|
166
158
|
var defaultOrder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
var parentProps = _extends({}, _parentProps);
|
|
159
|
+
var children = _react["default"].Children.toArray(_children);
|
|
160
|
+
var parentProps = _objectSpread({}, _parentProps);
|
|
170
161
|
return children.filter(function (e) {
|
|
171
162
|
return !e.props.disabled;
|
|
172
163
|
}) // filter the disabled components
|
|
@@ -180,8 +171,8 @@ function mergeAndSortChildren(defaultChildren, _children, _parentProps) {
|
|
|
180
171
|
});
|
|
181
172
|
delete parentProps.order;
|
|
182
173
|
var defaultProps = defaultComponent ? defaultComponent.props : {};
|
|
183
|
-
var props =
|
|
184
|
-
var e =
|
|
174
|
+
var props = _objectSpread(_objectSpread(_objectSpread({}, parentProps), defaultProps), element.props);
|
|
175
|
+
var e = /*#__PURE__*/_react["default"].cloneElement(element, props, element.props.children);
|
|
185
176
|
return e;
|
|
186
177
|
}).sort(function (a, b) {
|
|
187
178
|
return (a.props.order || defaultOrder) - (b.props.order || defaultOrder);
|
|
@@ -193,16 +184,14 @@ function mergeAndSortChildren(defaultChildren, _children, _parentProps) {
|
|
|
193
184
|
*/
|
|
194
185
|
function deprecatedWarning(oldMethodCall, newMethodCall) {
|
|
195
186
|
// eslint-disable-next-line no-console
|
|
196
|
-
console.warn(
|
|
187
|
+
console.warn("WARNING: ".concat(oldMethodCall, " will be deprecated soon!\n Please use ").concat(newMethodCall, " instead."));
|
|
197
188
|
}
|
|
198
|
-
|
|
199
189
|
function throttle(callback, limit) {
|
|
200
190
|
var _arguments = arguments;
|
|
201
|
-
|
|
202
191
|
var wait = false;
|
|
203
192
|
return function () {
|
|
204
193
|
if (!wait) {
|
|
205
|
-
callback.apply(
|
|
194
|
+
callback.apply(void 0, _toConsumableArray(_arguments));
|
|
206
195
|
wait = true;
|
|
207
196
|
setTimeout(function () {
|
|
208
197
|
wait = false;
|
|
@@ -210,5 +199,5 @@ function throttle(callback, limit) {
|
|
|
210
199
|
}
|
|
211
200
|
};
|
|
212
201
|
}
|
|
213
|
-
|
|
214
|
-
|
|
202
|
+
var mediaProperties = ['error', 'src', 'srcObject', 'currentSrc', 'crossOrigin', 'networkState', 'preload', 'buffered', 'readyState', 'seeking', 'currentTime', 'duration', 'paused', 'defaultPlaybackRate', 'playbackRate', 'played', 'seekable', 'ended', 'autoplay', 'loop', 'mediaGroup', 'controller', 'controls', 'volume', 'muted', 'defaultMuted', 'audioTracks', 'videoTracks', 'textTracks', 'width', 'height', 'videoWidth', 'videoHeight', 'poster'];
|
|
203
|
+
exports.mediaProperties = mediaProperties;
|