@atlaskit/media-ui 28.7.27 → 28.7.29
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/CHANGELOG.md +13 -0
- package/dist/cjs/customMediaPlayer/index-compiled.js +43 -65
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +56 -82
- package/dist/es2019/customMediaPlayer/index-compiled.js +1 -24
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +1 -27
- package/dist/esm/customMediaPlayer/index-compiled.js +43 -65
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +56 -82
- package/dist/types/customMediaPlayer/index-compiled.d.ts +0 -2
- package/dist/types/customMediaPlayer/mediaPlayer/types.d.ts +0 -1
- package/dist/types-ts4.5/customMediaPlayer/index-compiled.d.ts +0 -2
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/types.d.ts +0 -1
- package/package.json +4 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/media-ui
|
|
2
2
|
|
|
3
|
+
## 28.7.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 28.7.28
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4785b4823f2b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4785b4823f2b6) -
|
|
14
|
+
Removed platform_media_disable_video_640p_artifact_usage FG
|
|
15
|
+
|
|
3
16
|
## 28.7.27
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -21,8 +21,6 @@ var _videoPause = _interopRequireDefault(require("@atlaskit/icon/core/video-paus
|
|
|
21
21
|
var _fullscreenEnter = _interopRequireDefault(require("@atlaskit/icon/core/fullscreen-enter"));
|
|
22
22
|
var _shrinkDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/shrink-diagonal"));
|
|
23
23
|
var _volumeHigh = _interopRequireDefault(require("@atlaskit/icon/core/volume-high"));
|
|
24
|
-
var _videoHd = _interopRequireDefault(require("@atlaskit/icon-lab/core/video-hd"));
|
|
25
|
-
var _videoHdFilled = _interopRequireDefault(require("@atlaskit/icon-lab/core/video-hd-filled"));
|
|
26
24
|
var _download = _interopRequireDefault(require("@atlaskit/icon/core/download"));
|
|
27
25
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
28
26
|
var _MediaButton = _interopRequireDefault(require("../MediaButton"));
|
|
@@ -165,26 +163,6 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
165
163
|
"data-testid": "current-time"
|
|
166
164
|
}, (0, _formatDuration.formatDuration)(currentTime), " / ", (0, _formatDuration.formatDuration)(duration));
|
|
167
165
|
});
|
|
168
|
-
(0, _defineProperty2.default)(_this, "renderHDButton", function () {
|
|
169
|
-
var _this$props4 = _this.props,
|
|
170
|
-
type = _this$props4.type,
|
|
171
|
-
isHDAvailable = _this$props4.isHDAvailable,
|
|
172
|
-
isHDActive = _this$props4.isHDActive,
|
|
173
|
-
onHDToggleClick = _this$props4.onHDToggleClick;
|
|
174
|
-
if (type === 'audio' || !isHDAvailable) {
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
return /*#__PURE__*/_react.default.createElement(_MediaButton.default, {
|
|
178
|
-
testId: "custom-media-player-hd-button",
|
|
179
|
-
onClick: !!onHDToggleClick ? _this.getMediaButtonClickHandler(onHDToggleClick, 'HDButton') : undefined,
|
|
180
|
-
iconBefore: isHDActive ? /*#__PURE__*/_react.default.createElement(_videoHdFilled.default, {
|
|
181
|
-
label: "hd active"
|
|
182
|
-
}) : /*#__PURE__*/_react.default.createElement(_videoHd.default, {
|
|
183
|
-
label: "hd inactive"
|
|
184
|
-
}),
|
|
185
|
-
"aria-pressed": isHDActive
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
166
|
(0, _defineProperty2.default)(_this, "onPlaybackSpeedChange", function (playbackSpeed) {
|
|
189
167
|
if (!_this.actions) {
|
|
190
168
|
return;
|
|
@@ -255,9 +233,9 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
255
233
|
}
|
|
256
234
|
});
|
|
257
235
|
(0, _defineProperty2.default)(_this, "renderFullScreenButton", function () {
|
|
258
|
-
var _this$
|
|
259
|
-
formatMessage = _this$
|
|
260
|
-
type = _this$
|
|
236
|
+
var _this$props4 = _this.props,
|
|
237
|
+
formatMessage = _this$props4.intl.formatMessage,
|
|
238
|
+
type = _this$props4.type;
|
|
261
239
|
if (type === 'audio') {
|
|
262
240
|
return;
|
|
263
241
|
}
|
|
@@ -382,16 +360,16 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
382
360
|
}));
|
|
383
361
|
});
|
|
384
362
|
(0, _defineProperty2.default)(_this, "pause", function () {
|
|
385
|
-
var _this$
|
|
363
|
+
var _this$props5, _this$props5$onPause;
|
|
386
364
|
if (_this.actions) {
|
|
387
365
|
_this.actions.pause();
|
|
388
366
|
}
|
|
389
|
-
(_this$
|
|
367
|
+
(_this$props5 = _this.props) === null || _this$props5 === void 0 || (_this$props5$onPause = _this$props5.onPause) === null || _this$props5$onPause === void 0 || _this$props5$onPause.call(_this$props5);
|
|
390
368
|
});
|
|
391
369
|
(0, _defineProperty2.default)(_this, "play", function () {
|
|
392
|
-
var _this$
|
|
393
|
-
onFirstPlay = _this$
|
|
394
|
-
onPlay = _this$
|
|
370
|
+
var _this$props6 = _this.props,
|
|
371
|
+
onFirstPlay = _this$props6.onFirstPlay,
|
|
372
|
+
onPlay = _this$props6.onPlay;
|
|
395
373
|
if (_this.actions) {
|
|
396
374
|
_this.actions.play();
|
|
397
375
|
}
|
|
@@ -420,13 +398,13 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
420
398
|
};
|
|
421
399
|
});
|
|
422
400
|
(0, _defineProperty2.default)(_this, "onViewed", function (videoState) {
|
|
423
|
-
var _this$
|
|
424
|
-
createAnalyticsEvent = _this$
|
|
425
|
-
fileId = _this$
|
|
426
|
-
isAutoPlay = _this$
|
|
427
|
-
isHDAvailable = _this$
|
|
428
|
-
isHDActive = _this$
|
|
429
|
-
type = _this$
|
|
401
|
+
var _this$props7 = _this.props,
|
|
402
|
+
createAnalyticsEvent = _this$props7.createAnalyticsEvent,
|
|
403
|
+
fileId = _this$props7.fileId,
|
|
404
|
+
isAutoPlay = _this$props7.isAutoPlay,
|
|
405
|
+
isHDAvailable = _this$props7.isHDAvailable,
|
|
406
|
+
isHDActive = _this$props7.isHDActive,
|
|
407
|
+
type = _this$props7.type;
|
|
430
408
|
var _this$state2 = _this.state,
|
|
431
409
|
isFullScreenEnabled = _this$state2.isFullScreenEnabled,
|
|
432
410
|
playerSize = _this$state2.playerSize,
|
|
@@ -476,14 +454,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
476
454
|
return (0, _createClass2.default)(CustomMediaPlayerBase, [{
|
|
477
455
|
key: "componentDidMount",
|
|
478
456
|
value: function componentDidMount() {
|
|
479
|
-
var _this$
|
|
480
|
-
type = _this$
|
|
481
|
-
fileId = _this$
|
|
482
|
-
isAutoPlay = _this$
|
|
483
|
-
isHDAvailable = _this$
|
|
484
|
-
isHDActive = _this$
|
|
485
|
-
onFirstPlay = _this$
|
|
486
|
-
createAnalyticsEvent = _this$
|
|
457
|
+
var _this$props8 = this.props,
|
|
458
|
+
type = _this$props8.type,
|
|
459
|
+
fileId = _this$props8.fileId,
|
|
460
|
+
isAutoPlay = _this$props8.isAutoPlay,
|
|
461
|
+
isHDAvailable = _this$props8.isHDAvailable,
|
|
462
|
+
isHDActive = _this$props8.isHDActive,
|
|
463
|
+
onFirstPlay = _this$props8.onFirstPlay,
|
|
464
|
+
createAnalyticsEvent = _this$props8.createAnalyticsEvent;
|
|
487
465
|
var _this$state3 = this.state,
|
|
488
466
|
isFullScreenEnabled = _this$state3.isFullScreenEnabled,
|
|
489
467
|
playerSize = _this$state3.playerSize,
|
|
@@ -501,14 +479,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
501
479
|
}
|
|
502
480
|
_simultaneousPlayManager.default.subscribe(this);
|
|
503
481
|
if (isAutoPlay) {
|
|
504
|
-
var _this$
|
|
482
|
+
var _this$props9, _this$props9$onPlay;
|
|
505
483
|
_simultaneousPlayManager.default.pauseOthers(this);
|
|
506
484
|
if (onFirstPlay) {
|
|
507
485
|
this.fireFirstPlayedTrackEvent();
|
|
508
486
|
this.wasPlayedOnce = true;
|
|
509
487
|
onFirstPlay();
|
|
510
488
|
}
|
|
511
|
-
(_this$
|
|
489
|
+
(_this$props9 = this.props) === null || _this$props9 === void 0 || (_this$props9$onPlay = _this$props9.onPlay) === null || _this$props9$onPlay === void 0 || _this$props9$onPlay.call(_this$props9);
|
|
512
490
|
}
|
|
513
491
|
}
|
|
514
492
|
}, {
|
|
@@ -518,8 +496,8 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
518
496
|
this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
|
|
519
497
|
}
|
|
520
498
|
if (this.state.isFullScreenEnabled) {
|
|
521
|
-
var _this$props$onFullscr2, _this$
|
|
522
|
-
(_this$props$onFullscr2 = (_this$
|
|
499
|
+
var _this$props$onFullscr2, _this$props0;
|
|
500
|
+
(_this$props$onFullscr2 = (_this$props0 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props0, false);
|
|
523
501
|
}
|
|
524
502
|
_simultaneousPlayManager.default.unsubscribe(this);
|
|
525
503
|
}
|
|
@@ -535,13 +513,13 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
535
513
|
}, {
|
|
536
514
|
key: "createAndFireUIEvent",
|
|
537
515
|
value: function createAndFireUIEvent(eventType, actionSubjectId) {
|
|
538
|
-
var _this$
|
|
539
|
-
type = _this$
|
|
540
|
-
fileId = _this$
|
|
541
|
-
isHDActive = _this$
|
|
542
|
-
isHDAvailable = _this$
|
|
543
|
-
isAutoPlay = _this$
|
|
544
|
-
createAnalyticsEvent = _this$
|
|
516
|
+
var _this$props1 = this.props,
|
|
517
|
+
type = _this$props1.type,
|
|
518
|
+
fileId = _this$props1.fileId,
|
|
519
|
+
isHDActive = _this$props1.isHDActive,
|
|
520
|
+
isHDAvailable = _this$props1.isHDAvailable,
|
|
521
|
+
isAutoPlay = _this$props1.isAutoPlay,
|
|
522
|
+
createAnalyticsEvent = _this$props1.createAnalyticsEvent;
|
|
545
523
|
var _this$state4 = this.state,
|
|
546
524
|
isFullScreenEnabled = _this$state4.isFullScreenEnabled,
|
|
547
525
|
playerSize = _this$state4.playerSize,
|
|
@@ -588,14 +566,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
588
566
|
key: "render",
|
|
589
567
|
value: function render() {
|
|
590
568
|
var _this2 = this;
|
|
591
|
-
var _this$
|
|
592
|
-
type = _this$
|
|
593
|
-
src = _this$
|
|
594
|
-
isAutoPlay = _this$
|
|
595
|
-
onCanPlay = _this$
|
|
596
|
-
onError = _this$
|
|
597
|
-
poster = _this$
|
|
598
|
-
videoControlsWrapperRef = _this$
|
|
569
|
+
var _this$props10 = this.props,
|
|
570
|
+
type = _this$props10.type,
|
|
571
|
+
src = _this$props10.src,
|
|
572
|
+
isAutoPlay = _this$props10.isAutoPlay,
|
|
573
|
+
onCanPlay = _this$props10.onCanPlay,
|
|
574
|
+
onError = _this$props10.onError,
|
|
575
|
+
poster = _this$props10.poster,
|
|
576
|
+
videoControlsWrapperRef = _this$props10.videoControlsWrapperRef;
|
|
599
577
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
600
578
|
xcss: customVideoWrapperStyles.root,
|
|
601
579
|
ref: this.videoWrapperRef,
|
|
@@ -677,7 +655,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
|
|
|
677
655
|
alignItems: "center",
|
|
678
656
|
justifyContent: "space-between",
|
|
679
657
|
xcss: timebarWrapperStyles.root
|
|
680
|
-
}, /*#__PURE__*/_react.default.createElement(_styled.LeftControls, null, _this2.renderPlayPauseButton(isPlaying), isLargePlayer && _this2.renderSkipBackwardButton(skipBackward), isLargePlayer && _this2.renderSkipForwardButton(skipForward), _this2.renderVolume(videoState, actions, isLargePlayer)), /*#__PURE__*/_react.default.createElement(_styled.RightControls, null, (isMediumPlayer || isLargePlayer) && _this2.renderCurrentTime(videoState), isLargePlayer &&
|
|
658
|
+
}, /*#__PURE__*/_react.default.createElement(_styled.LeftControls, null, _this2.renderPlayPauseButton(isPlaying), isLargePlayer && _this2.renderSkipBackwardButton(skipBackward), isLargePlayer && _this2.renderSkipForwardButton(skipForward), _this2.renderVolume(videoState, actions, isLargePlayer)), /*#__PURE__*/_react.default.createElement(_styled.RightControls, null, (isMediumPlayer || isLargePlayer) && _this2.renderCurrentTime(videoState), isLargePlayer && _this2.renderSpeedControls(), _this2.renderFullScreenButton(), isLargePlayer && _this2.renderDownloadButton()))));
|
|
681
659
|
}));
|
|
682
660
|
}
|
|
683
661
|
}]);
|
|
@@ -21,8 +21,6 @@ var _videoPause = _interopRequireDefault(require("@atlaskit/icon/core/video-paus
|
|
|
21
21
|
var _fullscreenEnter = _interopRequireDefault(require("@atlaskit/icon/core/fullscreen-enter"));
|
|
22
22
|
var _shrinkDiagonal = _interopRequireDefault(require("@atlaskit/icon/core/shrink-diagonal"));
|
|
23
23
|
var _volumeHigh = _interopRequireDefault(require("@atlaskit/icon/core/volume-high"));
|
|
24
|
-
var _videoHd = _interopRequireDefault(require("@atlaskit/icon-lab/core/video-hd"));
|
|
25
|
-
var _videoHdFilled = _interopRequireDefault(require("@atlaskit/icon-lab/core/video-hd-filled"));
|
|
26
24
|
var _download = _interopRequireDefault(require("@atlaskit/icon/core/download"));
|
|
27
25
|
var _reactIntlNext = require("react-intl-next");
|
|
28
26
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
@@ -92,9 +90,6 @@ var breakpointControls = {
|
|
|
92
90
|
speedControls: function speedControls(playerWidth) {
|
|
93
91
|
return playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH;
|
|
94
92
|
},
|
|
95
|
-
hdButton: function hdButton(playerWidth) {
|
|
96
|
-
return playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH;
|
|
97
|
-
},
|
|
98
93
|
captionsAdminControls: function captionsAdminControls(playerWidth) {
|
|
99
94
|
return playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH;
|
|
100
95
|
}
|
|
@@ -227,27 +222,6 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
227
222
|
"data-testid": "current-time"
|
|
228
223
|
}, (0, _formatDuration.formatDuration)(_this.videoState.currentTime), " / ", (0, _formatDuration.formatDuration)(_this.videoState.duration));
|
|
229
224
|
});
|
|
230
|
-
(0, _defineProperty2.default)(_this, "shouldRenderHdButton", function () {
|
|
231
|
-
var _this$props4 = _this.props,
|
|
232
|
-
type = _this$props4.type,
|
|
233
|
-
isHDAvailable = _this$props4.isHDAvailable;
|
|
234
|
-
return !(0, _platformFeatureFlags.fg)('platform_media_disable_video_640p_artifact_usage') && breakpointControls.hdButton(_this.state.playerWidth) && type !== 'audio' && !!isHDAvailable;
|
|
235
|
-
});
|
|
236
|
-
(0, _defineProperty2.default)(_this, "renderHDButton", function () {
|
|
237
|
-
var _this$props5 = _this.props,
|
|
238
|
-
isHDActive = _this$props5.isHDActive,
|
|
239
|
-
onHDToggleClick = _this$props5.onHDToggleClick;
|
|
240
|
-
return /*#__PURE__*/_react.default.createElement(_MediaButton.default, {
|
|
241
|
-
testId: "custom-media-player-hd-button",
|
|
242
|
-
onClick: !!onHDToggleClick ? _this.getMediaButtonClickHandler(onHDToggleClick, 'HDButton') : undefined,
|
|
243
|
-
iconBefore: isHDActive ? /*#__PURE__*/_react.default.createElement(_videoHdFilled.default, {
|
|
244
|
-
label: "hd active"
|
|
245
|
-
}) : /*#__PURE__*/_react.default.createElement(_videoHd.default, {
|
|
246
|
-
label: "hd inactive"
|
|
247
|
-
}),
|
|
248
|
-
"aria-pressed": isHDActive
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
225
|
(0, _defineProperty2.default)(_this, "onPlaybackSpeedChange", function (playbackSpeed) {
|
|
252
226
|
if (!_this.actions) {
|
|
253
227
|
return;
|
|
@@ -326,9 +300,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
326
300
|
return breakpointControls.fullScreenButton(_this.state.playerWidth);
|
|
327
301
|
});
|
|
328
302
|
(0, _defineProperty2.default)(_this, "renderFullScreenButton", function () {
|
|
329
|
-
var _this$
|
|
330
|
-
formatMessage = _this$
|
|
331
|
-
type = _this$
|
|
303
|
+
var _this$props4 = _this.props,
|
|
304
|
+
formatMessage = _this$props4.intl.formatMessage,
|
|
305
|
+
type = _this$props4.type;
|
|
332
306
|
if (type === 'audio') {
|
|
333
307
|
return;
|
|
334
308
|
}
|
|
@@ -416,18 +390,18 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
416
390
|
});
|
|
417
391
|
(0, _defineProperty2.default)(_this, "defaultSkipAmount", 10);
|
|
418
392
|
(0, _defineProperty2.default)(_this, "skipBackward", function () {
|
|
419
|
-
var _this$actions3, _this$props$onTimeCha2, _this$
|
|
393
|
+
var _this$actions3, _this$props$onTimeCha2, _this$props5;
|
|
420
394
|
var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.defaultSkipAmount;
|
|
421
395
|
var newTime = _this.videoState.currentTime - skipAmount;
|
|
422
396
|
(_this$actions3 = _this.actions) === null || _this$actions3 === void 0 || _this$actions3.navigate(Math.max(newTime, 0));
|
|
423
|
-
(_this$props$onTimeCha2 = (_this$
|
|
397
|
+
(_this$props$onTimeCha2 = (_this$props5 = _this.props).onTimeChanged) === null || _this$props$onTimeCha2 === void 0 || _this$props$onTimeCha2.call(_this$props5);
|
|
424
398
|
});
|
|
425
399
|
(0, _defineProperty2.default)(_this, "skipForward", function () {
|
|
426
|
-
var _this$actions4, _this$props$onTimeCha3, _this$
|
|
400
|
+
var _this$actions4, _this$props$onTimeCha3, _this$props6;
|
|
427
401
|
var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.defaultSkipAmount;
|
|
428
402
|
var newTime = _this.videoState.currentTime + skipAmount;
|
|
429
403
|
(_this$actions4 = _this.actions) === null || _this$actions4 === void 0 || _this$actions4.navigate(Math.min(newTime, _this.videoState.duration));
|
|
430
|
-
(_this$props$onTimeCha3 = (_this$
|
|
404
|
+
(_this$props$onTimeCha3 = (_this$props6 = _this.props).onTimeChanged) === null || _this$props$onTimeCha3 === void 0 || _this$props$onTimeCha3.call(_this$props6);
|
|
431
405
|
});
|
|
432
406
|
(0, _defineProperty2.default)(_this, "renderSkipBackwardButton", function () {
|
|
433
407
|
var formatMessage = _this.props.intl.formatMessage;
|
|
@@ -478,16 +452,16 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
478
452
|
}));
|
|
479
453
|
});
|
|
480
454
|
(0, _defineProperty2.default)(_this, "pause", function () {
|
|
481
|
-
var _this$props$onPause, _this$
|
|
455
|
+
var _this$props$onPause, _this$props7;
|
|
482
456
|
if (_this.actions) {
|
|
483
457
|
_this.actions.pause();
|
|
484
458
|
}
|
|
485
|
-
(_this$props$onPause = (_this$
|
|
459
|
+
(_this$props$onPause = (_this$props7 = _this.props).onPause) === null || _this$props$onPause === void 0 || _this$props$onPause.call(_this$props7);
|
|
486
460
|
});
|
|
487
461
|
(0, _defineProperty2.default)(_this, "play", function () {
|
|
488
|
-
var _this$
|
|
489
|
-
onFirstPlay = _this$
|
|
490
|
-
onPlay = _this$
|
|
462
|
+
var _this$props8 = _this.props,
|
|
463
|
+
onFirstPlay = _this$props8.onFirstPlay,
|
|
464
|
+
onPlay = _this$props8.onPlay;
|
|
491
465
|
if (_this.actions) {
|
|
492
466
|
_this.actions.play();
|
|
493
467
|
}
|
|
@@ -516,13 +490,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
516
490
|
};
|
|
517
491
|
});
|
|
518
492
|
(0, _defineProperty2.default)(_this, "onViewed", function (videoState) {
|
|
519
|
-
var _this$
|
|
520
|
-
createAnalyticsEvent = _this$
|
|
521
|
-
identifier = _this$
|
|
522
|
-
isAutoPlay = _this$
|
|
523
|
-
isHDAvailable = _this$
|
|
524
|
-
isHDActive = _this$
|
|
525
|
-
type = _this$
|
|
493
|
+
var _this$props9 = _this.props,
|
|
494
|
+
createAnalyticsEvent = _this$props9.createAnalyticsEvent,
|
|
495
|
+
identifier = _this$props9.identifier,
|
|
496
|
+
isAutoPlay = _this$props9.isAutoPlay,
|
|
497
|
+
isHDAvailable = _this$props9.isHDAvailable,
|
|
498
|
+
isHDActive = _this$props9.isHDActive,
|
|
499
|
+
type = _this$props9.type;
|
|
526
500
|
var _this$state2 = _this.state,
|
|
527
501
|
isFullScreenEnabled = _this$state2.isFullScreenEnabled,
|
|
528
502
|
playbackSpeed = _this$state2.playbackSpeed;
|
|
@@ -568,12 +542,12 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
568
542
|
(0, _defineProperty2.default)(_this, "startPlayByButtonClick", _this.getMediaButtonClickHandler(_this.play, 'playButton'));
|
|
569
543
|
(0, _defineProperty2.default)(_this, "pausePlayByButtonClick", _this.getMediaButtonClickHandler(_this.pause, 'pauseButton'));
|
|
570
544
|
(0, _defineProperty2.default)(_this, "onTextTracksSelected", function (selectedTracksIndex) {
|
|
571
|
-
var _this$props$onTextTra, _this$
|
|
572
|
-
(_this$props$onTextTra = (_this$
|
|
545
|
+
var _this$props$onTextTra, _this$props0;
|
|
546
|
+
(_this$props$onTextTra = (_this$props0 = _this.props).onTextTracksSelected) === null || _this$props$onTextTra === void 0 || _this$props$onTextTra.call(_this$props0, selectedTracksIndex);
|
|
573
547
|
});
|
|
574
548
|
(0, _defineProperty2.default)(_this, "onCaptionsEnabledChange", function (areCaptionsEnabled) {
|
|
575
|
-
var _this$props$onCaption, _this$
|
|
576
|
-
(_this$props$onCaption = (_this$
|
|
549
|
+
var _this$props$onCaption, _this$props1;
|
|
550
|
+
(_this$props$onCaption = (_this$props1 = _this.props).onCaptionsEnabledChange) === null || _this$props$onCaption === void 0 || _this$props$onCaption.call(_this$props1, areCaptionsEnabled);
|
|
577
551
|
});
|
|
578
552
|
(0, _defineProperty2.default)(_this, "onCaptionDelete", function (artifactName) {
|
|
579
553
|
// Modal is not supported in fullscreen mode (as it uses portals which are not in the same DOM tree),
|
|
@@ -614,9 +588,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
614
588
|
var _this$state3 = _this.state,
|
|
615
589
|
isArtifactUploaderOpen = _this$state3.isArtifactUploaderOpen,
|
|
616
590
|
artifactToDelete = _this$state3.artifactToDelete;
|
|
617
|
-
var _this$
|
|
618
|
-
textTracks = _this$
|
|
619
|
-
identifier = _this$
|
|
591
|
+
var _this$props10 = _this.props,
|
|
592
|
+
textTracks = _this$props10.textTracks,
|
|
593
|
+
identifier = _this$props10.identifier;
|
|
620
594
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_captionsAdminControls.CaptionsAdminControls, {
|
|
621
595
|
textTracks: textTracks,
|
|
622
596
|
onUpload: function onUpload() {
|
|
@@ -673,14 +647,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
673
647
|
return (0, _createClass2.default)(_MediaPlayerBase, [{
|
|
674
648
|
key: "componentDidMount",
|
|
675
649
|
value: function componentDidMount() {
|
|
676
|
-
var _this$
|
|
677
|
-
type = _this$
|
|
678
|
-
identifier = _this$
|
|
679
|
-
isAutoPlay = _this$
|
|
680
|
-
isHDAvailable = _this$
|
|
681
|
-
isHDActive = _this$
|
|
682
|
-
onFirstPlay = _this$
|
|
683
|
-
createAnalyticsEvent = _this$
|
|
650
|
+
var _this$props11 = this.props,
|
|
651
|
+
type = _this$props11.type,
|
|
652
|
+
identifier = _this$props11.identifier,
|
|
653
|
+
isAutoPlay = _this$props11.isAutoPlay,
|
|
654
|
+
isHDAvailable = _this$props11.isHDAvailable,
|
|
655
|
+
isHDActive = _this$props11.isHDActive,
|
|
656
|
+
onFirstPlay = _this$props11.onFirstPlay,
|
|
657
|
+
createAnalyticsEvent = _this$props11.createAnalyticsEvent;
|
|
684
658
|
var _this$state4 = this.state,
|
|
685
659
|
isFullScreenEnabled = _this$state4.isFullScreenEnabled,
|
|
686
660
|
playbackSpeed = _this$state4.playbackSpeed;
|
|
@@ -699,14 +673,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
699
673
|
}
|
|
700
674
|
_simultaneousPlayManager.default.subscribe(this);
|
|
701
675
|
if (isAutoPlay) {
|
|
702
|
-
var _this$props$onPlay, _this$
|
|
676
|
+
var _this$props$onPlay, _this$props12;
|
|
703
677
|
_simultaneousPlayManager.default.pauseOthers(this);
|
|
704
678
|
if (onFirstPlay) {
|
|
705
679
|
this.fireFirstPlayedTrackEvent();
|
|
706
680
|
this.wasPlayedOnce = true;
|
|
707
681
|
onFirstPlay();
|
|
708
682
|
}
|
|
709
|
-
(_this$props$onPlay = (_this$
|
|
683
|
+
(_this$props$onPlay = (_this$props12 = this.props).onPlay) === null || _this$props$onPlay === void 0 || _this$props$onPlay.call(_this$props12);
|
|
710
684
|
}
|
|
711
685
|
}
|
|
712
686
|
}, {
|
|
@@ -716,8 +690,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
716
690
|
this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
|
|
717
691
|
}
|
|
718
692
|
if (this.state.isFullScreenEnabled) {
|
|
719
|
-
var _this$props$onFullscr2, _this$
|
|
720
|
-
(_this$props$onFullscr2 = (_this$
|
|
693
|
+
var _this$props$onFullscr2, _this$props13;
|
|
694
|
+
(_this$props$onFullscr2 = (_this$props13 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props13, false);
|
|
721
695
|
}
|
|
722
696
|
_simultaneousPlayManager.default.unsubscribe(this);
|
|
723
697
|
}
|
|
@@ -738,13 +712,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
738
712
|
}, {
|
|
739
713
|
key: "createAndFireUIEvent",
|
|
740
714
|
value: function createAndFireUIEvent(eventType, actionSubjectId) {
|
|
741
|
-
var _this$
|
|
742
|
-
type = _this$
|
|
743
|
-
identifier = _this$
|
|
744
|
-
isHDActive = _this$
|
|
745
|
-
isHDAvailable = _this$
|
|
746
|
-
isAutoPlay = _this$
|
|
747
|
-
createAnalyticsEvent = _this$
|
|
715
|
+
var _this$props14 = this.props,
|
|
716
|
+
type = _this$props14.type,
|
|
717
|
+
identifier = _this$props14.identifier,
|
|
718
|
+
isHDActive = _this$props14.isHDActive,
|
|
719
|
+
isHDAvailable = _this$props14.isHDAvailable,
|
|
720
|
+
isAutoPlay = _this$props14.isAutoPlay,
|
|
721
|
+
createAnalyticsEvent = _this$props14.createAnalyticsEvent;
|
|
748
722
|
var _this$state5 = this.state,
|
|
749
723
|
isFullScreenEnabled = _this$state5.isFullScreenEnabled,
|
|
750
724
|
playbackSpeed = _this$state5.playbackSpeed;
|
|
@@ -852,16 +826,16 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
852
826
|
key: "render",
|
|
853
827
|
value: function render() {
|
|
854
828
|
var _this4 = this;
|
|
855
|
-
var _this$
|
|
856
|
-
type = _this$
|
|
857
|
-
src = _this$
|
|
858
|
-
isAutoPlay = _this$
|
|
859
|
-
onCanPlay = _this$
|
|
860
|
-
onError = _this$
|
|
861
|
-
poster = _this$
|
|
862
|
-
videoControlsWrapperRef = _this$
|
|
863
|
-
areControlsVisible = _this$
|
|
864
|
-
textTracks = _this$
|
|
829
|
+
var _this$props15 = this.props,
|
|
830
|
+
type = _this$props15.type,
|
|
831
|
+
src = _this$props15.src,
|
|
832
|
+
isAutoPlay = _this$props15.isAutoPlay,
|
|
833
|
+
onCanPlay = _this$props15.onCanPlay,
|
|
834
|
+
onError = _this$props15.onError,
|
|
835
|
+
poster = _this$props15.poster,
|
|
836
|
+
videoControlsWrapperRef = _this$props15.videoControlsWrapperRef,
|
|
837
|
+
areControlsVisible = _this$props15.areControlsVisible,
|
|
838
|
+
textTracks = _this$props15.textTracks;
|
|
865
839
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
866
840
|
xcss: customVideoWrapperStyles.root,
|
|
867
841
|
ref: this.videoWrapperRef,
|
|
@@ -922,7 +896,7 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
922
896
|
alignItems: "center",
|
|
923
897
|
justifyContent: "space-between",
|
|
924
898
|
xcss: timebarWrapperStyles.root
|
|
925
|
-
}, /*#__PURE__*/_react.default.createElement(_styled.LeftControls, null, _this4.shouldRenderPlayPauseButton() && _this4.renderPlayPauseButton(), _this4.shouldRenderSkipButtons() && _this4.renderSkipButtons(), _this4.shouldRenderVolume() && _this4.renderVolume()), /*#__PURE__*/_react.default.createElement(_styled.RightControls, null, _this4.shouldRenderCurrentTime() && _this4.renderCurrentTime(), _this4.shouldRenderCaptionsControls() && _this4.renderCaptionsControls(), _this4.shouldRenderSpeedControls() && _this4.renderSpeedControls(), _this4.
|
|
899
|
+
}, /*#__PURE__*/_react.default.createElement(_styled.LeftControls, null, _this4.shouldRenderPlayPauseButton() && _this4.renderPlayPauseButton(), _this4.shouldRenderSkipButtons() && _this4.renderSkipButtons(), _this4.shouldRenderVolume() && _this4.renderVolume()), /*#__PURE__*/_react.default.createElement(_styled.RightControls, null, _this4.shouldRenderCurrentTime() && _this4.renderCurrentTime(), _this4.shouldRenderCaptionsControls() && _this4.renderCaptionsControls(), _this4.shouldRenderSpeedControls() && _this4.renderSpeedControls(), _this4.shouldRenderDownloadButton() && _this4.renderDownloadButton(), _this4.shouldRenderFullScreenButton() && _this4.renderFullScreenButton(), _this4.shouldRenderCaptionsAdminControls() && _this4.renderCaptionsAdminControls()))));
|
|
926
900
|
}));
|
|
927
901
|
}
|
|
928
902
|
}]);
|
|
@@ -12,8 +12,6 @@ import PauseIcon from '@atlaskit/icon/core/video-pause';
|
|
|
12
12
|
import FullScreenIconOn from '@atlaskit/icon/core/fullscreen-enter';
|
|
13
13
|
import FullScreenIconOff from '@atlaskit/icon/core/shrink-diagonal';
|
|
14
14
|
import SoundIcon from '@atlaskit/icon/core/volume-high';
|
|
15
|
-
import VideoHdIcon from '@atlaskit/icon-lab/core/video-hd';
|
|
16
|
-
import VideoHdFilledIcon from '@atlaskit/icon-lab/core/video-hd-filled';
|
|
17
15
|
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
18
16
|
import { Box, Flex } from '@atlaskit/primitives/compiled';
|
|
19
17
|
import MediaButton from '../MediaButton';
|
|
@@ -148,27 +146,6 @@ export class CustomMediaPlayerBase extends Component {
|
|
|
148
146
|
draggable: false,
|
|
149
147
|
"data-testid": "current-time"
|
|
150
148
|
}, formatDuration(currentTime), " / ", formatDuration(duration)));
|
|
151
|
-
_defineProperty(this, "renderHDButton", () => {
|
|
152
|
-
const {
|
|
153
|
-
type,
|
|
154
|
-
isHDAvailable,
|
|
155
|
-
isHDActive,
|
|
156
|
-
onHDToggleClick
|
|
157
|
-
} = this.props;
|
|
158
|
-
if (type === 'audio' || !isHDAvailable) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
return /*#__PURE__*/React.createElement(MediaButton, {
|
|
162
|
-
testId: "custom-media-player-hd-button",
|
|
163
|
-
onClick: !!onHDToggleClick ? this.getMediaButtonClickHandler(onHDToggleClick, 'HDButton') : undefined,
|
|
164
|
-
iconBefore: isHDActive ? /*#__PURE__*/React.createElement(VideoHdFilledIcon, {
|
|
165
|
-
label: "hd active"
|
|
166
|
-
}) : /*#__PURE__*/React.createElement(VideoHdIcon, {
|
|
167
|
-
label: "hd inactive"
|
|
168
|
-
}),
|
|
169
|
-
"aria-pressed": isHDActive
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
149
|
_defineProperty(this, "onPlaybackSpeedChange", playbackSpeed => {
|
|
173
150
|
if (!this.actions) {
|
|
174
151
|
return;
|
|
@@ -680,7 +657,7 @@ export class CustomMediaPlayerBase extends Component {
|
|
|
680
657
|
alignItems: "center",
|
|
681
658
|
justifyContent: "space-between",
|
|
682
659
|
xcss: timebarWrapperStyles.root
|
|
683
|
-
}, /*#__PURE__*/React.createElement(LeftControls, null, this.renderPlayPauseButton(isPlaying), isLargePlayer && this.renderSkipBackwardButton(skipBackward), isLargePlayer && this.renderSkipForwardButton(skipForward), this.renderVolume(videoState, actions, isLargePlayer)), /*#__PURE__*/React.createElement(RightControls, null, (isMediumPlayer || isLargePlayer) && this.renderCurrentTime(videoState), isLargePlayer &&
|
|
660
|
+
}, /*#__PURE__*/React.createElement(LeftControls, null, this.renderPlayPauseButton(isPlaying), isLargePlayer && this.renderSkipBackwardButton(skipBackward), isLargePlayer && this.renderSkipForwardButton(skipForward), this.renderVolume(videoState, actions, isLargePlayer)), /*#__PURE__*/React.createElement(RightControls, null, (isMediumPlayer || isLargePlayer) && this.renderCurrentTime(videoState), isLargePlayer && this.renderSpeedControls(), this.renderFullScreenButton(), isLargePlayer && this.renderDownloadButton()))));
|
|
684
661
|
}));
|
|
685
662
|
}
|
|
686
663
|
}
|
|
@@ -12,8 +12,6 @@ import PauseIcon from '@atlaskit/icon/core/video-pause';
|
|
|
12
12
|
import FullScreenIconOn from '@atlaskit/icon/core/fullscreen-enter';
|
|
13
13
|
import FullScreenIconOff from '@atlaskit/icon/core/shrink-diagonal';
|
|
14
14
|
import SoundIcon from '@atlaskit/icon/core/volume-high';
|
|
15
|
-
import VideoHdIcon from '@atlaskit/icon-lab/core/video-hd';
|
|
16
|
-
import VideoHdFilledIcon from '@atlaskit/icon-lab/core/video-hd-filled';
|
|
17
15
|
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
18
16
|
import { injectIntl } from 'react-intl-next';
|
|
19
17
|
import { Box, Flex } from '@atlaskit/primitives/compiled';
|
|
@@ -59,7 +57,6 @@ const breakpointControls = {
|
|
|
59
57
|
volumeSlider: playerWidth => playerWidth > breakpoints.MEDIUM_VIDEO_MAX_WIDTH,
|
|
60
58
|
skipButtons: playerWidth => playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH,
|
|
61
59
|
speedControls: playerWidth => playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH,
|
|
62
|
-
hdButton: playerWidth => playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH,
|
|
63
60
|
captionsAdminControls: playerWidth => playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH
|
|
64
61
|
};
|
|
65
62
|
const getPlayerSize = playerWidth => {
|
|
@@ -186,29 +183,6 @@ class _MediaPlayerBase extends Component {
|
|
|
186
183
|
"data-testid": "current-time"
|
|
187
184
|
}, formatDuration(this.videoState.currentTime), " / ", formatDuration(this.videoState.duration));
|
|
188
185
|
});
|
|
189
|
-
_defineProperty(this, "shouldRenderHdButton", () => {
|
|
190
|
-
const {
|
|
191
|
-
type,
|
|
192
|
-
isHDAvailable
|
|
193
|
-
} = this.props;
|
|
194
|
-
return !fg('platform_media_disable_video_640p_artifact_usage') && breakpointControls.hdButton(this.state.playerWidth) && type !== 'audio' && !!isHDAvailable;
|
|
195
|
-
});
|
|
196
|
-
_defineProperty(this, "renderHDButton", () => {
|
|
197
|
-
const {
|
|
198
|
-
isHDActive,
|
|
199
|
-
onHDToggleClick
|
|
200
|
-
} = this.props;
|
|
201
|
-
return /*#__PURE__*/React.createElement(MediaButton, {
|
|
202
|
-
testId: "custom-media-player-hd-button",
|
|
203
|
-
onClick: !!onHDToggleClick ? this.getMediaButtonClickHandler(onHDToggleClick, 'HDButton') : undefined,
|
|
204
|
-
iconBefore: isHDActive ? /*#__PURE__*/React.createElement(VideoHdFilledIcon, {
|
|
205
|
-
label: "hd active"
|
|
206
|
-
}) : /*#__PURE__*/React.createElement(VideoHdIcon, {
|
|
207
|
-
label: "hd inactive"
|
|
208
|
-
}),
|
|
209
|
-
"aria-pressed": isHDActive
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
186
|
_defineProperty(this, "onPlaybackSpeedChange", playbackSpeed => {
|
|
213
187
|
if (!this.actions) {
|
|
214
188
|
return;
|
|
@@ -875,7 +849,7 @@ class _MediaPlayerBase extends Component {
|
|
|
875
849
|
alignItems: "center",
|
|
876
850
|
justifyContent: "space-between",
|
|
877
851
|
xcss: timebarWrapperStyles.root
|
|
878
|
-
}, /*#__PURE__*/React.createElement(LeftControls, null, this.shouldRenderPlayPauseButton() && this.renderPlayPauseButton(), this.shouldRenderSkipButtons() && this.renderSkipButtons(), this.shouldRenderVolume() && this.renderVolume()), /*#__PURE__*/React.createElement(RightControls, null, this.shouldRenderCurrentTime() && this.renderCurrentTime(), this.shouldRenderCaptionsControls() && this.renderCaptionsControls(), this.shouldRenderSpeedControls() && this.renderSpeedControls(), this.
|
|
852
|
+
}, /*#__PURE__*/React.createElement(LeftControls, null, this.shouldRenderPlayPauseButton() && this.renderPlayPauseButton(), this.shouldRenderSkipButtons() && this.renderSkipButtons(), this.shouldRenderVolume() && this.renderVolume()), /*#__PURE__*/React.createElement(RightControls, null, this.shouldRenderCurrentTime() && this.renderCurrentTime(), this.shouldRenderCaptionsControls() && this.renderCaptionsControls(), this.shouldRenderSpeedControls() && this.renderSpeedControls(), this.shouldRenderDownloadButton() && this.renderDownloadButton(), this.shouldRenderFullScreenButton() && this.renderFullScreenButton(), this.shouldRenderCaptionsAdminControls() && this.renderCaptionsAdminControls()))));
|
|
879
853
|
}));
|
|
880
854
|
}
|
|
881
855
|
}
|
|
@@ -21,8 +21,6 @@ import PauseIcon from '@atlaskit/icon/core/video-pause';
|
|
|
21
21
|
import FullScreenIconOn from '@atlaskit/icon/core/fullscreen-enter';
|
|
22
22
|
import FullScreenIconOff from '@atlaskit/icon/core/shrink-diagonal';
|
|
23
23
|
import SoundIcon from '@atlaskit/icon/core/volume-high';
|
|
24
|
-
import VideoHdIcon from '@atlaskit/icon-lab/core/video-hd';
|
|
25
|
-
import VideoHdFilledIcon from '@atlaskit/icon-lab/core/video-hd-filled';
|
|
26
24
|
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
27
25
|
import { Box, Flex } from '@atlaskit/primitives/compiled';
|
|
28
26
|
import MediaButton from '../MediaButton';
|
|
@@ -159,26 +157,6 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
159
157
|
"data-testid": "current-time"
|
|
160
158
|
}, formatDuration(currentTime), " / ", formatDuration(duration));
|
|
161
159
|
});
|
|
162
|
-
_defineProperty(_this, "renderHDButton", function () {
|
|
163
|
-
var _this$props4 = _this.props,
|
|
164
|
-
type = _this$props4.type,
|
|
165
|
-
isHDAvailable = _this$props4.isHDAvailable,
|
|
166
|
-
isHDActive = _this$props4.isHDActive,
|
|
167
|
-
onHDToggleClick = _this$props4.onHDToggleClick;
|
|
168
|
-
if (type === 'audio' || !isHDAvailable) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
return /*#__PURE__*/React.createElement(MediaButton, {
|
|
172
|
-
testId: "custom-media-player-hd-button",
|
|
173
|
-
onClick: !!onHDToggleClick ? _this.getMediaButtonClickHandler(onHDToggleClick, 'HDButton') : undefined,
|
|
174
|
-
iconBefore: isHDActive ? /*#__PURE__*/React.createElement(VideoHdFilledIcon, {
|
|
175
|
-
label: "hd active"
|
|
176
|
-
}) : /*#__PURE__*/React.createElement(VideoHdIcon, {
|
|
177
|
-
label: "hd inactive"
|
|
178
|
-
}),
|
|
179
|
-
"aria-pressed": isHDActive
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
160
|
_defineProperty(_this, "onPlaybackSpeedChange", function (playbackSpeed) {
|
|
183
161
|
if (!_this.actions) {
|
|
184
162
|
return;
|
|
@@ -249,9 +227,9 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
249
227
|
}
|
|
250
228
|
});
|
|
251
229
|
_defineProperty(_this, "renderFullScreenButton", function () {
|
|
252
|
-
var _this$
|
|
253
|
-
formatMessage = _this$
|
|
254
|
-
type = _this$
|
|
230
|
+
var _this$props4 = _this.props,
|
|
231
|
+
formatMessage = _this$props4.intl.formatMessage,
|
|
232
|
+
type = _this$props4.type;
|
|
255
233
|
if (type === 'audio') {
|
|
256
234
|
return;
|
|
257
235
|
}
|
|
@@ -376,16 +354,16 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
376
354
|
}));
|
|
377
355
|
});
|
|
378
356
|
_defineProperty(_this, "pause", function () {
|
|
379
|
-
var _this$
|
|
357
|
+
var _this$props5, _this$props5$onPause;
|
|
380
358
|
if (_this.actions) {
|
|
381
359
|
_this.actions.pause();
|
|
382
360
|
}
|
|
383
|
-
(_this$
|
|
361
|
+
(_this$props5 = _this.props) === null || _this$props5 === void 0 || (_this$props5$onPause = _this$props5.onPause) === null || _this$props5$onPause === void 0 || _this$props5$onPause.call(_this$props5);
|
|
384
362
|
});
|
|
385
363
|
_defineProperty(_this, "play", function () {
|
|
386
|
-
var _this$
|
|
387
|
-
onFirstPlay = _this$
|
|
388
|
-
onPlay = _this$
|
|
364
|
+
var _this$props6 = _this.props,
|
|
365
|
+
onFirstPlay = _this$props6.onFirstPlay,
|
|
366
|
+
onPlay = _this$props6.onPlay;
|
|
389
367
|
if (_this.actions) {
|
|
390
368
|
_this.actions.play();
|
|
391
369
|
}
|
|
@@ -414,13 +392,13 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
414
392
|
};
|
|
415
393
|
});
|
|
416
394
|
_defineProperty(_this, "onViewed", function (videoState) {
|
|
417
|
-
var _this$
|
|
418
|
-
createAnalyticsEvent = _this$
|
|
419
|
-
fileId = _this$
|
|
420
|
-
isAutoPlay = _this$
|
|
421
|
-
isHDAvailable = _this$
|
|
422
|
-
isHDActive = _this$
|
|
423
|
-
type = _this$
|
|
395
|
+
var _this$props7 = _this.props,
|
|
396
|
+
createAnalyticsEvent = _this$props7.createAnalyticsEvent,
|
|
397
|
+
fileId = _this$props7.fileId,
|
|
398
|
+
isAutoPlay = _this$props7.isAutoPlay,
|
|
399
|
+
isHDAvailable = _this$props7.isHDAvailable,
|
|
400
|
+
isHDActive = _this$props7.isHDActive,
|
|
401
|
+
type = _this$props7.type;
|
|
424
402
|
var _this$state2 = _this.state,
|
|
425
403
|
isFullScreenEnabled = _this$state2.isFullScreenEnabled,
|
|
426
404
|
playerSize = _this$state2.playerSize,
|
|
@@ -470,14 +448,14 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
470
448
|
return _createClass(CustomMediaPlayerBase, [{
|
|
471
449
|
key: "componentDidMount",
|
|
472
450
|
value: function componentDidMount() {
|
|
473
|
-
var _this$
|
|
474
|
-
type = _this$
|
|
475
|
-
fileId = _this$
|
|
476
|
-
isAutoPlay = _this$
|
|
477
|
-
isHDAvailable = _this$
|
|
478
|
-
isHDActive = _this$
|
|
479
|
-
onFirstPlay = _this$
|
|
480
|
-
createAnalyticsEvent = _this$
|
|
451
|
+
var _this$props8 = this.props,
|
|
452
|
+
type = _this$props8.type,
|
|
453
|
+
fileId = _this$props8.fileId,
|
|
454
|
+
isAutoPlay = _this$props8.isAutoPlay,
|
|
455
|
+
isHDAvailable = _this$props8.isHDAvailable,
|
|
456
|
+
isHDActive = _this$props8.isHDActive,
|
|
457
|
+
onFirstPlay = _this$props8.onFirstPlay,
|
|
458
|
+
createAnalyticsEvent = _this$props8.createAnalyticsEvent;
|
|
481
459
|
var _this$state3 = this.state,
|
|
482
460
|
isFullScreenEnabled = _this$state3.isFullScreenEnabled,
|
|
483
461
|
playerSize = _this$state3.playerSize,
|
|
@@ -495,14 +473,14 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
495
473
|
}
|
|
496
474
|
simultaneousPlayManager.subscribe(this);
|
|
497
475
|
if (isAutoPlay) {
|
|
498
|
-
var _this$
|
|
476
|
+
var _this$props9, _this$props9$onPlay;
|
|
499
477
|
simultaneousPlayManager.pauseOthers(this);
|
|
500
478
|
if (onFirstPlay) {
|
|
501
479
|
this.fireFirstPlayedTrackEvent();
|
|
502
480
|
this.wasPlayedOnce = true;
|
|
503
481
|
onFirstPlay();
|
|
504
482
|
}
|
|
505
|
-
(_this$
|
|
483
|
+
(_this$props9 = this.props) === null || _this$props9 === void 0 || (_this$props9$onPlay = _this$props9.onPlay) === null || _this$props9$onPlay === void 0 || _this$props9$onPlay.call(_this$props9);
|
|
506
484
|
}
|
|
507
485
|
}
|
|
508
486
|
}, {
|
|
@@ -512,8 +490,8 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
512
490
|
this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
|
|
513
491
|
}
|
|
514
492
|
if (this.state.isFullScreenEnabled) {
|
|
515
|
-
var _this$props$onFullscr2, _this$
|
|
516
|
-
(_this$props$onFullscr2 = (_this$
|
|
493
|
+
var _this$props$onFullscr2, _this$props0;
|
|
494
|
+
(_this$props$onFullscr2 = (_this$props0 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props0, false);
|
|
517
495
|
}
|
|
518
496
|
simultaneousPlayManager.unsubscribe(this);
|
|
519
497
|
}
|
|
@@ -529,13 +507,13 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
529
507
|
}, {
|
|
530
508
|
key: "createAndFireUIEvent",
|
|
531
509
|
value: function createAndFireUIEvent(eventType, actionSubjectId) {
|
|
532
|
-
var _this$
|
|
533
|
-
type = _this$
|
|
534
|
-
fileId = _this$
|
|
535
|
-
isHDActive = _this$
|
|
536
|
-
isHDAvailable = _this$
|
|
537
|
-
isAutoPlay = _this$
|
|
538
|
-
createAnalyticsEvent = _this$
|
|
510
|
+
var _this$props1 = this.props,
|
|
511
|
+
type = _this$props1.type,
|
|
512
|
+
fileId = _this$props1.fileId,
|
|
513
|
+
isHDActive = _this$props1.isHDActive,
|
|
514
|
+
isHDAvailable = _this$props1.isHDAvailable,
|
|
515
|
+
isAutoPlay = _this$props1.isAutoPlay,
|
|
516
|
+
createAnalyticsEvent = _this$props1.createAnalyticsEvent;
|
|
539
517
|
var _this$state4 = this.state,
|
|
540
518
|
isFullScreenEnabled = _this$state4.isFullScreenEnabled,
|
|
541
519
|
playerSize = _this$state4.playerSize,
|
|
@@ -582,14 +560,14 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
582
560
|
key: "render",
|
|
583
561
|
value: function render() {
|
|
584
562
|
var _this2 = this;
|
|
585
|
-
var _this$
|
|
586
|
-
type = _this$
|
|
587
|
-
src = _this$
|
|
588
|
-
isAutoPlay = _this$
|
|
589
|
-
onCanPlay = _this$
|
|
590
|
-
onError = _this$
|
|
591
|
-
poster = _this$
|
|
592
|
-
videoControlsWrapperRef = _this$
|
|
563
|
+
var _this$props10 = this.props,
|
|
564
|
+
type = _this$props10.type,
|
|
565
|
+
src = _this$props10.src,
|
|
566
|
+
isAutoPlay = _this$props10.isAutoPlay,
|
|
567
|
+
onCanPlay = _this$props10.onCanPlay,
|
|
568
|
+
onError = _this$props10.onError,
|
|
569
|
+
poster = _this$props10.poster,
|
|
570
|
+
videoControlsWrapperRef = _this$props10.videoControlsWrapperRef;
|
|
593
571
|
return /*#__PURE__*/React.createElement(Box, {
|
|
594
572
|
xcss: customVideoWrapperStyles.root,
|
|
595
573
|
ref: this.videoWrapperRef,
|
|
@@ -671,7 +649,7 @@ export var CustomMediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
671
649
|
alignItems: "center",
|
|
672
650
|
justifyContent: "space-between",
|
|
673
651
|
xcss: timebarWrapperStyles.root
|
|
674
|
-
}, /*#__PURE__*/React.createElement(LeftControls, null, _this2.renderPlayPauseButton(isPlaying), isLargePlayer && _this2.renderSkipBackwardButton(skipBackward), isLargePlayer && _this2.renderSkipForwardButton(skipForward), _this2.renderVolume(videoState, actions, isLargePlayer)), /*#__PURE__*/React.createElement(RightControls, null, (isMediumPlayer || isLargePlayer) && _this2.renderCurrentTime(videoState), isLargePlayer &&
|
|
652
|
+
}, /*#__PURE__*/React.createElement(LeftControls, null, _this2.renderPlayPauseButton(isPlaying), isLargePlayer && _this2.renderSkipBackwardButton(skipBackward), isLargePlayer && _this2.renderSkipForwardButton(skipForward), _this2.renderVolume(videoState, actions, isLargePlayer)), /*#__PURE__*/React.createElement(RightControls, null, (isMediumPlayer || isLargePlayer) && _this2.renderCurrentTime(videoState), isLargePlayer && _this2.renderSpeedControls(), _this2.renderFullScreenButton(), isLargePlayer && _this2.renderDownloadButton()))));
|
|
675
653
|
}));
|
|
676
654
|
}
|
|
677
655
|
}]);
|
|
@@ -21,8 +21,6 @@ import PauseIcon from '@atlaskit/icon/core/video-pause';
|
|
|
21
21
|
import FullScreenIconOn from '@atlaskit/icon/core/fullscreen-enter';
|
|
22
22
|
import FullScreenIconOff from '@atlaskit/icon/core/shrink-diagonal';
|
|
23
23
|
import SoundIcon from '@atlaskit/icon/core/volume-high';
|
|
24
|
-
import VideoHdIcon from '@atlaskit/icon-lab/core/video-hd';
|
|
25
|
-
import VideoHdFilledIcon from '@atlaskit/icon-lab/core/video-hd-filled';
|
|
26
24
|
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
27
25
|
import { injectIntl } from 'react-intl-next';
|
|
28
26
|
import { Box, Flex } from '@atlaskit/primitives/compiled';
|
|
@@ -86,9 +84,6 @@ var breakpointControls = {
|
|
|
86
84
|
speedControls: function speedControls(playerWidth) {
|
|
87
85
|
return playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH;
|
|
88
86
|
},
|
|
89
|
-
hdButton: function hdButton(playerWidth) {
|
|
90
|
-
return playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH;
|
|
91
|
-
},
|
|
92
87
|
captionsAdminControls: function captionsAdminControls(playerWidth) {
|
|
93
88
|
return playerWidth > breakpoints.LARGE_VIDEO_MAX_WIDTH;
|
|
94
89
|
}
|
|
@@ -221,27 +216,6 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
221
216
|
"data-testid": "current-time"
|
|
222
217
|
}, formatDuration(_this.videoState.currentTime), " / ", formatDuration(_this.videoState.duration));
|
|
223
218
|
});
|
|
224
|
-
_defineProperty(_this, "shouldRenderHdButton", function () {
|
|
225
|
-
var _this$props4 = _this.props,
|
|
226
|
-
type = _this$props4.type,
|
|
227
|
-
isHDAvailable = _this$props4.isHDAvailable;
|
|
228
|
-
return !fg('platform_media_disable_video_640p_artifact_usage') && breakpointControls.hdButton(_this.state.playerWidth) && type !== 'audio' && !!isHDAvailable;
|
|
229
|
-
});
|
|
230
|
-
_defineProperty(_this, "renderHDButton", function () {
|
|
231
|
-
var _this$props5 = _this.props,
|
|
232
|
-
isHDActive = _this$props5.isHDActive,
|
|
233
|
-
onHDToggleClick = _this$props5.onHDToggleClick;
|
|
234
|
-
return /*#__PURE__*/React.createElement(MediaButton, {
|
|
235
|
-
testId: "custom-media-player-hd-button",
|
|
236
|
-
onClick: !!onHDToggleClick ? _this.getMediaButtonClickHandler(onHDToggleClick, 'HDButton') : undefined,
|
|
237
|
-
iconBefore: isHDActive ? /*#__PURE__*/React.createElement(VideoHdFilledIcon, {
|
|
238
|
-
label: "hd active"
|
|
239
|
-
}) : /*#__PURE__*/React.createElement(VideoHdIcon, {
|
|
240
|
-
label: "hd inactive"
|
|
241
|
-
}),
|
|
242
|
-
"aria-pressed": isHDActive
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
219
|
_defineProperty(_this, "onPlaybackSpeedChange", function (playbackSpeed) {
|
|
246
220
|
if (!_this.actions) {
|
|
247
221
|
return;
|
|
@@ -320,9 +294,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
320
294
|
return breakpointControls.fullScreenButton(_this.state.playerWidth);
|
|
321
295
|
});
|
|
322
296
|
_defineProperty(_this, "renderFullScreenButton", function () {
|
|
323
|
-
var _this$
|
|
324
|
-
formatMessage = _this$
|
|
325
|
-
type = _this$
|
|
297
|
+
var _this$props4 = _this.props,
|
|
298
|
+
formatMessage = _this$props4.intl.formatMessage,
|
|
299
|
+
type = _this$props4.type;
|
|
326
300
|
if (type === 'audio') {
|
|
327
301
|
return;
|
|
328
302
|
}
|
|
@@ -410,18 +384,18 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
410
384
|
});
|
|
411
385
|
_defineProperty(_this, "defaultSkipAmount", 10);
|
|
412
386
|
_defineProperty(_this, "skipBackward", function () {
|
|
413
|
-
var _this$actions3, _this$props$onTimeCha2, _this$
|
|
387
|
+
var _this$actions3, _this$props$onTimeCha2, _this$props5;
|
|
414
388
|
var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.defaultSkipAmount;
|
|
415
389
|
var newTime = _this.videoState.currentTime - skipAmount;
|
|
416
390
|
(_this$actions3 = _this.actions) === null || _this$actions3 === void 0 || _this$actions3.navigate(Math.max(newTime, 0));
|
|
417
|
-
(_this$props$onTimeCha2 = (_this$
|
|
391
|
+
(_this$props$onTimeCha2 = (_this$props5 = _this.props).onTimeChanged) === null || _this$props$onTimeCha2 === void 0 || _this$props$onTimeCha2.call(_this$props5);
|
|
418
392
|
});
|
|
419
393
|
_defineProperty(_this, "skipForward", function () {
|
|
420
|
-
var _this$actions4, _this$props$onTimeCha3, _this$
|
|
394
|
+
var _this$actions4, _this$props$onTimeCha3, _this$props6;
|
|
421
395
|
var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.defaultSkipAmount;
|
|
422
396
|
var newTime = _this.videoState.currentTime + skipAmount;
|
|
423
397
|
(_this$actions4 = _this.actions) === null || _this$actions4 === void 0 || _this$actions4.navigate(Math.min(newTime, _this.videoState.duration));
|
|
424
|
-
(_this$props$onTimeCha3 = (_this$
|
|
398
|
+
(_this$props$onTimeCha3 = (_this$props6 = _this.props).onTimeChanged) === null || _this$props$onTimeCha3 === void 0 || _this$props$onTimeCha3.call(_this$props6);
|
|
425
399
|
});
|
|
426
400
|
_defineProperty(_this, "renderSkipBackwardButton", function () {
|
|
427
401
|
var formatMessage = _this.props.intl.formatMessage;
|
|
@@ -472,16 +446,16 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
472
446
|
}));
|
|
473
447
|
});
|
|
474
448
|
_defineProperty(_this, "pause", function () {
|
|
475
|
-
var _this$props$onPause, _this$
|
|
449
|
+
var _this$props$onPause, _this$props7;
|
|
476
450
|
if (_this.actions) {
|
|
477
451
|
_this.actions.pause();
|
|
478
452
|
}
|
|
479
|
-
(_this$props$onPause = (_this$
|
|
453
|
+
(_this$props$onPause = (_this$props7 = _this.props).onPause) === null || _this$props$onPause === void 0 || _this$props$onPause.call(_this$props7);
|
|
480
454
|
});
|
|
481
455
|
_defineProperty(_this, "play", function () {
|
|
482
|
-
var _this$
|
|
483
|
-
onFirstPlay = _this$
|
|
484
|
-
onPlay = _this$
|
|
456
|
+
var _this$props8 = _this.props,
|
|
457
|
+
onFirstPlay = _this$props8.onFirstPlay,
|
|
458
|
+
onPlay = _this$props8.onPlay;
|
|
485
459
|
if (_this.actions) {
|
|
486
460
|
_this.actions.play();
|
|
487
461
|
}
|
|
@@ -510,13 +484,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
510
484
|
};
|
|
511
485
|
});
|
|
512
486
|
_defineProperty(_this, "onViewed", function (videoState) {
|
|
513
|
-
var _this$
|
|
514
|
-
createAnalyticsEvent = _this$
|
|
515
|
-
identifier = _this$
|
|
516
|
-
isAutoPlay = _this$
|
|
517
|
-
isHDAvailable = _this$
|
|
518
|
-
isHDActive = _this$
|
|
519
|
-
type = _this$
|
|
487
|
+
var _this$props9 = _this.props,
|
|
488
|
+
createAnalyticsEvent = _this$props9.createAnalyticsEvent,
|
|
489
|
+
identifier = _this$props9.identifier,
|
|
490
|
+
isAutoPlay = _this$props9.isAutoPlay,
|
|
491
|
+
isHDAvailable = _this$props9.isHDAvailable,
|
|
492
|
+
isHDActive = _this$props9.isHDActive,
|
|
493
|
+
type = _this$props9.type;
|
|
520
494
|
var _this$state2 = _this.state,
|
|
521
495
|
isFullScreenEnabled = _this$state2.isFullScreenEnabled,
|
|
522
496
|
playbackSpeed = _this$state2.playbackSpeed;
|
|
@@ -562,12 +536,12 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
562
536
|
_defineProperty(_this, "startPlayByButtonClick", _this.getMediaButtonClickHandler(_this.play, 'playButton'));
|
|
563
537
|
_defineProperty(_this, "pausePlayByButtonClick", _this.getMediaButtonClickHandler(_this.pause, 'pauseButton'));
|
|
564
538
|
_defineProperty(_this, "onTextTracksSelected", function (selectedTracksIndex) {
|
|
565
|
-
var _this$props$onTextTra, _this$
|
|
566
|
-
(_this$props$onTextTra = (_this$
|
|
539
|
+
var _this$props$onTextTra, _this$props0;
|
|
540
|
+
(_this$props$onTextTra = (_this$props0 = _this.props).onTextTracksSelected) === null || _this$props$onTextTra === void 0 || _this$props$onTextTra.call(_this$props0, selectedTracksIndex);
|
|
567
541
|
});
|
|
568
542
|
_defineProperty(_this, "onCaptionsEnabledChange", function (areCaptionsEnabled) {
|
|
569
|
-
var _this$props$onCaption, _this$
|
|
570
|
-
(_this$props$onCaption = (_this$
|
|
543
|
+
var _this$props$onCaption, _this$props1;
|
|
544
|
+
(_this$props$onCaption = (_this$props1 = _this.props).onCaptionsEnabledChange) === null || _this$props$onCaption === void 0 || _this$props$onCaption.call(_this$props1, areCaptionsEnabled);
|
|
571
545
|
});
|
|
572
546
|
_defineProperty(_this, "onCaptionDelete", function (artifactName) {
|
|
573
547
|
// Modal is not supported in fullscreen mode (as it uses portals which are not in the same DOM tree),
|
|
@@ -608,9 +582,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
608
582
|
var _this$state3 = _this.state,
|
|
609
583
|
isArtifactUploaderOpen = _this$state3.isArtifactUploaderOpen,
|
|
610
584
|
artifactToDelete = _this$state3.artifactToDelete;
|
|
611
|
-
var _this$
|
|
612
|
-
textTracks = _this$
|
|
613
|
-
identifier = _this$
|
|
585
|
+
var _this$props10 = _this.props,
|
|
586
|
+
textTracks = _this$props10.textTracks,
|
|
587
|
+
identifier = _this$props10.identifier;
|
|
614
588
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CaptionsAdminControls, {
|
|
615
589
|
textTracks: textTracks,
|
|
616
590
|
onUpload: function onUpload() {
|
|
@@ -667,14 +641,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
667
641
|
return _createClass(_MediaPlayerBase, [{
|
|
668
642
|
key: "componentDidMount",
|
|
669
643
|
value: function componentDidMount() {
|
|
670
|
-
var _this$
|
|
671
|
-
type = _this$
|
|
672
|
-
identifier = _this$
|
|
673
|
-
isAutoPlay = _this$
|
|
674
|
-
isHDAvailable = _this$
|
|
675
|
-
isHDActive = _this$
|
|
676
|
-
onFirstPlay = _this$
|
|
677
|
-
createAnalyticsEvent = _this$
|
|
644
|
+
var _this$props11 = this.props,
|
|
645
|
+
type = _this$props11.type,
|
|
646
|
+
identifier = _this$props11.identifier,
|
|
647
|
+
isAutoPlay = _this$props11.isAutoPlay,
|
|
648
|
+
isHDAvailable = _this$props11.isHDAvailable,
|
|
649
|
+
isHDActive = _this$props11.isHDActive,
|
|
650
|
+
onFirstPlay = _this$props11.onFirstPlay,
|
|
651
|
+
createAnalyticsEvent = _this$props11.createAnalyticsEvent;
|
|
678
652
|
var _this$state4 = this.state,
|
|
679
653
|
isFullScreenEnabled = _this$state4.isFullScreenEnabled,
|
|
680
654
|
playbackSpeed = _this$state4.playbackSpeed;
|
|
@@ -693,14 +667,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
693
667
|
}
|
|
694
668
|
simultaneousPlayManager.subscribe(this);
|
|
695
669
|
if (isAutoPlay) {
|
|
696
|
-
var _this$props$onPlay, _this$
|
|
670
|
+
var _this$props$onPlay, _this$props12;
|
|
697
671
|
simultaneousPlayManager.pauseOthers(this);
|
|
698
672
|
if (onFirstPlay) {
|
|
699
673
|
this.fireFirstPlayedTrackEvent();
|
|
700
674
|
this.wasPlayedOnce = true;
|
|
701
675
|
onFirstPlay();
|
|
702
676
|
}
|
|
703
|
-
(_this$props$onPlay = (_this$
|
|
677
|
+
(_this$props$onPlay = (_this$props12 = this.props).onPlay) === null || _this$props$onPlay === void 0 || _this$props$onPlay.call(_this$props12);
|
|
704
678
|
}
|
|
705
679
|
}
|
|
706
680
|
}, {
|
|
@@ -710,8 +684,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
710
684
|
this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
|
|
711
685
|
}
|
|
712
686
|
if (this.state.isFullScreenEnabled) {
|
|
713
|
-
var _this$props$onFullscr2, _this$
|
|
714
|
-
(_this$props$onFullscr2 = (_this$
|
|
687
|
+
var _this$props$onFullscr2, _this$props13;
|
|
688
|
+
(_this$props$onFullscr2 = (_this$props13 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props13, false);
|
|
715
689
|
}
|
|
716
690
|
simultaneousPlayManager.unsubscribe(this);
|
|
717
691
|
}
|
|
@@ -732,13 +706,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
732
706
|
}, {
|
|
733
707
|
key: "createAndFireUIEvent",
|
|
734
708
|
value: function createAndFireUIEvent(eventType, actionSubjectId) {
|
|
735
|
-
var _this$
|
|
736
|
-
type = _this$
|
|
737
|
-
identifier = _this$
|
|
738
|
-
isHDActive = _this$
|
|
739
|
-
isHDAvailable = _this$
|
|
740
|
-
isAutoPlay = _this$
|
|
741
|
-
createAnalyticsEvent = _this$
|
|
709
|
+
var _this$props14 = this.props,
|
|
710
|
+
type = _this$props14.type,
|
|
711
|
+
identifier = _this$props14.identifier,
|
|
712
|
+
isHDActive = _this$props14.isHDActive,
|
|
713
|
+
isHDAvailable = _this$props14.isHDAvailable,
|
|
714
|
+
isAutoPlay = _this$props14.isAutoPlay,
|
|
715
|
+
createAnalyticsEvent = _this$props14.createAnalyticsEvent;
|
|
742
716
|
var _this$state5 = this.state,
|
|
743
717
|
isFullScreenEnabled = _this$state5.isFullScreenEnabled,
|
|
744
718
|
playbackSpeed = _this$state5.playbackSpeed;
|
|
@@ -846,16 +820,16 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
846
820
|
key: "render",
|
|
847
821
|
value: function render() {
|
|
848
822
|
var _this4 = this;
|
|
849
|
-
var _this$
|
|
850
|
-
type = _this$
|
|
851
|
-
src = _this$
|
|
852
|
-
isAutoPlay = _this$
|
|
853
|
-
onCanPlay = _this$
|
|
854
|
-
onError = _this$
|
|
855
|
-
poster = _this$
|
|
856
|
-
videoControlsWrapperRef = _this$
|
|
857
|
-
areControlsVisible = _this$
|
|
858
|
-
textTracks = _this$
|
|
823
|
+
var _this$props15 = this.props,
|
|
824
|
+
type = _this$props15.type,
|
|
825
|
+
src = _this$props15.src,
|
|
826
|
+
isAutoPlay = _this$props15.isAutoPlay,
|
|
827
|
+
onCanPlay = _this$props15.onCanPlay,
|
|
828
|
+
onError = _this$props15.onError,
|
|
829
|
+
poster = _this$props15.poster,
|
|
830
|
+
videoControlsWrapperRef = _this$props15.videoControlsWrapperRef,
|
|
831
|
+
areControlsVisible = _this$props15.areControlsVisible,
|
|
832
|
+
textTracks = _this$props15.textTracks;
|
|
859
833
|
return /*#__PURE__*/React.createElement(Box, {
|
|
860
834
|
xcss: customVideoWrapperStyles.root,
|
|
861
835
|
ref: this.videoWrapperRef,
|
|
@@ -916,7 +890,7 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
916
890
|
alignItems: "center",
|
|
917
891
|
justifyContent: "space-between",
|
|
918
892
|
xcss: timebarWrapperStyles.root
|
|
919
|
-
}, /*#__PURE__*/React.createElement(LeftControls, null, _this4.shouldRenderPlayPauseButton() && _this4.renderPlayPauseButton(), _this4.shouldRenderSkipButtons() && _this4.renderSkipButtons(), _this4.shouldRenderVolume() && _this4.renderVolume()), /*#__PURE__*/React.createElement(RightControls, null, _this4.shouldRenderCurrentTime() && _this4.renderCurrentTime(), _this4.shouldRenderCaptionsControls() && _this4.renderCaptionsControls(), _this4.shouldRenderSpeedControls() && _this4.renderSpeedControls(), _this4.
|
|
893
|
+
}, /*#__PURE__*/React.createElement(LeftControls, null, _this4.shouldRenderPlayPauseButton() && _this4.renderPlayPauseButton(), _this4.shouldRenderSkipButtons() && _this4.renderSkipButtons(), _this4.shouldRenderVolume() && _this4.renderVolume()), /*#__PURE__*/React.createElement(RightControls, null, _this4.shouldRenderCurrentTime() && _this4.renderCurrentTime(), _this4.shouldRenderCaptionsControls() && _this4.renderCaptionsControls(), _this4.shouldRenderSpeedControls() && _this4.renderSpeedControls(), _this4.shouldRenderDownloadButton() && _this4.renderDownloadButton(), _this4.shouldRenderFullScreenButton() && _this4.renderFullScreenButton(), _this4.shouldRenderCaptionsAdminControls() && _this4.renderCaptionsAdminControls()))));
|
|
920
894
|
}));
|
|
921
895
|
}
|
|
922
896
|
}]);
|
|
@@ -11,7 +11,6 @@ export interface CustomMediaPlayerProps extends WithPlaybackProps, WithShowContr
|
|
|
11
11
|
readonly type: CustomMediaPlayerType;
|
|
12
12
|
readonly src: string;
|
|
13
13
|
readonly fileId?: string;
|
|
14
|
-
readonly onHDToggleClick?: () => void;
|
|
15
14
|
readonly isShortcutEnabled?: boolean;
|
|
16
15
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
17
16
|
readonly onCanPlay?: () => void;
|
|
@@ -48,7 +47,6 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
|
|
|
48
47
|
private getDefaultTime;
|
|
49
48
|
private onCurrentTimeChange;
|
|
50
49
|
private renderCurrentTime;
|
|
51
|
-
private renderHDButton;
|
|
52
50
|
private onPlaybackSpeedChange;
|
|
53
51
|
private renderSpeedControls;
|
|
54
52
|
private renderVolume;
|
|
@@ -10,7 +10,6 @@ export interface MediaPlayerProps extends WithPlaybackProps, WithShowControlMeth
|
|
|
10
10
|
readonly type: CustomMediaPlayerType;
|
|
11
11
|
readonly src: string;
|
|
12
12
|
readonly identifier: FileIdentifier;
|
|
13
|
-
readonly onHDToggleClick?: () => void;
|
|
14
13
|
readonly isShortcutEnabled?: boolean;
|
|
15
14
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
16
15
|
readonly onCanPlay?: () => void;
|
|
@@ -11,7 +11,6 @@ export interface CustomMediaPlayerProps extends WithPlaybackProps, WithShowContr
|
|
|
11
11
|
readonly type: CustomMediaPlayerType;
|
|
12
12
|
readonly src: string;
|
|
13
13
|
readonly fileId?: string;
|
|
14
|
-
readonly onHDToggleClick?: () => void;
|
|
15
14
|
readonly isShortcutEnabled?: boolean;
|
|
16
15
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
17
16
|
readonly onCanPlay?: () => void;
|
|
@@ -48,7 +47,6 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
|
|
|
48
47
|
private getDefaultTime;
|
|
49
48
|
private onCurrentTimeChange;
|
|
50
49
|
private renderCurrentTime;
|
|
51
|
-
private renderHDButton;
|
|
52
50
|
private onPlaybackSpeedChange;
|
|
53
51
|
private renderSpeedControls;
|
|
54
52
|
private renderVolume;
|
|
@@ -10,7 +10,6 @@ export interface MediaPlayerProps extends WithPlaybackProps, WithShowControlMeth
|
|
|
10
10
|
readonly type: CustomMediaPlayerType;
|
|
11
11
|
readonly src: string;
|
|
12
12
|
readonly identifier: FileIdentifier;
|
|
13
|
-
readonly onHDToggleClick?: () => void;
|
|
14
13
|
readonly isShortcutEnabled?: boolean;
|
|
15
14
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
16
15
|
readonly onCanPlay?: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-ui",
|
|
3
|
-
"version": "28.7.
|
|
3
|
+
"version": "28.7.29",
|
|
4
4
|
"description": "Includes common components and utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,9 +30,8 @@
|
|
|
30
30
|
"@atlaskit/css": "^0.19.0",
|
|
31
31
|
"@atlaskit/flag": "^17.8.0",
|
|
32
32
|
"@atlaskit/form": "^15.3.0",
|
|
33
|
-
"@atlaskit/icon": "^
|
|
33
|
+
"@atlaskit/icon": "^31.0.0",
|
|
34
34
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
35
|
-
"@atlaskit/icon-lab": "^5.15.0",
|
|
36
35
|
"@atlaskit/locale": "^3.0.0",
|
|
37
36
|
"@atlaskit/media-client": "^35.7.0",
|
|
38
37
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
@@ -42,7 +41,7 @@
|
|
|
42
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
43
42
|
"@atlaskit/primitives": "^18.0.0",
|
|
44
43
|
"@atlaskit/range": "^9.3.0",
|
|
45
|
-
"@atlaskit/react-ufo": "^5.
|
|
44
|
+
"@atlaskit/react-ufo": "^5.2.0",
|
|
46
45
|
"@atlaskit/select": "^21.7.0",
|
|
47
46
|
"@atlaskit/spinner": "^19.0.0",
|
|
48
47
|
"@atlaskit/theme": "^21.0.0",
|
|
@@ -69,7 +68,7 @@
|
|
|
69
68
|
"@atlaskit/analytics-listeners": "^9.3.0",
|
|
70
69
|
"@atlaskit/media-test-data": "^3.2.0",
|
|
71
70
|
"@atlaskit/ssr": "workspace:^",
|
|
72
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
71
|
+
"@atlassian/a11y-jest-testing": "^0.10.0",
|
|
73
72
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
74
73
|
"@testing-library/jest-dom": "^6.4.5",
|
|
75
74
|
"@testing-library/react": "^16.3.0",
|
|
@@ -87,9 +86,6 @@
|
|
|
87
86
|
"wait-for-expect": "^1.2.0"
|
|
88
87
|
},
|
|
89
88
|
"platform-feature-flags": {
|
|
90
|
-
"platform_media_disable_video_640p_artifact_usage": {
|
|
91
|
-
"type": "boolean"
|
|
92
|
-
},
|
|
93
89
|
"platform_media_resume_video_on_token_expiry": {
|
|
94
90
|
"type": "boolean"
|
|
95
91
|
},
|