@atlaskit/media-ui 28.2.0 → 28.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/customMediaPlayer/index-compiled.js +67 -43
  3. package/dist/cjs/customMediaPlayer/index-emotion.js +64 -43
  4. package/dist/cjs/customMediaPlayer/index.js +1 -1
  5. package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
  6. package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +69 -52
  7. package/dist/cjs/customMediaPlayer/react-video-renderer/video.js +4 -2
  8. package/dist/es2019/customMediaPlayer/index-compiled.js +28 -5
  9. package/dist/es2019/customMediaPlayer/index-emotion.js +26 -5
  10. package/dist/es2019/customMediaPlayer/index.js +1 -1
  11. package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
  12. package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +21 -4
  13. package/dist/es2019/customMediaPlayer/react-video-renderer/video.js +2 -2
  14. package/dist/esm/customMediaPlayer/index-compiled.js +67 -43
  15. package/dist/esm/customMediaPlayer/index-emotion.js +65 -43
  16. package/dist/esm/customMediaPlayer/index.js +1 -1
  17. package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
  18. package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +69 -52
  19. package/dist/esm/customMediaPlayer/react-video-renderer/video.js +4 -2
  20. package/dist/types/customMediaPlayer/index-compiled.d.ts +4 -0
  21. package/dist/types/customMediaPlayer/index-emotion.d.ts +1 -0
  22. package/dist/types/customMediaPlayer/mediaPlayer/mediaPlayerBase.d.ts +3 -0
  23. package/dist/types/customMediaPlayer/react-video-renderer/video.d.ts +7 -2
  24. package/dist/types-ts4.5/customMediaPlayer/index-compiled.d.ts +4 -0
  25. package/dist/types-ts4.5/customMediaPlayer/index-emotion.d.ts +1 -0
  26. package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/mediaPlayerBase.d.ts +3 -0
  27. package/dist/types-ts4.5/customMediaPlayer/react-video-renderer/video.d.ts +7 -2
  28. package/package.json +8 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @atlaskit/media-ui
2
2
 
