@atlaskit/media-ui 28.2.1 → 28.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/cjs/MediaInlineCard/Frame/styled-compiled.js +1 -2
- package/dist/cjs/MediaInlineCard/Icon-compiled.js +1 -2
- package/dist/cjs/MediaInlineCard/IconAndTitleLayout/styled-compiled.js +1 -2
- package/dist/cjs/MediaInlineCard/LoadingView/styled-compiled.js +1 -2
- package/dist/cjs/MediaInlineCard/styled-compiled.js +1 -2
- package/dist/cjs/abuseModal/abuseModal.js +1 -2
- package/dist/cjs/customMediaPlayer/index-compiled.js +75 -47
- package/dist/cjs/customMediaPlayer/index-emotion.js +73 -48
- package/dist/cjs/customMediaPlayer/index.js +1 -1
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captions/uploadForm.js +1 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/captionsUploaderBrowser.js +1 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/captions/artifactUploader/filePickers/browser.js +1 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/captionsAdminControls.js +1 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/captionsSelectControls.js +1 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +70 -54
- package/dist/cjs/customMediaPlayer/playbackSpeedControls.js +1 -2
- package/dist/cjs/customMediaPlayer/react-video-renderer/track.js +1 -2
- package/dist/cjs/customMediaPlayer/react-video-renderer/video.js +5 -4
- package/dist/cjs/customMediaPlayer/styled-compiled.js +30 -31
- package/dist/cjs/customMediaPlayer/styled.js +1 -2
- package/dist/cjs/customMediaPlayer/timeRange.js +1 -2
- package/dist/cjs/customMediaPlayer/volumeRange.js +5 -4
- package/dist/cjs/ellipsify-compiled.js +1 -2
- package/dist/cjs/ellipsify-emotion.js +1 -2
- package/dist/cjs/humanReadableSize.js +1 -2
- package/dist/cjs/imageMetaData/parseJPEG.js +1 -2
- package/dist/cjs/imageMetaData/parsePNG.js +1 -2
- package/dist/cjs/inactivityDetector/inactivityDetector.js +1 -2
- package/dist/cjs/inactivityDetector/styled-compiled.js +1 -2
- package/dist/cjs/inactivityDetector/styled.js +1 -2
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/locales.js +1 -2
- package/dist/cjs/media-type-icon-compiled.js +16 -16
- package/dist/cjs/media-type-icon-emotion.js +6 -6
- package/dist/cjs/mediaImage/index.js +8 -4
- package/dist/cjs/mime-type-icon.js +1 -2
- package/dist/cjs/modalSpinner-compiled.js +1 -2
- package/dist/cjs/modalSpinner.js +1 -2
- package/dist/cjs/truncateText-compiled.js +1 -2
- package/dist/cjs/util.js +12 -12
- package/dist/es2019/customMediaPlayer/index-compiled.js +35 -7
- package/dist/es2019/customMediaPlayer/index-emotion.js +34 -8
- package/dist/es2019/customMediaPlayer/index.js +1 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +21 -4
- package/dist/es2019/customMediaPlayer/react-video-renderer/video.js +2 -2
- package/dist/es2019/customMediaPlayer/volumeRange.js +4 -2
- package/dist/es2019/mediaImage/index.js +7 -2
- package/dist/esm/customMediaPlayer/index-compiled.js +74 -45
- package/dist/esm/customMediaPlayer/index-emotion.js +73 -46
- package/dist/esm/customMediaPlayer/index.js +1 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +69 -52
- package/dist/esm/customMediaPlayer/react-video-renderer/video.js +4 -2
- package/dist/esm/customMediaPlayer/styled-compiled.js +29 -29
- package/dist/esm/customMediaPlayer/volumeRange.js +4 -2
- package/dist/esm/mediaImage/index.js +7 -2
- package/dist/types/customMediaPlayer/index-compiled.d.ts +4 -0
- package/dist/types/customMediaPlayer/index-emotion.d.ts +1 -0
- package/dist/types/customMediaPlayer/mediaPlayer/mediaPlayerBase.d.ts +3 -0
- package/dist/types/customMediaPlayer/react-video-renderer/video.d.ts +7 -2
- package/dist/types-ts4.5/customMediaPlayer/index-compiled.d.ts +4 -0
- package/dist/types-ts4.5/customMediaPlayer/index-emotion.d.ts +1 -0
- package/dist/types-ts4.5/customMediaPlayer/mediaPlayer/mediaPlayerBase.d.ts +3 -0
- package/dist/types-ts4.5/customMediaPlayer/react-video-renderer/video.d.ts +7 -2
- package/package.json +10 -4
|
@@ -151,13 +151,22 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
_defineProperty(_this, "onTimeChanged", function () {
|
|
154
|
+
var _this$props$onTimeCha, _this$props3;
|
|
154
155
|
_this.createAndFireUIEvent('timeRangeNavigate', 'time');
|
|
156
|
+
(_this$props$onTimeCha = (_this$props3 = _this.props).onTimeChanged) === null || _this$props$onTimeCha === void 0 || _this$props$onTimeCha.call(_this$props3);
|
|
155
157
|
});
|
|
156
158
|
_defineProperty(_this, "onVolumeChanged", function () {
|
|
157
159
|
_this.createAndFireUIEvent('volumeRangeNavigate', 'volume');
|
|
158
160
|
});
|
|
161
|
+
_defineProperty(_this, "getDefaultTime", function () {
|
|
162
|
+
return _this.timeSaver.defaultTime;
|
|
163
|
+
});
|
|
159
164
|
_defineProperty(_this, "onCurrentTimeChange", function (currentTime, duration) {
|
|
160
|
-
|
|
165
|
+
// We rely on the saved time when switching to the new source URL
|
|
166
|
+
// so we need to save it irrespective of elapsed time or video length
|
|
167
|
+
if (fg('platform_media_resume_video_on_token_expiry')) {
|
|
168
|
+
_this.timeSaver.defaultTime = currentTime;
|
|
169
|
+
} else if (duration - currentTime > MINIMUM_DURATION_BEFORE_SAVING_TIME) {
|
|
161
170
|
_this.timeSaver.defaultTime = currentTime;
|
|
162
171
|
} else {
|
|
163
172
|
_this.timeSaver.defaultTime = 0;
|
|
@@ -171,11 +180,11 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
171
180
|
}, formatDuration(currentTime), " / ", formatDuration(duration));
|
|
172
181
|
});
|
|
173
182
|
_defineProperty(_this, "renderHDButton", function () {
|
|
174
|
-
var _this$
|
|
175
|
-
type = _this$
|
|
176
|
-
isHDAvailable = _this$
|
|
177
|
-
isHDActive = _this$
|
|
178
|
-
onHDToggleClick = _this$
|
|
183
|
+
var _this$props4 = _this.props,
|
|
184
|
+
type = _this$props4.type,
|
|
185
|
+
isHDAvailable = _this$props4.isHDAvailable,
|
|
186
|
+
isHDActive = _this$props4.isHDActive,
|
|
187
|
+
onHDToggleClick = _this$props4.onHDToggleClick;
|
|
179
188
|
if (type === 'audio' || !isHDAvailable) {
|
|
180
189
|
return;
|
|
181
190
|
}
|
|
@@ -257,9 +266,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
257
266
|
}
|
|
258
267
|
});
|
|
259
268
|
_defineProperty(_this, "renderFullScreenButton", function () {
|
|
260
|
-
var _this$
|
|
261
|
-
formatMessage = _this$
|
|
262
|
-
type = _this$
|
|
269
|
+
var _this$props5 = _this.props,
|
|
270
|
+
formatMessage = _this$props5.intl.formatMessage,
|
|
271
|
+
type = _this$props5.type;
|
|
263
272
|
if (type === 'audio') {
|
|
264
273
|
return;
|
|
265
274
|
}
|
|
@@ -385,9 +394,11 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
385
394
|
}));
|
|
386
395
|
});
|
|
387
396
|
_defineProperty(_this, "pause", function () {
|
|
397
|
+
var _this$props$onPause, _this$props6;
|
|
388
398
|
if (_this.actions) {
|
|
389
399
|
_this.actions.pause();
|
|
390
400
|
}
|
|
401
|
+
(_this$props$onPause = (_this$props6 = _this.props).onPause) === null || _this$props$onPause === void 0 || _this$props$onPause.call(_this$props6);
|
|
391
402
|
});
|
|
392
403
|
_defineProperty(_this, "play", function () {
|
|
393
404
|
var onFirstPlay = _this.props.onFirstPlay;
|
|
@@ -424,13 +435,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
424
435
|
};
|
|
425
436
|
});
|
|
426
437
|
_defineProperty(_this, "onViewed", function (videoState) {
|
|
427
|
-
var _this$
|
|
428
|
-
createAnalyticsEvent = _this$
|
|
429
|
-
identifier = _this$
|
|
430
|
-
isAutoPlay = _this$
|
|
431
|
-
isHDAvailable = _this$
|
|
432
|
-
isHDActive = _this$
|
|
433
|
-
type = _this$
|
|
438
|
+
var _this$props7 = _this.props,
|
|
439
|
+
createAnalyticsEvent = _this$props7.createAnalyticsEvent,
|
|
440
|
+
identifier = _this$props7.identifier,
|
|
441
|
+
isAutoPlay = _this$props7.isAutoPlay,
|
|
442
|
+
isHDAvailable = _this$props7.isHDAvailable,
|
|
443
|
+
isHDActive = _this$props7.isHDActive,
|
|
444
|
+
type = _this$props7.type;
|
|
434
445
|
var _this$state2 = _this.state,
|
|
435
446
|
isFullScreenEnabled = _this$state2.isFullScreenEnabled,
|
|
436
447
|
playerSize = _this$state2.playerSize,
|
|
@@ -516,9 +527,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
516
527
|
key: "componentDidUpdate",
|
|
517
528
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
518
529
|
var _prevTextTracks$capti, _textTracks$captions2;
|
|
519
|
-
var _this$
|
|
520
|
-
intl = _this$
|
|
521
|
-
textTracks = _this$
|
|
530
|
+
var _this$props8 = this.props,
|
|
531
|
+
intl = _this$props8.intl,
|
|
532
|
+
textTracks = _this$props8.textTracks;
|
|
522
533
|
var prevIntl = prevProps.intl,
|
|
523
534
|
prevTextTracks = prevProps.textTracks;
|
|
524
535
|
var didLocaleChange = prevIntl.locale !== intl.locale;
|
|
@@ -544,14 +555,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
544
555
|
}, {
|
|
545
556
|
key: "componentDidMount",
|
|
546
557
|
value: function componentDidMount() {
|
|
547
|
-
var _this$
|
|
548
|
-
type = _this$
|
|
549
|
-
identifier = _this$
|
|
550
|
-
isAutoPlay = _this$
|
|
551
|
-
isHDAvailable = _this$
|
|
552
|
-
isHDActive = _this$
|
|
553
|
-
onFirstPlay = _this$
|
|
554
|
-
createAnalyticsEvent = _this$
|
|
558
|
+
var _this$props9 = this.props,
|
|
559
|
+
type = _this$props9.type,
|
|
560
|
+
identifier = _this$props9.identifier,
|
|
561
|
+
isAutoPlay = _this$props9.isAutoPlay,
|
|
562
|
+
isHDAvailable = _this$props9.isHDAvailable,
|
|
563
|
+
isHDActive = _this$props9.isHDActive,
|
|
564
|
+
onFirstPlay = _this$props9.onFirstPlay,
|
|
565
|
+
createAnalyticsEvent = _this$props9.createAnalyticsEvent;
|
|
555
566
|
var _this$state4 = this.state,
|
|
556
567
|
isFullScreenEnabled = _this$state4.isFullScreenEnabled,
|
|
557
568
|
playerSize = _this$state4.playerSize,
|
|
@@ -569,12 +580,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
569
580
|
}
|
|
570
581
|
simultaneousPlayManager.subscribe(this);
|
|
571
582
|
if (isAutoPlay) {
|
|
583
|
+
var _this$props$onPlay, _this$props0;
|
|
572
584
|
simultaneousPlayManager.pauseOthers(this);
|
|
573
585
|
if (onFirstPlay) {
|
|
574
586
|
this.fireFirstPlayedTrackEvent();
|
|
575
587
|
this.wasPlayedOnce = true;
|
|
576
588
|
onFirstPlay();
|
|
577
589
|
}
|
|
590
|
+
(_this$props$onPlay = (_this$props0 = this.props).onPlay) === null || _this$props$onPlay === void 0 || _this$props$onPlay.call(_this$props0);
|
|
578
591
|
}
|
|
579
592
|
}
|
|
580
593
|
}, {
|
|
@@ -584,8 +597,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
584
597
|
this.videoWrapperRef.current.removeEventListener('fullscreenchange', this.onFullScreenChange);
|
|
585
598
|
}
|
|
586
599
|
if (this.state.isFullScreenEnabled) {
|
|
587
|
-
var _this$props$onFullscr2, _this$
|
|
588
|
-
(_this$props$onFullscr2 = (_this$
|
|
600
|
+
var _this$props$onFullscr2, _this$props1;
|
|
601
|
+
(_this$props$onFullscr2 = (_this$props1 = this.props).onFullscreenChange) === null || _this$props$onFullscr2 === void 0 || _this$props$onFullscr2.call(_this$props1, false);
|
|
589
602
|
}
|
|
590
603
|
simultaneousPlayManager.unsubscribe(this);
|
|
591
604
|
}
|
|
@@ -601,13 +614,13 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
601
614
|
}, {
|
|
602
615
|
key: "createAndFireUIEvent",
|
|
603
616
|
value: function createAndFireUIEvent(eventType, actionSubjectId) {
|
|
604
|
-
var _this$
|
|
605
|
-
type = _this$
|
|
606
|
-
identifier = _this$
|
|
607
|
-
isHDActive = _this$
|
|
608
|
-
isHDAvailable = _this$
|
|
609
|
-
isAutoPlay = _this$
|
|
610
|
-
createAnalyticsEvent = _this$
|
|
617
|
+
var _this$props10 = this.props,
|
|
618
|
+
type = _this$props10.type,
|
|
619
|
+
identifier = _this$props10.identifier,
|
|
620
|
+
isHDActive = _this$props10.isHDActive,
|
|
621
|
+
isHDAvailable = _this$props10.isHDAvailable,
|
|
622
|
+
isAutoPlay = _this$props10.isAutoPlay,
|
|
623
|
+
createAnalyticsEvent = _this$props10.createAnalyticsEvent;
|
|
611
624
|
var _this$state5 = this.state,
|
|
612
625
|
isFullScreenEnabled = _this$state5.isFullScreenEnabled,
|
|
613
626
|
playerSize = _this$state5.playerSize,
|
|
@@ -654,21 +667,21 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
654
667
|
key: "render",
|
|
655
668
|
value: function render() {
|
|
656
669
|
var _this2 = this;
|
|
657
|
-
var _this$
|
|
658
|
-
type = _this$
|
|
659
|
-
src = _this$
|
|
660
|
-
isAutoPlay = _this$
|
|
661
|
-
onCanPlay = _this$
|
|
662
|
-
onError = _this$
|
|
663
|
-
poster = _this$
|
|
664
|
-
videoControlsWrapperRef = _this$
|
|
665
|
-
textTracks = _this$
|
|
666
|
-
areControlsVisible = _this$
|
|
667
|
-
identifier = _this$
|
|
668
|
-
_this$
|
|
669
|
-
_this$
|
|
670
|
-
_this$
|
|
671
|
-
canUpdateVideoCaptions = _this$
|
|
670
|
+
var _this$props11 = this.props,
|
|
671
|
+
type = _this$props11.type,
|
|
672
|
+
src = _this$props11.src,
|
|
673
|
+
isAutoPlay = _this$props11.isAutoPlay,
|
|
674
|
+
onCanPlay = _this$props11.onCanPlay,
|
|
675
|
+
onError = _this$props11.onError,
|
|
676
|
+
poster = _this$props11.poster,
|
|
677
|
+
videoControlsWrapperRef = _this$props11.videoControlsWrapperRef,
|
|
678
|
+
textTracks = _this$props11.textTracks,
|
|
679
|
+
areControlsVisible = _this$props11.areControlsVisible,
|
|
680
|
+
identifier = _this$props11.identifier,
|
|
681
|
+
_this$props11$mediaSe = _this$props11.mediaSettings,
|
|
682
|
+
_this$props11$mediaSe2 = _this$props11$mediaSe === void 0 ? {} : _this$props11$mediaSe,
|
|
683
|
+
_this$props11$mediaSe3 = _this$props11$mediaSe2.canUpdateVideoCaptions,
|
|
684
|
+
canUpdateVideoCaptions = _this$props11$mediaSe3 === void 0 ? false : _this$props11$mediaSe3;
|
|
672
685
|
var _this$state6 = this.state,
|
|
673
686
|
areCaptionsEnabled = _this$state6.areCaptionsEnabled,
|
|
674
687
|
isArtifactUploaderOpen = _this$state6.isArtifactUploaderOpen;
|
|
@@ -681,7 +694,7 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
681
694
|
src: src,
|
|
682
695
|
autoPlay: isAutoPlay,
|
|
683
696
|
onCanPlay: onCanPlay,
|
|
684
|
-
defaultTime: this.
|
|
697
|
+
defaultTime: this.getDefaultTime,
|
|
685
698
|
onTimeChange: this.onCurrentTimeChange,
|
|
686
699
|
onError: onError,
|
|
687
700
|
poster: poster,
|
|
@@ -703,14 +716,18 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
703
716
|
var isMediumPlayer = playerSize === 'medium';
|
|
704
717
|
var defaultSkipAmount = 10;
|
|
705
718
|
var skipBackward = function skipBackward() {
|
|
719
|
+
var _this2$props$onTimeCh, _this2$props;
|
|
706
720
|
var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSkipAmount;
|
|
707
721
|
var newTime = videoState.currentTime - skipAmount;
|
|
708
722
|
actions.navigate(Math.max(newTime, 0));
|
|
723
|
+
(_this2$props$onTimeCh = (_this2$props = _this2.props).onTimeChanged) === null || _this2$props$onTimeCh === void 0 || _this2$props$onTimeCh.call(_this2$props);
|
|
709
724
|
};
|
|
710
725
|
var skipForward = function skipForward() {
|
|
726
|
+
var _this2$props$onTimeCh2, _this2$props2;
|
|
711
727
|
var skipAmount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultSkipAmount;
|
|
712
728
|
var newTime = videoState.currentTime + skipAmount;
|
|
713
729
|
actions.navigate(Math.min(newTime, videoState.duration));
|
|
730
|
+
(_this2$props$onTimeCh2 = (_this2$props2 = _this2.props).onTimeChanged) === null || _this2$props$onTimeCh2 === void 0 || _this2$props$onTimeCh2.call(_this2$props2);
|
|
714
731
|
};
|
|
715
732
|
var shortcuts = _this2.renderShortcuts({
|
|
716
733
|
togglePlayPauseAction: isPlaying ? _this2.pause : _this2.play,
|
|
@@ -48,7 +48,7 @@ export var Video = /*#__PURE__*/function (_Component) {
|
|
|
48
48
|
_defineProperty(_this, "onLoadedData", function () {
|
|
49
49
|
var defaultTime = _this.props.defaultTime;
|
|
50
50
|
if (_this.currentElement) {
|
|
51
|
-
_this.currentElement.currentTime = defaultTime;
|
|
51
|
+
_this.currentElement.currentTime = defaultTime();
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
_defineProperty(_this, "onVolumeChange", function (event) {
|
|
@@ -310,7 +310,9 @@ export var Video = /*#__PURE__*/function (_Component) {
|
|
|
310
310
|
}]);
|
|
311
311
|
}(Component);
|
|
312
312
|
_defineProperty(Video, "defaultProps", {
|
|
313
|
-
defaultTime:
|
|
313
|
+
defaultTime: function defaultTime() {
|
|
314
|
+
return 0;
|
|
315
|
+
},
|
|
314
316
|
sourceType: 'video',
|
|
315
317
|
autoPlay: false,
|
|
316
318
|
controls: false,
|
|
@@ -10,12 +10,12 @@ var _excluded = ["showSlider", "children"],
|
|
|
10
10
|
_excluded7 = ["children"],
|
|
11
11
|
_excluded8 = ["children"],
|
|
12
12
|
_excluded9 = ["children"],
|
|
13
|
-
|
|
13
|
+
_excluded0 = ["children", "controlsHidden"],
|
|
14
|
+
_excluded1 = ["isMuted", "children"],
|
|
15
|
+
_excluded10 = ["children"],
|
|
14
16
|
_excluded11 = ["isMuted", "children"],
|
|
15
|
-
_excluded12 = ["children"],
|
|
16
|
-
_excluded13 = ["
|
|
17
|
-
_excluded14 = ["isDragging", "timeLineThumbIsHover", "timeLineThumbIsFocus", "children"],
|
|
18
|
-
_excluded15 = ["children"];
|
|
17
|
+
_excluded12 = ["isDragging", "timeLineThumbIsHover", "timeLineThumbIsFocus", "children"],
|
|
18
|
+
_excluded13 = ["children"];
|
|
19
19
|
import "./styled-compiled.compiled.css";
|
|
20
20
|
import { ax, ix } from "@compiled/react/runtime";
|
|
21
21
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
@@ -106,10 +106,10 @@ export var RightControls = function RightControls(_ref9) {
|
|
|
106
106
|
};
|
|
107
107
|
var controlsWrapperStyles = null;
|
|
108
108
|
var hiddenControlsWrapperStyles = null;
|
|
109
|
-
export var ControlsWrapper = /*#__PURE__*/forwardRef(function (
|
|
110
|
-
var children =
|
|
111
|
-
controlsHidden =
|
|
112
|
-
props = _objectWithoutProperties(
|
|
109
|
+
export var ControlsWrapper = /*#__PURE__*/forwardRef(function (_ref0, ref) {
|
|
110
|
+
var children = _ref0.children,
|
|
111
|
+
controlsHidden = _ref0.controlsHidden,
|
|
112
|
+
props = _objectWithoutProperties(_ref0, _excluded0);
|
|
113
113
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
114
114
|
ref: ref
|
|
115
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
@@ -119,28 +119,28 @@ export var ControlsWrapper = /*#__PURE__*/forwardRef(function (_ref10, ref) {
|
|
|
119
119
|
});
|
|
120
120
|
var volumeToggleWrapperStyles = null;
|
|
121
121
|
var mutedVolumeToggleWrapperStyles = null;
|
|
122
|
-
export var VolumeToggleWrapper = function VolumeToggleWrapper(
|
|
123
|
-
var isMuted =
|
|
124
|
-
children =
|
|
125
|
-
props = _objectWithoutProperties(
|
|
122
|
+
export var VolumeToggleWrapper = function VolumeToggleWrapper(_ref1) {
|
|
123
|
+
var isMuted = _ref1.isMuted,
|
|
124
|
+
children = _ref1.children,
|
|
125
|
+
props = _objectWithoutProperties(_ref1, _excluded1);
|
|
126
126
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
127
127
|
className: ax(["_kqswh2mm _2hwxw1gv _14hp1j2z", isMuted && "_d32vqb75"])
|
|
128
128
|
}), children);
|
|
129
129
|
};
|
|
130
130
|
var volumeTimeRangeWrapperStyles = null;
|
|
131
|
-
export var VolumeTimeRangeWrapper = function VolumeTimeRangeWrapper(
|
|
132
|
-
var children =
|
|
133
|
-
props = _objectWithoutProperties(
|
|
131
|
+
export var VolumeTimeRangeWrapper = function VolumeTimeRangeWrapper(_ref10) {
|
|
132
|
+
var children = _ref10.children,
|
|
133
|
+
props = _objectWithoutProperties(_ref10, _excluded10);
|
|
134
134
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
135
135
|
className: ax(["_1bsb1osq _2hwxv47k"])
|
|
136
136
|
}), children);
|
|
137
137
|
};
|
|
138
138
|
var mutedIndicatorStyles = null;
|
|
139
139
|
var isMutedStyles = null;
|
|
140
|
-
export var MutedIndicator = function MutedIndicator(
|
|
141
|
-
var isMuted =
|
|
142
|
-
children =
|
|
143
|
-
props = _objectWithoutProperties(
|
|
140
|
+
export var MutedIndicator = function MutedIndicator(_ref11) {
|
|
141
|
+
var isMuted = _ref11.isMuted,
|
|
142
|
+
children = _ref11.children,
|
|
143
|
+
props = _objectWithoutProperties(_ref11, _excluded11);
|
|
144
144
|
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
145
145
|
className: ax(["_bfhk18rw _1bsb1pa9 _4t3iyh40 _kqswstnw _154iu2gc _1ltvu2gc _1pbycs5v _t9ec17wz _tzy4idpf _lcxvglyw", isMuted && "_tzy4kb7n"])
|
|
146
146
|
}), children);
|
|
@@ -150,21 +150,21 @@ var currentTimeToolTipDraggingStyles = null;
|
|
|
150
150
|
var currentTimeToolTipNotDraggingStyles = null;
|
|
151
151
|
var currentTimeTooltipThumbHoveredStyles = null;
|
|
152
152
|
var currentTimeTooltipThumbFocusedStyles = null;
|
|
153
|
-
export var CurrentTimeTooltip = function CurrentTimeTooltip(
|
|
154
|
-
var isDragging =
|
|
155
|
-
timeLineThumbIsHover =
|
|
156
|
-
timeLineThumbIsFocus =
|
|
157
|
-
children =
|
|
158
|
-
props = _objectWithoutProperties(
|
|
153
|
+
export var CurrentTimeTooltip = function CurrentTimeTooltip(_ref12) {
|
|
154
|
+
var isDragging = _ref12.isDragging,
|
|
155
|
+
timeLineThumbIsHover = _ref12.timeLineThumbIsHover,
|
|
156
|
+
timeLineThumbIsFocus = _ref12.timeLineThumbIsFocus,
|
|
157
|
+
children = _ref12.children,
|
|
158
|
+
props = _objectWithoutProperties(_ref12, _excluded12);
|
|
159
159
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
160
160
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
161
161
|
className: ax(["_11c8dcr7 _2rko1b66 _v564g17y _kqswstnw _uiztglyw _154iukr8 _bfhk39qu _syaz1pcz _ca0q1b66 _u5f3u2gc _n3td1b66 _19bvu2gc _1ltv1ssb _t9eczr6s _1nmz16rz", isDragging && "_tzy4kb7n", !isDragging && "_tzy4idpf", timeLineThumbIsHover && "_tzy4kb7n", timeLineThumbIsFocus && "_tzy4kb7n", "current-time-tooltip"])
|
|
162
162
|
}, props), children);
|
|
163
163
|
};
|
|
164
164
|
var timeRangeWrapperStyles = null;
|
|
165
|
-
export var TimeRangeWrapper = /*#__PURE__*/forwardRef(function (
|
|
166
|
-
var children =
|
|
167
|
-
props = _objectWithoutProperties(
|
|
165
|
+
export var TimeRangeWrapper = /*#__PURE__*/forwardRef(function (_ref13, ref) {
|
|
166
|
+
var children = _ref13.children,
|
|
167
|
+
props = _objectWithoutProperties(_ref13, _excluded13);
|
|
168
168
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
169
169
|
ref: ref
|
|
170
170
|
}, props, {
|
|
@@ -128,7 +128,8 @@ var VolumeRange = function VolumeRange(props) {
|
|
|
128
128
|
return fg('platform_media_compiled') ? /*#__PURE__*/React.createElement(CompiledTimeRangeWrapper, {
|
|
129
129
|
onMouseDown: onThumbMouseDown,
|
|
130
130
|
onKeyDown: onThumbKeyDown,
|
|
131
|
-
ref: wrapperElement
|
|
131
|
+
ref: wrapperElement,
|
|
132
|
+
"data-testid": "volume-range"
|
|
132
133
|
}, /*#__PURE__*/React.createElement(Range, {
|
|
133
134
|
tabIndex: 0,
|
|
134
135
|
step: 1,
|
|
@@ -148,7 +149,8 @@ var VolumeRange = function VolumeRange(props) {
|
|
|
148
149
|
showAsActive: isAlwaysActive,
|
|
149
150
|
onMouseDown: onThumbMouseDown,
|
|
150
151
|
onKeyDown: onThumbKeyDown,
|
|
151
|
-
ref: wrapperElement
|
|
152
|
+
ref: wrapperElement,
|
|
153
|
+
"data-testid": "volume-range"
|
|
152
154
|
}, /*#__PURE__*/React.createElement(Range, {
|
|
153
155
|
tabIndex: 0,
|
|
154
156
|
step: 1,
|
|
@@ -3,6 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
import React, { forwardRef, useCallback, useRef, useState } from 'react';
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { VcMediaWrapperProps } from '@atlaskit/react-ufo/vc-media';
|
|
6
|
+
import UFOCustomData from '@atlaskit/react-ufo/custom-data';
|
|
6
7
|
import { ImageComponent } from './styled';
|
|
7
8
|
import { getCssFromImageOrientation, isRotated } from '../imageMetaData';
|
|
8
9
|
import { useMergeRefs } from 'use-callback-ref';
|
|
@@ -355,7 +356,11 @@ export var MediaImage = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
355
356
|
var transform = getCssFromImageOrientation(previewOrientation);
|
|
356
357
|
style.transform += " ".concat(transform);
|
|
357
358
|
}
|
|
358
|
-
return /*#__PURE__*/React.createElement(
|
|
359
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, fg('platform_media_add_ufo_custom_data') ? /*#__PURE__*/React.createElement(UFOCustomData, {
|
|
360
|
+
data: {
|
|
361
|
+
hasMediaComponent: true
|
|
362
|
+
}
|
|
363
|
+
}) : null, /*#__PURE__*/React.createElement(ImageComponent, _extends({
|
|
359
364
|
loading: loading,
|
|
360
365
|
"data-testid": "media-image",
|
|
361
366
|
"data-vc": "media-image",
|
|
@@ -369,5 +374,5 @@ export var MediaImage = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
369
374
|
imageRef: mergedRef,
|
|
370
375
|
src: dataURI,
|
|
371
376
|
crossOrigin: crossOrigin
|
|
372
|
-
}, fg('platform_exclude_media_offender_from_vc') && VcMediaWrapperProps));
|
|
377
|
+
}, fg('platform_exclude_media_offender_from_vc') && VcMediaWrapperProps)));
|
|
373
378
|
});
|
|
@@ -16,6 +16,9 @@ export interface CustomMediaPlayerProps extends WithPlaybackProps, WithShowContr
|
|
|
16
16
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
17
17
|
readonly onCanPlay?: () => void;
|
|
18
18
|
readonly onError?: () => void;
|
|
19
|
+
readonly onPlay?: () => void;
|
|
20
|
+
readonly onPause?: () => void;
|
|
21
|
+
readonly onTimeChanged?: () => void;
|
|
19
22
|
readonly onDownloadClick?: () => void;
|
|
20
23
|
readonly onFirstPlay?: () => void;
|
|
21
24
|
readonly onFullscreenChange?: (fullscreen: boolean) => void;
|
|
@@ -42,6 +45,7 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
|
|
|
42
45
|
private onFullScreenChange;
|
|
43
46
|
private onTimeChanged;
|
|
44
47
|
private onVolumeChanged;
|
|
48
|
+
private getDefaultTime;
|
|
45
49
|
private onCurrentTimeChange;
|
|
46
50
|
private renderCurrentTime;
|
|
47
51
|
private renderHDButton;
|
|
@@ -19,6 +19,7 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
|
|
|
19
19
|
private onTimeChanged;
|
|
20
20
|
private onVolumeChanged;
|
|
21
21
|
private onCurrentTimeChange;
|
|
22
|
+
private getDefaultTime;
|
|
22
23
|
private renderCurrentTime;
|
|
23
24
|
private renderHDButton;
|
|
24
25
|
private onPlaybackSpeedChange;
|
|
@@ -17,6 +17,9 @@ export interface MediaPlayerBaseProps extends WithPlaybackProps, WithShowControl
|
|
|
17
17
|
readonly isShortcutEnabled?: boolean;
|
|
18
18
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
19
19
|
readonly onCanPlay?: () => void;
|
|
20
|
+
readonly onPlay?: () => void;
|
|
21
|
+
readonly onPause?: () => void;
|
|
22
|
+
readonly onTimeChanged?: () => void;
|
|
20
23
|
readonly onError?: () => void;
|
|
21
24
|
readonly onDownloadClick?: () => void;
|
|
22
25
|
readonly onFirstPlay?: () => void;
|
|
@@ -36,7 +36,12 @@ export type RenderCallback = (reactElement: ReactElement<SourceElement>, state:
|
|
|
36
36
|
export interface VideoProps {
|
|
37
37
|
src: string;
|
|
38
38
|
children: RenderCallback;
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* `defaultTime` is a getter function to ensure we're always
|
|
41
|
+
* getting the latest value from TimeSaver even if a render hasn't
|
|
42
|
+
* occurred to provide the latest value from the parent component.
|
|
43
|
+
*/
|
|
44
|
+
defaultTime: () => number;
|
|
40
45
|
sourceType: 'video' | 'audio';
|
|
41
46
|
controls: boolean;
|
|
42
47
|
autoPlay: boolean;
|
|
@@ -68,7 +73,7 @@ export declare class Video extends Component<VideoProps, VideoComponentState> {
|
|
|
68
73
|
hasCanPlayTriggered: boolean;
|
|
69
74
|
state: VideoComponentState;
|
|
70
75
|
static defaultProps: {
|
|
71
|
-
defaultTime: number;
|
|
76
|
+
defaultTime: () => number;
|
|
72
77
|
sourceType: string;
|
|
73
78
|
autoPlay: boolean;
|
|
74
79
|
controls: boolean;
|
|
@@ -16,6 +16,9 @@ export interface CustomMediaPlayerProps extends WithPlaybackProps, WithShowContr
|
|
|
16
16
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
17
17
|
readonly onCanPlay?: () => void;
|
|
18
18
|
readonly onError?: () => void;
|
|
19
|
+
readonly onPlay?: () => void;
|
|
20
|
+
readonly onPause?: () => void;
|
|
21
|
+
readonly onTimeChanged?: () => void;
|
|
19
22
|
readonly onDownloadClick?: () => void;
|
|
20
23
|
readonly onFirstPlay?: () => void;
|
|
21
24
|
readonly onFullscreenChange?: (fullscreen: boolean) => void;
|
|
@@ -42,6 +45,7 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
|
|
|
42
45
|
private onFullScreenChange;
|
|
43
46
|
private onTimeChanged;
|
|
44
47
|
private onVolumeChanged;
|
|
48
|
+
private getDefaultTime;
|
|
45
49
|
private onCurrentTimeChange;
|
|
46
50
|
private renderCurrentTime;
|
|
47
51
|
private renderHDButton;
|
|
@@ -19,6 +19,7 @@ export declare class CustomMediaPlayerBase extends Component<CustomMediaPlayerPr
|
|
|
19
19
|
private onTimeChanged;
|
|
20
20
|
private onVolumeChanged;
|
|
21
21
|
private onCurrentTimeChange;
|
|
22
|
+
private getDefaultTime;
|
|
22
23
|
private renderCurrentTime;
|
|
23
24
|
private renderHDButton;
|
|
24
25
|
private onPlaybackSpeedChange;
|
|
@@ -17,6 +17,9 @@ export interface MediaPlayerBaseProps extends WithPlaybackProps, WithShowControl
|
|
|
17
17
|
readonly isShortcutEnabled?: boolean;
|
|
18
18
|
readonly lastWatchTimeConfig?: TimeSaverConfig;
|
|
19
19
|
readonly onCanPlay?: () => void;
|
|
20
|
+
readonly onPlay?: () => void;
|
|
21
|
+
readonly onPause?: () => void;
|
|
22
|
+
readonly onTimeChanged?: () => void;
|
|
20
23
|
readonly onError?: () => void;
|
|
21
24
|
readonly onDownloadClick?: () => void;
|
|
22
25
|
readonly onFirstPlay?: () => void;
|
|
@@ -36,7 +36,12 @@ export type RenderCallback = (reactElement: ReactElement<SourceElement>, state:
|
|
|
36
36
|
export interface VideoProps {
|
|
37
37
|
src: string;
|
|
38
38
|
children: RenderCallback;
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* `defaultTime` is a getter function to ensure we're always
|
|
41
|
+
* getting the latest value from TimeSaver even if a render hasn't
|
|
42
|
+
* occurred to provide the latest value from the parent component.
|
|
43
|
+
*/
|
|
44
|
+
defaultTime: () => number;
|
|
40
45
|
sourceType: 'video' | 'audio';
|
|
41
46
|
controls: boolean;
|
|
42
47
|
autoPlay: boolean;
|
|
@@ -68,7 +73,7 @@ export declare class Video extends Component<VideoProps, VideoComponentState> {
|
|
|
68
73
|
hasCanPlayTriggered: boolean;
|
|
69
74
|
state: VideoComponentState;
|
|
70
75
|
static defaultProps: {
|
|
71
|
-
defaultTime: number;
|
|
76
|
+
defaultTime: () => number;
|
|
72
77
|
sourceType: string;
|
|
73
78
|
autoPlay: boolean;
|
|
74
79
|
controls: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-ui",
|
|
3
|
-
"version": "28.2.
|
|
3
|
+
"version": "28.2.3",
|
|
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,9 @@
|
|
|
30
30
|
"@atlaskit/css": "^0.10.0",
|
|
31
31
|
"@atlaskit/dropdown-menu": "^16.0.0",
|
|
32
32
|
"@atlaskit/form": "^12.0.0",
|
|
33
|
-
"@atlaskit/icon": "^26.
|
|
33
|
+
"@atlaskit/icon": "^26.4.0",
|
|
34
34
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
35
|
-
"@atlaskit/icon-lab": "^4.
|
|
35
|
+
"@atlaskit/icon-lab": "^4.17.0",
|
|
36
36
|
"@atlaskit/legacy-custom-icons": "^0.22.0",
|
|
37
37
|
"@atlaskit/locale": "^3.0.0",
|
|
38
38
|
"@atlaskit/media-client": "^33.3.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/spinner": "^18.0.0",
|
|
49
49
|
"@atlaskit/theme": "^18.0.0",
|
|
50
50
|
"@atlaskit/tokens": "^4.9.0",
|
|
51
|
-
"@atlaskit/tooltip": "^20.
|
|
51
|
+
"@atlaskit/tooltip": "^20.2.0",
|
|
52
52
|
"@atlaskit/width-detector": "^5.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@compiled/react": "^0.18.3",
|
|
@@ -95,8 +95,14 @@
|
|
|
95
95
|
"platform_media_compiled": {
|
|
96
96
|
"type": "boolean"
|
|
97
97
|
},
|
|
98
|
+
"platform_media_add_ufo_custom_data": {
|
|
99
|
+
"type": "boolean"
|
|
100
|
+
},
|
|
98
101
|
"platform_exclude_media_offender_from_vc": {
|
|
99
102
|
"type": "boolean"
|
|
103
|
+
},
|
|
104
|
+
"platform_media_resume_video_on_token_expiry": {
|
|
105
|
+
"type": "boolean"
|
|
100
106
|
}
|
|
101
107
|
},
|
|
102
108
|
"techstack": {
|