3
+ ## 28.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#134528](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134528)
8
+ [`61165836daa36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/61165836daa36) -
9
+ [ux] Use latest media token on video resume or seek
10
+
11
+ Previously when resuming a video after the current token had expired the video player would fail
12
+ to load and would show an error boundary page.
13
+
14
+ The same bug would occur when seeking to a new `currentTime` after the token expired.
15
+
16
+ Now both the dedicated and inline player will update their `src` to a new URL with the latest
17
+ cached token.
18
+
19
+ - Updated dependencies
20
+
21
+ ## 28.2.1
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+
3
27
  ## 28.2.0
4
28
 
5
29
  ### Minor Changes
@@ -138,13 +138,22 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
138
138
  }
139
139
  });
140
140
  (0, _defineProperty2.default)(_this, "onTimeChanged", function () {
141
+ var _this$props3, _this$props3$onTimeCh;
141
142
  _this.createAndFireUIEvent('timeRangeNavigate', 'time');
143
+ (_this$props3 = _this.props) === null || _this$props3 === void 0 || (_this$props3$onTimeCh = _this$props3.onTimeChanged) === null || _this$props3$onTimeCh === void 0 || _this$props3$onTimeCh.call(_this$props3);
142
144
  });
143
145
  (0, _defineProperty2.default)(_this, "onVolumeChanged", function () {
144
146
  _this.createAndFireUIEvent('volumeRangeNavigate', 'volume');
145
147
  });
148
+ (0, _defineProperty2.default)(_this, "getDefaultTime", function () {
149
+ return _this.timeSaver.defaultTime;
150
+ });
146
151
  (0, _defineProperty2.default)(_this, "onCurrentTimeChange", function (currentTime, duration) {
147
- if (duration - currentTime > MINIMUM_DURATION_BEFORE_SAVING_TIME) {
152
+ // We rely on the saved time when switching to the new source URL
153
+ // so we need to save it irrespective of elapsed time or video length
154
+ if ((0, _platformFeatureFlags.fg)('platform_media_resume_video_on_token_expiry')) {
155
+ _this.timeSaver.defaultTime = currentTime;
156
+ } else if (duration - currentTime > MINIMUM_DURATION_BEFORE_SAVING_TIME) {
148
157
  _this.timeSaver.defaultTime = currentTime;
149
158
  } else {
150
159
  _this.timeSaver.defaultTime = 0;
@@ -158,11 +167,11 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
158
167
  }, (0, _formatDuration.formatDuration)(currentTime), " / ", (0, _formatDuration.formatDuration)(duration));
159
168
  });
160
169
  (0, _defineProperty2.default)(_this, "renderHDButton", function () {
161
- var _this$props3 = _this.props,
162
- type = _this$props3.type,
163
- isHDAvailable = _this$props3.isHDAvailable,
164
- isHDActive = _this$props3.isHDActive,
165
- onHDToggleClick = _this$props3.onHDToggleClick;
170
+ var _this$props4 = _this.props,
171
+ type = _this$props4.type,
172
+ isHDAvailable = _this$props4.isHDAvailable,
173
+ isHDActive = _this$props4.isHDActive,
174
+ onHDToggleClick = _this$props4.onHDToggleClick;
166
175
  if (type === 'audio' || !isHDAvailable) {
167
176
  return;
168
177
  }
@@ -244,9 +253,9 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
244
253
  }
245
254
  });
246
255
  (0, _defineProperty2.default)(_this, "renderFullScreenButton", function () {
247
- var _this$props4 = _this.props,
248
- formatMessage = _this$props4.intl.formatMessage,
249
- type = _this$props4.type;
256
+ var _this$props5 = _this.props,
257
+ formatMessage = _this$props5.intl.formatMessage,
258
+ type = _this$props5.type;
250
259
  if (type === 'audio') {
251
260
  return;
252
261
  }
@@ -372,12 +381,16 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
372
381
  }));
373
382
  });
374
383
  (0, _defineProperty2.default)(_this, "pause", function () {
384
+ var _this$props6, _this$props6$onPause;
375
385
  if (_this.actions) {
376
386
  _this.actions.pause();
377
387
  }
388
+ (_this$props6 = _this.props) === null || _this$props6 === void 0 || (_this$props6$onPause = _this$props6.onPause) === null || _this$props6$onPause === void 0 || _this$props6$onPause.call(_this$props6);
378
389
  });
379
390
  (0, _defineProperty2.default)(_this, "play", function () {
380
- var onFirstPlay = _this.props.onFirstPlay;
391
+ var _this$props7 = _this.props,
392
+ onFirstPlay = _this$props7.onFirstPlay,
393
+ onPlay = _this$props7.onPlay;
381
394
  if (_this.actions) {
382
395
  _this.actions.play();
383
396
  }
@@ -387,6 +400,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
387
400
  _this.wasPlayedOnce = true;
388
401
  onFirstPlay();
389
402
  }
403
+ onPlay === null || onPlay === void 0 || onPlay();
390
404
  });
391
405
  (0, _defineProperty2.default)(_this, "getMediaButtonClickHandler", function (action, buttonType) {
392
406
  return function () {
@@ -405,13 +419,13 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
405
419
  };
406
420
  });
407
421
  (0, _defineProperty2.default)(_this, "onViewed", function (videoState) {
408
- var _this$props5 = _this.props,
409
- createAnalyticsEvent = _this$props5.createAnalyticsEvent,
410
- fileId = _this$props5.fileId,
411
- isAutoPlay = _this$props5.isAutoPlay,
412
- isHDAvailable = _this$props5.isHDAvailable,
413
- isHDActive = _this$props5.isHDActive,
414
- type = _this$props5.type;
422
+ var _this$props8 = _this.props,
423
+ createAnalyticsEvent = _this$props8.createAnalyticsEvent,
424
+ fileId = _this$props8.fileId,
425
+ isAutoPlay = _this$props8.isAutoPlay,
426
+ isHDAvailable = _this$props8.isHDAvailable,
427
+ isHDActive = _this$props8.isHDActive,
428
+ type = _this$props8.type;
415
429
  var _this$state2 = _this.state,
416
430
  isFullScreenEnabled = _this$state2.isFullScreenEnabled,
417
431
  playerSize = _this$state2.playerSize,
@@ -461,14 +475,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
461
475
  return (0, _createClass2.default)(CustomMediaPlayerBase, [{
462
476
  key: "componentDidMount",
463
477
  value: function componentDidMount() {
464
- var _this$props6 = this.props,
465
- type = _this$props6.type,
466
- fileId = _this$props6.fileId,
467
- isAutoPlay = _this$props6.isAutoPlay,
468
- isHDAvailable = _this$props6.isHDAvailable,
469
- isHDActive = _this$props6.isHDActive,
470
- onFirstPlay = _this$props6.onFirstPlay,
471
- createAnalyticsEvent = _this$props6.createAnalyticsEvent;
478
+ var _this$props9 = this.props,
479
+ type = _this$props9.type,
480
+ fileId = _this$props9.fileId,
481
+ isAutoPlay = _this$props9.isAutoPlay,
482
+ isHDAvailable = _this$props9.isHDAvailable,
483
+ isHDActive = _this$props9.isHDActive,
484
+ onFirstPlay = _this$props9.onFirstPlay,
485
+ createAnalyticsEvent = _this$props9.createAnalyticsEvent;
472
486
  var _this$state3 = this.state,
473
487
  isFullScreenEnabled = _this$state3.isFullScreenEnabled,
474
488
  playerSize = _this$state3.playerSize,
@@ -486,12 +500,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
486
500
  }
487
501
  _simultaneousPlayManager.default.subscribe(this);
488
502
  if (isAutoPlay) {
503
+ var _this$props10, _this$props10$onPlay;
489
504
  _simultaneousPlayManager.default.pauseOthers(this);
490
505
  if (onFirstPlay) {
491
506
  this.fireFirstPlayedTrackEvent();
492
507
  this.wasPlayedOnce = true;
493
508
  onFirstPlay();
494
509
  }
510
+ (_this$props10 = this.props) === null || _this$props10 === void 0 || (_this$props10$onPlay = _this$props10.onPlay) === null || _this$props10$onPlay === void 0 || _this$props10$onPlay.call(_this$props10);
495
511
  }
496
512
  }
497
513
  }, {
@@ -501,8 +517,8 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
501
517
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
502
518
  }
503
519
  if (this.state.isFullScreenEnabled) {
504
- var _this$props$onFullscr2, _this$props7;
505
- (_this$props$onFullscr2 = (_this$props7 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props7, false);
520
+ var _this$props$onFullscr2, _this$props11;
521
+ (_this$props$onFullscr2 = (_this$props11 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props11, false);
506
522
  }
507
523
  _simultaneousPlayManager.default.unsubscribe(this);
508
524
  }
@@ -518,13 +534,13 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
518
534
  }, {
519
535
  key: "createAndFireUIEvent",
520
536
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
521
- var _this$props8 = this.props,
522
- type = _this$props8.type,
523
- fileId = _this$props8.fileId,
524
- isHDActive = _this$props8.isHDActive,
525
- isHDAvailable = _this$props8.isHDAvailable,
526
- isAutoPlay = _this$props8.isAutoPlay,
527
- createAnalyticsEvent = _this$props8.createAnalyticsEvent;
537
+ var _this$props12 = this.props,
538
+ type = _this$props12.type,
539
+ fileId = _this$props12.fileId,
540
+ isHDActive = _this$props12.isHDActive,
541
+ isHDAvailable = _this$props12.isHDAvailable,
542
+ isAutoPlay = _this$props12.isAutoPlay,
543
+ createAnalyticsEvent = _this$props12.createAnalyticsEvent;
528
544
  var _this$state4 = this.state,
529
545
  isFullScreenEnabled = _this$state4.isFullScreenEnabled,
530
546
  playerSize = _this$state4.playerSize,
@@ -571,14 +587,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
571
587
  key: "render",
572
588
  value: function render() {
573
589
  var _this2 = this;
574
- var _this$props9 = this.props,
575
- type = _this$props9.type,
576
- src = _this$props9.src,
577
- isAutoPlay = _this$props9.isAutoPlay,
578
- onCanPlay = _this$props9.onCanPlay,
579
- onError = _this$props9.onError,
580
- poster = _this$props9.poster,
581
- videoControlsWrapperRef = _this$props9.videoControlsWrapperRef;
590
+ var _this$props13 = this.props,
591
+ type = _this$props13.type,
592
+ src = _this$props13.src,
593
+ isAutoPlay = _this$props13.isAutoPlay,
594
+ onCanPlay = _this$props13.onCanPlay,
595
+ onError = _this$props13.onError,
596
+ poster = _this$props13.poster,
597
+ videoControlsWrapperRef = _this$props13.videoControlsWrapperRef;
582
598
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
583
599
  xcss: customVideoWrapperStyles.root,
584
600
  ref: this.videoWrapperRef,
@@ -588,7 +604,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
588
604
  src: src,
589
605
  autoPlay: isAutoPlay,
590
606
  onCanPlay: onCanPlay,
591
- defaultTime: this.timeSaver.defaultTime,
607
+ defaultTime: this.getDefaultTime,
592
608
  onTimeChange: this.onCurrentTimeChange,
593
609
  onError: onError,
594
610
  poster: poster
@@ -611,11 +627,19 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
611
627
  var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSkipAmount;
612
628
  var newTime = videoState.currentTime - skipAmount;
613
629
  actions.navigate(Math.max(newTime, 0));
630
+ if ((0, _platformFeatureFlags.fg)('platform_media_resume_video_on_token_expiry')) {
631
+ var _this2$props, _this2$props$onTimeCh;
632
+ (_this2$props = _this2.props) === null || _this2$props === void 0 || (_this2$props$onTimeCh = _this2$props.onTimeChanged) === null || _this2$props$onTimeCh === void 0 || _this2$props$onTimeCh.call(_this2$props);
633
+ }
614
634
  };
615
635
  var skipForward = function skipForward() {
616
636
  var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSkipAmount;
617
637
  var newTime = videoState.currentTime + skipAmount;
618
638
  actions.navigate(Math.min(newTime, videoState.duration));
639
+ if ((0, _platformFeatureFlags.fg)('platform_media_resume_video_on_token_expiry')) {
640
+ var _this2$props2, _this2$props2$onTimeC;
641
+ (_this2$props2 = _this2.props) === null || _this2$props2 === void 0 || (_this2$props2$onTimeC = _this2$props2.onTimeChanged) === null || _this2$props2$onTimeC === void 0 || _this2$props2$onTimeC.call(_this2$props2);
642
+ }
619
643
  };
620
644
  var shortcuts = _this2.renderShortcuts({
621
645
  togglePlayPauseAction: isPlaying ? _this2.pause : _this2.play,
@@ -52,6 +52,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
52
52
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
53
53
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */ // Keep media player components used in media-viewer to use static colors from the new color palette to
54
54
  // support the hybrid theming in media viewer https://product-fabric.atlassian.net/browse/DSP-6067
55
+ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives
55
56
  var MEDIUM_VIDEO_MAX_WIDTH = 400;
56
57
  var SMALL_VIDEO_MAX_WIDTH = 160;
57
58
  var MINIMUM_DURATION_BEFORE_SAVING_TIME = 60;
@@ -147,18 +148,27 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
147
148
  }
148
149
  });
149
150
  (0, _defineProperty2.default)(_this, "onTimeChanged", function () {
151
+ var _this$props3, _this$props3$onTimeCh;
150
152
  _this.createAndFireUIEvent('timeRangeNavigate', 'time');
153
+ (_this$props3 = _this.props) === null || _this$props3 === void 0 || (_this$props3$onTimeCh = _this$props3.onTimeChanged) === null || _this$props3$onTimeCh === void 0 || _this$props3$onTimeCh.call(_this$props3);
151
154
  });
152
155
  (0, _defineProperty2.default)(_this, "onVolumeChanged", function () {
153
156
  _this.createAndFireUIEvent('volumeRangeNavigate', 'volume');
154
157
  });
155
158
  (0, _defineProperty2.default)(_this, "onCurrentTimeChange", function (currentTime, duration) {
156
- if (duration - currentTime > MINIMUM_DURATION_BEFORE_SAVING_TIME) {
159
+ // We rely on the saved time when switching to the new source URL
160
+ // so we need to save it irrespective of elapsed time or video length
161
+ if ((0, _platformFeatureFlags.fg)('platform_media_resume_video_on_token_expiry')) {
162
+ _this.timeSaver.defaultTime = currentTime;
163
+ } else if (duration - currentTime > MINIMUM_DURATION_BEFORE_SAVING_TIME) {
157
164
  _this.timeSaver.defaultTime = currentTime;
158
165
  } else {
159
166
  _this.timeSaver.defaultTime = 0;
160
167
  }
161
168
  });
169
+ (0, _defineProperty2.default)(_this, "getDefaultTime", function () {
170
+ return _this.timeSaver.defaultTime;
171
+ });
162
172
  (0, _defineProperty2.default)(_this, "renderCurrentTime", function (_ref) {
163
173
  var currentTime = _ref.currentTime,
164
174
  duration = _ref.duration;
@@ -167,11 +177,11 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
167
177
  }, (0, _formatDuration.formatDuration)(currentTime), " / ", (0, _formatDuration.formatDuration)(duration));
168
178
  });
169
179
  (0, _defineProperty2.default)(_this, "renderHDButton", function () {
170
- var _this$props3 = _this.props,
171
- type = _this$props3.type,
172
- isHDAvailable = _this$props3.isHDAvailable,
173
- isHDActive = _this$props3.isHDActive,
174
- onHDToggleClick = _this$props3.onHDToggleClick;
180
+ var _this$props4 = _this.props,
181
+ type = _this$props4.type,
182
+ isHDAvailable = _this$props4.isHDAvailable,
183
+ isHDActive = _this$props4.isHDActive,
184
+ onHDToggleClick = _this$props4.onHDToggleClick;
175
185
  if (type === 'audio' || !isHDAvailable) {
176
186
  return;
177
187
  }
@@ -253,9 +263,9 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
253
263
  }
254
264
  });
255
265
  (0, _defineProperty2.default)(_this, "renderFullScreenButton", function () {
256
- var _this$props4 = _this.props,
257
- formatMessage = _this$props4.intl.formatMessage,
258
- type = _this$props4.type;
266
+ var _this$props5 = _this.props,
267
+ formatMessage = _this$props5.intl.formatMessage,
268
+ type = _this$props5.type;
259
269
  if (type === 'audio') {
260
270
  return;
261
271
  }
@@ -381,12 +391,16 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
381
391
  }));
382
392
  });
383
393
  (0, _defineProperty2.default)(_this, "pause", function () {
394
+ var _this$props6, _this$props6$onPause;
384
395
  if (_this.actions) {
385
396
  _this.actions.pause();
386
397
  }
398
+ (_this$props6 = _this.props) === null || _this$props6 === void 0 || (_this$props6$onPause = _this$props6.onPause) === null || _this$props6$onPause === void 0 || _this$props6$onPause.call(_this$props6);
387
399
  });
388
400
  (0, _defineProperty2.default)(_this, "play", function () {
389
- var onFirstPlay = _this.props.onFirstPlay;
401
+ var _this$props7 = _this.props,
402
+ onFirstPlay = _this$props7.onFirstPlay,
403
+ onPlay = _this$props7.onPlay;
390
404
  if (_this.actions) {
391
405
  _this.actions.play();
392
406
  }
@@ -396,6 +410,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
396
410
  _this.wasPlayedOnce = true;
397
411
  onFirstPlay();
398
412
  }
413
+ onPlay === null || onPlay === void 0 || onPlay();
399
414
  });
400
415
  (0, _defineProperty2.default)(_this, "getMediaButtonClickHandler", function (action, buttonType) {
401
416
  return function () {
@@ -414,13 +429,13 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
414
429
  };
415
430
  });
416
431
  (0, _defineProperty2.default)(_this, "onViewed", function (videoState) {
417
- var _this$props5 = _this.props,
418
- createAnalyticsEvent = _this$props5.createAnalyticsEvent,
419
- fileId = _this$props5.fileId,
420
- isAutoPlay = _this$props5.isAutoPlay,
421
- isHDAvailable = _this$props5.isHDAvailable,
422
- isHDActive = _this$props5.isHDActive,
423
- type = _this$props5.type;
432
+ var _this$props8 = _this.props,
433
+ createAnalyticsEvent = _this$props8.createAnalyticsEvent,
434
+ fileId = _this$props8.fileId,
435
+ isAutoPlay = _this$props8.isAutoPlay,
436
+ isHDAvailable = _this$props8.isHDAvailable,
437
+ isHDActive = _this$props8.isHDActive,
438
+ type = _this$props8.type;
424
439
  var _this$state2 = _this.state,
425
440
  isFullScreenEnabled = _this$state2.isFullScreenEnabled,
426
441
  playerSize = _this$state2.playerSize,
@@ -470,14 +485,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
470
485
  return (0, _createClass2.default)(CustomMediaPlayerBase, [{
471
486
  key: "componentDidMount",
472
487
  value: function componentDidMount() {
473
- var _this$props6 = this.props,
474
- type = _this$props6.type,
475
- fileId = _this$props6.fileId,
476
- isAutoPlay = _this$props6.isAutoPlay,
477
- isHDAvailable = _this$props6.isHDAvailable,
478
- isHDActive = _this$props6.isHDActive,
479
- onFirstPlay = _this$props6.onFirstPlay,
480
- createAnalyticsEvent = _this$props6.createAnalyticsEvent;
488
+ var _this$props9 = this.props,
489
+ type = _this$props9.type,
490
+ fileId = _this$props9.fileId,
491
+ isAutoPlay = _this$props9.isAutoPlay,
492
+ isHDAvailable = _this$props9.isHDAvailable,
493
+ isHDActive = _this$props9.isHDActive,
494
+ onFirstPlay = _this$props9.onFirstPlay,
495
+ createAnalyticsEvent = _this$props9.createAnalyticsEvent;
481
496
  var _this$state3 = this.state,
482
497
  isFullScreenEnabled = _this$state3.isFullScreenEnabled,
483
498
  playerSize = _this$state3.playerSize,
@@ -495,12 +510,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
495
510
  }
496
511
  _simultaneousPlayManager.default.subscribe(this);
497
512
  if (isAutoPlay) {
513
+ var _this$props10, _this$props10$onPlay;
498
514
  _simultaneousPlayManager.default.pauseOthers(this);
499
515
  if (onFirstPlay) {
500
516
  this.fireFirstPlayedTrackEvent();
501
517
  this.wasPlayedOnce = true;
502
518
  onFirstPlay();
503
519
  }
520
+ (_this$props10 = this.props) === null || _this$props10 === void 0 || (_this$props10$onPlay = _this$props10.onPlay) === null || _this$props10$onPlay === void 0 || _this$props10$onPlay.call(_this$props10);
504
521
  }
505
522
  }
506
523
  }, {
@@ -510,8 +527,8 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
510
527
  this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
511
528
  }
512
529
  if (this.state.isFullScreenEnabled) {
513
- var _this$props$onFullscr2, _this$props7;
514
- (_this$props$onFullscr2 = (_this$props7 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props7, false);
530
+ var _this$props$onFullscr2, _this$props11;
531
+ (_this$props$onFullscr2 = (_this$props11 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props11, false);
515
532
  }
516
533
  _simultaneousPlayManager.default.unsubscribe(this);
517
534
  }
@@ -527,13 +544,13 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
527
544
  }, {
528
545
  key: "createAndFireUIEvent",
529
546
  value: function createAndFireUIEvent(eventType, actionSubjectId) {
530
- var _this$props8 = this.props,
531
- type = _this$props8.type,
532
- fileId = _this$props8.fileId,
533
- isHDActive = _this$props8.isHDActive,
534
- isHDAvailable = _this$props8.isHDAvailable,
535
- isAutoPlay = _this$props8.isAutoPlay,
536
- createAnalyticsEvent = _this$props8.createAnalyticsEvent;
547
+ var _this$props12 = this.props,
548
+ type = _this$props12.type,
549
+ fileId = _this$props12.fileId,
550
+ isHDActive = _this$props12.isHDActive,
551
+ isHDAvailable = _this$props12.isHDAvailable,
552
+ isAutoPlay = _this$props12.isAutoPlay,
553
+ createAnalyticsEvent = _this$props12.createAnalyticsEvent;
537
554
  var _this$state4 = this.state,
538
555
  isFullScreenEnabled = _this$state4.isFullScreenEnabled,
539
556
  playerSize = _this$state4.playerSize,
@@ -580,14 +597,14 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
580
597
  key: "render",
581
598
  value: function render() {
582
599
  var _this2 = this;
583
- var _this$props9 = this.props,
584
- type = _this$props9.type,
585
- src = _this$props9.src,
586
- isAutoPlay = _this$props9.isAutoPlay,
587
- onCanPlay = _this$props9.onCanPlay,
588
- onError = _this$props9.onError,
589
- poster = _this$props9.poster,
590
- videoControlsWrapperRef = _this$props9.videoControlsWrapperRef;
600
+ var _this$props13 = this.props,
601
+ type = _this$props13.type,
602
+ src = _this$props13.src,
603
+ isAutoPlay = _this$props13.isAutoPlay,
604
+ onCanPlay = _this$props13.onCanPlay,
605
+ onError = _this$props13.onError,
606
+ poster = _this$props13.poster,
607
+ videoControlsWrapperRef = _this$props13.videoControlsWrapperRef;
591
608
  return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
592
609
  xcss: customVideoWrapperStyles,
593
610
  ref: this.videoWrapperRef,
@@ -597,7 +614,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
597
614
  src: src,
598
615
  autoPlay: isAutoPlay,
599
616
  onCanPlay: onCanPlay,
600
- defaultTime: this.timeSaver.defaultTime,
617
+ defaultTime: this.getDefaultTime,
601
618
  onTimeChange: this.onCurrentTimeChange,
602
619
  onError: onError,
603
620
  poster: poster
@@ -617,14 +634,18 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = /*#__PURE__*/functio
617
634
  var isMediumPlayer = playerSize === 'medium';
618
635
  var defaultSkipAmount = 10;
619
636
  var skipBackward = function skipBackward() {
637
+ var _this2$props, _this2$props$onTimeCh;
620
638
  var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSkipAmount;
621
639
  var newTime = videoState.currentTime - skipAmount;
622
640
  actions.navigate(Math.max(newTime, 0));
641
+ (_this2$props = _this2.props) === null || _this2$props === void 0 || (_this2$props$onTimeCh = _this2$props.onTimeChanged) === null || _this2$props$onTimeCh === void 0 || _this2$props$onTimeCh.call(_this2$props);
623
642
  };
624
643
  var skipForward = function skipForward() {
644
+ var _this2$props2, _this2$props2$onTimeC;
625
645
  var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSkipAmount;
626
646
  var newTime = videoState.currentTime + skipAmount;
627
647
  actions.navigate(Math.min(newTime, videoState.duration));
648
+ (_this2$props2 = _this2.props) === null || _this2$props2 === void 0 || (_this2$props2$onTimeC = _this2$props2.onTimeChanged) === null || _this2$props2$onTimeC === void 0 || _this2$props2$onTimeC.call(_this2$props2);
628
649
  };
629
650
  var shortcuts = _this2.renderShortcuts({
630
651
  togglePlayPauseAction: isPlaying ? _this2.pause : _this2.play,
@@ -16,7 +16,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = function CustomMedia
16
16
  return (0, _platformFeatureFlags.fg)('platform_media_compiled') ? /*#__PURE__*/_react.default.createElement(_indexCompiled.CustomMediaPlayerBase, props) : /*#__PURE__*/_react.default.createElement(_indexEmotion.CustomMediaPlayerBase, props);
17
17
  };
18
18
  var packageName = "@atlaskit/media-ui";
19
- var packageVersion = "28.2.0";
19
+ var packageVersion = "28.2.2";
20
20
 
21
21
  // @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
22
22
  var CustomMediaPlayer = exports.CustomMediaPlayer = (0, _mediaCommon.withMediaAnalyticsContext)({
@@ -12,7 +12,7 @@ var _mediaClientReact = require("@atlaskit/media-client-react");
12
12
  var _mediaPlayerBase = require("./mediaPlayerBase");
13
13
  var _useTextTracks = require("./useTextTracks");
14
14
  var packageName = "@atlaskit/media-ui";
15
- var packageVersion = "28.2.0";
15
+ var packageVersion = "28.2.2";
16
16
  var MediaPlayerBaseWithContext = (0, _mediaCommon.withMediaAnalyticsContext)({
17
17
  packageVersion: packageVersion,
18
18
  packageName: packageName,