@atlaskit/media-ui 30.0.0 → 30.0.1
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 +9 -0
- package/dist/cjs/customMediaPlayer/dropdownControlCommon.js +57 -2
- package/dist/cjs/customMediaPlayer/index.js +1 -1
- package/dist/cjs/customMediaPlayer/mediaPlayer/captionsAdminControls.js +5 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/captionsSelectControls.js +5 -2
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/cjs/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +23 -16
- package/dist/cjs/customMediaPlayer/playbackSpeedControls.js +5 -2
- package/dist/es2019/customMediaPlayer/dropdownControlCommon.js +57 -1
- package/dist/es2019/customMediaPlayer/index.js +1 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/captionsAdminControls.js +5 -4
- package/dist/es2019/customMediaPlayer/mediaPlayer/captionsSelectControls.js +5 -3
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/es2019/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +13 -5
- package/dist/es2019/customMediaPlayer/playbackSpeedControls.js +5 -3
- package/dist/esm/customMediaPlayer/dropdownControlCommon.js +56 -1
- package/dist/esm/customMediaPlayer/index.js +1 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/captionsAdminControls.js +6 -4
- package/dist/esm/customMediaPlayer/mediaPlayer/captionsSelectControls.js +6 -3
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayer.js +1 -1
- package/dist/esm/customMediaPlayer/mediaPlayer/mediaPlayerBase.js +23 -16
- package/dist/esm/customMediaPlayer/playbackSpeedControls.js +6 -3
- package/dist/types/customMediaPlayer/dropdownControlCommon.d.ts +6 -0
- package/dist/types/customMediaPlayer/mediaPlayer/captionsAdminControls.d.ts +2 -1
- package/dist/types/customMediaPlayer/mediaPlayer/captionsSelectControls.d.ts +1 -0
- package/dist/types/customMediaPlayer/playbackSpeedControls.d.ts +1 -0
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/media-ui
|
|
2
2
|
|
|
3
|
+
## 30.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c28141dd43748`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c28141dd43748) -
|
|
8
|
+
[ux] Fix video player popup controls (captions admin, captions select, playback speed) not visible
|
|
9
|
+
in fullscreen mode. Uses Popper onFirstUpdate callback to reposition popups within the fullscreen
|
|
10
|
+
container, gated behind platform_editor_video_caption_commit
|
|
11
|
+
|
|
3
12
|
## 30.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.popupSelectComponents = exports.popupCustomStyles = exports.popperProps = exports.createPopupSelectComponentsWithIcon = void 0;
|
|
8
|
+
exports.popupSelectComponents = exports.popupCustomStyles = exports.popperProps = exports.getPopperPropsForFullscreen = exports.createPopupSelectComponentsWithIcon = void 0;
|
|
9
9
|
require("./dropdownControlCommon.compiled.css");
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -13,6 +13,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _select = require("@atlaskit/select");
|
|
16
|
+
var _browserApis = require("@atlaskit/browser-apis");
|
|
16
17
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
18
|
var _excluded = ["children"];
|
|
18
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -51,6 +52,9 @@ var popupCustomStyles = exports.popupCustomStyles = {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
};
|
|
55
|
+
|
|
56
|
+
/** Distance (px) between the trigger element and the popup menu. */
|
|
57
|
+
var POPUP_OFFSET = 10;
|
|
54
58
|
var popperProps = exports.popperProps = {
|
|
55
59
|
strategy: 'fixed',
|
|
56
60
|
modifiers: [{
|
|
@@ -66,11 +70,62 @@ var popperProps = exports.popperProps = {
|
|
|
66
70
|
name: 'offset',
|
|
67
71
|
enabled: true,
|
|
68
72
|
options: {
|
|
69
|
-
offset: [0,
|
|
73
|
+
offset: [0, POPUP_OFFSET]
|
|
70
74
|
}
|
|
71
75
|
}],
|
|
72
76
|
placement: 'top'
|
|
73
77
|
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Repositions a popup-select element when the video player is in fullscreen mode.
|
|
81
|
+
*
|
|
82
|
+
* When fullscreen is active, the browser's Fullscreen API makes the fullscreen element
|
|
83
|
+
* the containing block for `position: fixed` descendants. Popper.js computes transform
|
|
84
|
+
* coordinates assuming the viewport is the containing block, which results in the popup
|
|
85
|
+
* being rendered off-screen inside the fullscreen container.
|
|
86
|
+
*
|
|
87
|
+
* This function is called by Popper's `onFirstUpdate` callback with the Popper state,
|
|
88
|
+
* which provides direct references to both the popup and trigger elements — avoiding
|
|
89
|
+
* fragile DOM traversal like `previousElementSibling`.
|
|
90
|
+
*/
|
|
91
|
+
var repositionPopupInFullscreen = function repositionPopupInFullscreen(state) {
|
|
92
|
+
var _getDocument, _state$elements, _state$elements2;
|
|
93
|
+
var fullscreenEl = (_getDocument = (0, _browserApis.getDocument)()) === null || _getDocument === void 0 ? void 0 : _getDocument.fullscreenElement;
|
|
94
|
+
if (!fullscreenEl) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
var popupEl = (_state$elements = state.elements) === null || _state$elements === void 0 ? void 0 : _state$elements.popper;
|
|
98
|
+
var triggerEl = (_state$elements2 = state.elements) === null || _state$elements2 === void 0 ? void 0 : _state$elements2.reference;
|
|
99
|
+
if (!popupEl || !triggerEl || !fullscreenEl.contains(popupEl) || !popupEl.isConnected) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
var triggerRect = triggerEl.getBoundingClientRect();
|
|
103
|
+
var popupRect = popupEl.getBoundingClientRect();
|
|
104
|
+
var left = Math.round(Math.max(0, Math.min(fullscreenEl.clientWidth - popupRect.width, triggerRect.left + triggerRect.width / 2 - popupRect.width / 2)));
|
|
105
|
+
var bottom = Math.round(fullscreenEl.clientHeight - triggerRect.top + POPUP_OFFSET);
|
|
106
|
+
popupEl.style.setProperty('position', 'fixed');
|
|
107
|
+
popupEl.style.setProperty('inset', "auto auto ".concat(bottom, "px ").concat(left, "px"));
|
|
108
|
+
popupEl.style.setProperty('transform', 'none');
|
|
109
|
+
};
|
|
110
|
+
var fullscreenPopperProps = _objectSpread(_objectSpread({}, popperProps), {}, {
|
|
111
|
+
onFirstUpdate: function onFirstUpdate(state) {
|
|
112
|
+
// Double rAF ensures the popup content has rendered so we get accurate dimensions
|
|
113
|
+
requestAnimationFrame(function () {
|
|
114
|
+
requestAnimationFrame(function () {
|
|
115
|
+
repositionPopupInFullscreen(state);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns the appropriate popperProps based on fullscreen state.
|
|
123
|
+
* When in fullscreen, includes an `onFirstUpdate` callback that repositions the popup
|
|
124
|
+
* after Popper's initial (incorrect) positioning.
|
|
125
|
+
*/
|
|
126
|
+
var getPopperPropsForFullscreen = exports.getPopperPropsForFullscreen = function getPopperPropsForFullscreen(isFullScreen) {
|
|
127
|
+
return isFullScreen ? fullscreenPopperProps : popperProps;
|
|
128
|
+
};
|
|
74
129
|
var selectOptionStyles = {
|
|
75
130
|
root: "_1di6r5ow"
|
|
76
131
|
};
|
|
@@ -14,7 +14,7 @@ var CustomMediaPlayerBase = exports.CustomMediaPlayerBase = function CustomMedia
|
|
|
14
14
|
return /*#__PURE__*/_react.default.createElement(_indexCompiled.CustomMediaPlayerBase, props);
|
|
15
15
|
};
|
|
16
16
|
var packageName = "@atlaskit/media-ui";
|
|
17
|
-
var packageVersion = "
|
|
17
|
+
var packageVersion = "30.0.0";
|
|
18
18
|
|
|
19
19
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
20
20
|
var CustomMediaPlayer = exports.CustomMediaPlayer = (0, _mediaCommon.withMediaAnalyticsContext)({
|
|
@@ -18,6 +18,7 @@ var _captions = require("./captions");
|
|
|
18
18
|
var _MediaButton = _interopRequireDefault(require("../../MediaButton"));
|
|
19
19
|
var _dropdownControlCommon = require("../dropdownControlCommon");
|
|
20
20
|
var _select = require("@atlaskit/select");
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
23
|
var ADD_CAPTIONS_VALUE = 'add-captions';
|
|
23
24
|
var OptionIcon = function OptionIcon(_ref) {
|
|
@@ -40,7 +41,9 @@ var _CaptionsAdminControls = exports._CaptionsAdminControls = function _Captions
|
|
|
40
41
|
_ref2$textTracks = _ref2.textTracks,
|
|
41
42
|
textTracks = _ref2$textTracks === void 0 ? {} : _ref2$textTracks,
|
|
42
43
|
onUpload = _ref2.onUpload,
|
|
43
|
-
onDelete = _ref2.onDelete
|
|
44
|
+
onDelete = _ref2.onDelete,
|
|
45
|
+
_ref2$isFullScreen = _ref2.isFullScreen,
|
|
46
|
+
isFullScreen = _ref2$isFullScreen === void 0 ? false : _ref2$isFullScreen;
|
|
44
47
|
var manageCaptions = intl.formatMessage(_messages.messages.manage_captions);
|
|
45
48
|
var addCaptions = intl.formatMessage(_messages.messages.add_captions);
|
|
46
49
|
var popupSelectOptions = (0, _react.useMemo)(function () {
|
|
@@ -94,7 +97,7 @@ var _CaptionsAdminControls = exports._CaptionsAdminControls = function _Captions
|
|
|
94
97
|
}));
|
|
95
98
|
},
|
|
96
99
|
styles: _dropdownControlCommon.popupCustomStyles,
|
|
97
|
-
popperProps: _dropdownControlCommon.popperProps
|
|
100
|
+
popperProps: (0, _platformFeatureFlags.fg)('platform_editor_video_caption_commit') ? (0, _dropdownControlCommon.getPopperPropsForFullscreen)(isFullScreen) : _dropdownControlCommon.popperProps
|
|
98
101
|
});
|
|
99
102
|
};
|
|
100
103
|
var CaptionsAdminControls = exports.CaptionsAdminControls = (0, _reactIntl.injectIntl)(_CaptionsAdminControls);
|
|
@@ -17,6 +17,7 @@ var _captions = require("./captions");
|
|
|
17
17
|
var _select = require("@atlaskit/select");
|
|
18
18
|
var _MediaButton = _interopRequireDefault(require("../../MediaButton"));
|
|
19
19
|
var _dropdownControlCommon = require("../dropdownControlCommon");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
22
|
var CaptionsSelectControlsWithIntl = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
22
23
|
var textTracks = _ref.textTracks,
|
|
@@ -24,7 +25,9 @@ var CaptionsSelectControlsWithIntl = /*#__PURE__*/(0, _react.memo)(function (_re
|
|
|
24
25
|
intl = _ref.intl,
|
|
25
26
|
areCaptionsEnabled = _ref.areCaptionsEnabled,
|
|
26
27
|
onCaptionsEnabledChange = _ref.onCaptionsEnabledChange,
|
|
27
|
-
selectedTracksIndex = _ref.selectedTracksIndex
|
|
28
|
+
selectedTracksIndex = _ref.selectedTracksIndex,
|
|
29
|
+
_ref$isFullScreen = _ref.isFullScreen,
|
|
30
|
+
isFullScreen = _ref$isFullScreen === void 0 ? false : _ref$isFullScreen;
|
|
28
31
|
var closedCaptions = (0, _react.useMemo)(function () {
|
|
29
32
|
return intl.formatMessage(_messages.messages.video_captions_enable);
|
|
30
33
|
}, [intl]);
|
|
@@ -92,7 +95,7 @@ var CaptionsSelectControlsWithIntl = /*#__PURE__*/(0, _react.memo)(function (_re
|
|
|
92
95
|
}));
|
|
93
96
|
},
|
|
94
97
|
styles: _dropdownControlCommon.popupCustomStyles,
|
|
95
|
-
popperProps: _dropdownControlCommon.popperProps
|
|
98
|
+
popperProps: (0, _platformFeatureFlags.fg)('platform_editor_video_caption_commit') ? (0, _dropdownControlCommon.getPopperPropsForFullscreen)(isFullScreen) : _dropdownControlCommon.popperProps
|
|
96
99
|
}));
|
|
97
100
|
});
|
|
98
101
|
var CaptionsSelectControls = exports.CaptionsSelectControls = (0, _reactIntl.injectIntl)(CaptionsSelectControlsWithIntl);
|
|
@@ -15,7 +15,7 @@ var _useTextTracks2 = require("./useTextTracks");
|
|
|
15
15
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
16
16
|
var _excluded = ["onPlay"];
|
|
17
17
|
var packageName = "@atlaskit/media-ui";
|
|
18
|
-
var packageVersion = "
|
|
18
|
+
var packageVersion = "30.0.0";
|
|
19
19
|
var MediaPlayerWihtoutContext = exports.MediaPlayerWihtoutContext = function MediaPlayerWihtoutContext(_ref) {
|
|
20
20
|
var _onPlay = _ref.onPlay,
|
|
21
21
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
@@ -236,7 +236,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
236
236
|
return breakpointControls.speedControls(_this.state.playerWidth);
|
|
237
237
|
});
|
|
238
238
|
(0, _defineProperty2.default)(_this, "renderSpeedControls", function () {
|
|
239
|
-
var
|
|
239
|
+
var _this$state2 = _this.state,
|
|
240
|
+
playbackSpeed = _this$state2.playbackSpeed,
|
|
241
|
+
isFullScreenEnabled = _this$state2.isFullScreenEnabled;
|
|
240
242
|
var originalDimensions = _this.props.originalDimensions;
|
|
241
243
|
return /*#__PURE__*/_react.default.createElement(_playbackSpeedControls.default, {
|
|
242
244
|
originalDimensions: originalDimensions,
|
|
@@ -244,7 +246,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
244
246
|
onPlaybackSpeedChange: _this.onPlaybackSpeedChange,
|
|
245
247
|
onClick: function onClick() {
|
|
246
248
|
return _this.createAndFireUIEvent('mediaButtonClick', 'playbackSpeedButton');
|
|
247
|
-
}
|
|
249
|
+
},
|
|
250
|
+
isFullScreen: isFullScreenEnabled
|
|
248
251
|
});
|
|
249
252
|
});
|
|
250
253
|
(0, _defineProperty2.default)(_this, "shouldRenderVolume", function () {
|
|
@@ -497,9 +500,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
497
500
|
isHDAvailable = _this$props9.isHDAvailable,
|
|
498
501
|
isHDActive = _this$props9.isHDActive,
|
|
499
502
|
type = _this$props9.type;
|
|
500
|
-
var _this$
|
|
501
|
-
isFullScreenEnabled = _this$
|
|
502
|
-
playbackSpeed = _this$
|
|
503
|
+
var _this$state3 = _this.state,
|
|
504
|
+
isFullScreenEnabled = _this$state3.isFullScreenEnabled,
|
|
505
|
+
playbackSpeed = _this$state3.playbackSpeed;
|
|
503
506
|
var _this3 = _this,
|
|
504
507
|
playerSize = _this3.playerSize;
|
|
505
508
|
var status = videoState.status,
|
|
@@ -571,12 +574,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
571
574
|
_ref2$selectedTrackIn = _ref2.selectedTrackIndex,
|
|
572
575
|
selectedTrackIndex = _ref2$selectedTrackIn === void 0 ? -1 : _ref2$selectedTrackIn;
|
|
573
576
|
var areCaptionsEnabled = _this.props.areCaptionsEnabled;
|
|
577
|
+
var isFullScreenEnabled = _this.state.isFullScreenEnabled;
|
|
574
578
|
return textTracks && /*#__PURE__*/_react.default.createElement(_captionsSelectControls.CaptionsSelectControls, {
|
|
575
579
|
textTracks: textTracks,
|
|
576
580
|
onSelected: _this.onTextTracksSelected,
|
|
577
581
|
areCaptionsEnabled: !!areCaptionsEnabled,
|
|
578
582
|
onCaptionsEnabledChange: _this.onCaptionsEnabledChange,
|
|
579
|
-
selectedTracksIndex: selectedTrackIndex
|
|
583
|
+
selectedTracksIndex: selectedTrackIndex,
|
|
584
|
+
isFullScreen: isFullScreenEnabled
|
|
580
585
|
});
|
|
581
586
|
});
|
|
582
587
|
(0, _defineProperty2.default)(_this, "shouldRenderCaptionsAdminControls", function () {
|
|
@@ -585,9 +590,10 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
585
590
|
return (!_this.props.fileState || _this.props.fileState.status !== 'uploading') && breakpointControls.captionsAdminControls(playerWidth) && !!((_this$props$mediaSett = _this.props.mediaSettings) !== null && _this$props$mediaSett !== void 0 && _this$props$mediaSett.canUpdateVideoCaptions);
|
|
586
591
|
});
|
|
587
592
|
(0, _defineProperty2.default)(_this, "renderCaptionsAdminControls", function () {
|
|
588
|
-
var _this$
|
|
589
|
-
isArtifactUploaderOpen = _this$
|
|
590
|
-
artifactToDelete = _this$
|
|
593
|
+
var _this$state4 = _this.state,
|
|
594
|
+
isArtifactUploaderOpen = _this$state4.isArtifactUploaderOpen,
|
|
595
|
+
artifactToDelete = _this$state4.artifactToDelete,
|
|
596
|
+
isFullScreenEnabled = _this$state4.isFullScreenEnabled;
|
|
591
597
|
var _this$props10 = _this.props,
|
|
592
598
|
textTracks = _this$props10.textTracks,
|
|
593
599
|
identifier = _this$props10.identifier;
|
|
@@ -598,7 +604,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
598
604
|
isArtifactUploaderOpen: true
|
|
599
605
|
});
|
|
600
606
|
},
|
|
601
|
-
onDelete: _this.onCaptionDelete
|
|
607
|
+
onDelete: _this.onCaptionDelete,
|
|
608
|
+
isFullScreen: isFullScreenEnabled
|
|
602
609
|
}), /*#__PURE__*/_react.default.createElement(_artifactUploader.CaptionsUploaderBrowser, {
|
|
603
610
|
identifier: identifier,
|
|
604
611
|
isOpen: isArtifactUploaderOpen,
|
|
@@ -655,9 +662,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
655
662
|
isHDActive = _this$props11.isHDActive,
|
|
656
663
|
onFirstPlay = _this$props11.onFirstPlay,
|
|
657
664
|
createAnalyticsEvent = _this$props11.createAnalyticsEvent;
|
|
658
|
-
var _this$
|
|
659
|
-
isFullScreenEnabled = _this$
|
|
660
|
-
playbackSpeed = _this$
|
|
665
|
+
var _this$state5 = this.state,
|
|
666
|
+
isFullScreenEnabled = _this$state5.isFullScreenEnabled,
|
|
667
|
+
playbackSpeed = _this$state5.playbackSpeed;
|
|
661
668
|
var playerSize = this.playerSize;
|
|
662
669
|
(0, _analytics.fireAnalyticsEvent)((0, _analytics.createCustomMediaPlayerScreenEvent)(type, {
|
|
663
670
|
isAutoPlay: isAutoPlay,
|
|
@@ -719,9 +726,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
719
726
|
isHDAvailable = _this$props14.isHDAvailable,
|
|
720
727
|
isAutoPlay = _this$props14.isAutoPlay,
|
|
721
728
|
createAnalyticsEvent = _this$props14.createAnalyticsEvent;
|
|
722
|
-
var _this$
|
|
723
|
-
isFullScreenEnabled = _this$
|
|
724
|
-
playbackSpeed = _this$
|
|
729
|
+
var _this$state6 = this.state,
|
|
730
|
+
isFullScreenEnabled = _this$state6.isFullScreenEnabled,
|
|
731
|
+
playbackSpeed = _this$state6.playbackSpeed;
|
|
725
732
|
var playerSize = this.playerSize;
|
|
726
733
|
var playbackState = _objectSpread(_objectSpread({}, this.videoState), {}, {
|
|
727
734
|
isAutoPlay: isAutoPlay,
|
|
@@ -20,6 +20,7 @@ var _MediaButton = _interopRequireDefault(require("../MediaButton"));
|
|
|
20
20
|
var _messages = require("../messages");
|
|
21
21
|
var _widthDetector = require("@atlaskit/width-detector");
|
|
22
22
|
var _dropdownControlCommon = require("./dropdownControlCommon");
|
|
23
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
24
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
25
|
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)); }
|
|
25
26
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -90,7 +91,9 @@ var PlaybackSpeedControls = exports.PlaybackSpeedControls = /*#__PURE__*/functio
|
|
|
90
91
|
var _this$props = this.props,
|
|
91
92
|
playbackSpeed = _this$props.playbackSpeed,
|
|
92
93
|
intl = _this$props.intl,
|
|
93
|
-
onClick = _this$props.onClick
|
|
94
|
+
onClick = _this$props.onClick,
|
|
95
|
+
_this$props$isFullScr = _this$props.isFullScreen,
|
|
96
|
+
isFullScreen = _this$props$isFullScr === void 0 ? false : _this$props$isFullScr;
|
|
94
97
|
var popupHeight = this.state.popupHeight;
|
|
95
98
|
var value = this.speedOptions()[0].options.find(function (option) {
|
|
96
99
|
return option.value === playbackSpeed;
|
|
@@ -122,7 +125,7 @@ var PlaybackSpeedControls = exports.PlaybackSpeedControls = /*#__PURE__*/functio
|
|
|
122
125
|
}, playbackSpeed, "x"));
|
|
123
126
|
},
|
|
124
127
|
styles: _dropdownControlCommon.popupCustomStyles,
|
|
125
|
-
popperProps: _dropdownControlCommon.popperProps
|
|
128
|
+
popperProps: (0, _platformFeatureFlags.fg)('platform_editor_video_caption_commit') ? (0, _dropdownControlCommon.getPopperPropsForFullscreen)(isFullScreen) : _dropdownControlCommon.popperProps
|
|
126
129
|
}));
|
|
127
130
|
}
|
|
128
131
|
}]);
|
|
@@ -8,6 +8,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
8
8
|
// with the compiled react, we are leaving the static colors in tact for now.
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { components } from '@atlaskit/select';
|
|
11
|
+
import { getDocument } from '@atlaskit/browser-apis';
|
|
11
12
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
12
13
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
13
14
|
export const popupCustomStyles = {
|
|
@@ -38,6 +39,9 @@ export const popupCustomStyles = {
|
|
|
38
39
|
color: '#9fadbc'
|
|
39
40
|
})
|
|
40
41
|
};
|
|
42
|
+
|
|
43
|
+
/** Distance (px) between the trigger element and the popup menu. */
|
|
44
|
+
const POPUP_OFFSET = 10;
|
|
41
45
|
export const popperProps = {
|
|
42
46
|
strategy: 'fixed',
|
|
43
47
|
modifiers: [{
|
|
@@ -53,11 +57,63 @@ export const popperProps = {
|
|
|
53
57
|
name: 'offset',
|
|
54
58
|
enabled: true,
|
|
55
59
|
options: {
|
|
56
|
-
offset: [0,
|
|
60
|
+
offset: [0, POPUP_OFFSET]
|
|
57
61
|
}
|
|
58
62
|
}],
|
|
59
63
|
placement: 'top'
|
|
60
64
|
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Repositions a popup-select element when the video player is in fullscreen mode.
|
|
68
|
+
*
|
|
69
|
+
* When fullscreen is active, the browser's Fullscreen API makes the fullscreen element
|
|
70
|
+
* the containing block for `position: fixed` descendants. Popper.js computes transform
|
|
71
|
+
* coordinates assuming the viewport is the containing block, which results in the popup
|
|
72
|
+
* being rendered off-screen inside the fullscreen container.
|
|
73
|
+
*
|
|
74
|
+
* This function is called by Popper's `onFirstUpdate` callback with the Popper state,
|
|
75
|
+
* which provides direct references to both the popup and trigger elements — avoiding
|
|
76
|
+
* fragile DOM traversal like `previousElementSibling`.
|
|
77
|
+
*/
|
|
78
|
+
const repositionPopupInFullscreen = state => {
|
|
79
|
+
var _getDocument, _state$elements, _state$elements2;
|
|
80
|
+
const fullscreenEl = (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.fullscreenElement;
|
|
81
|
+
if (!fullscreenEl) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const popupEl = (_state$elements = state.elements) === null || _state$elements === void 0 ? void 0 : _state$elements.popper;
|
|
85
|
+
const triggerEl = (_state$elements2 = state.elements) === null || _state$elements2 === void 0 ? void 0 : _state$elements2.reference;
|
|
86
|
+
if (!popupEl || !triggerEl || !fullscreenEl.contains(popupEl) || !popupEl.isConnected) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const triggerRect = triggerEl.getBoundingClientRect();
|
|
90
|
+
const popupRect = popupEl.getBoundingClientRect();
|
|
91
|
+
const left = Math.round(Math.max(0, Math.min(fullscreenEl.clientWidth - popupRect.width, triggerRect.left + triggerRect.width / 2 - popupRect.width / 2)));
|
|
92
|
+
const bottom = Math.round(fullscreenEl.clientHeight - triggerRect.top + POPUP_OFFSET);
|
|
93
|
+
popupEl.style.setProperty('position', 'fixed');
|
|
94
|
+
popupEl.style.setProperty('inset', `auto auto ${bottom}px ${left}px`);
|
|
95
|
+
popupEl.style.setProperty('transform', 'none');
|
|
96
|
+
};
|
|
97
|
+
const fullscreenPopperProps = {
|
|
98
|
+
...popperProps,
|
|
99
|
+
onFirstUpdate: state => {
|
|
100
|
+
// Double rAF ensures the popup content has rendered so we get accurate dimensions
|
|
101
|
+
requestAnimationFrame(() => {
|
|
102
|
+
requestAnimationFrame(() => {
|
|
103
|
+
repositionPopupInFullscreen(state);
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns the appropriate popperProps based on fullscreen state.
|
|
111
|
+
* When in fullscreen, includes an `onFirstUpdate` callback that repositions the popup
|
|
112
|
+
* after Popper's initial (incorrect) positioning.
|
|
113
|
+
*/
|
|
114
|
+
export const getPopperPropsForFullscreen = isFullScreen => {
|
|
115
|
+
return isFullScreen ? fullscreenPopperProps : popperProps;
|
|
116
|
+
};
|
|
61
117
|
const selectOptionStyles = {
|
|
62
118
|
root: "_1di6r5ow"
|
|
63
119
|
};
|
|
@@ -5,7 +5,7 @@ import { CustomMediaPlayerBase as CompiledCustomMediaPlayerBase } from './index-
|
|
|
5
5
|
import { withMediaAnalyticsContext } from '@atlaskit/media-common';
|
|
6
6
|
export const CustomMediaPlayerBase = props => /*#__PURE__*/React.createElement(CompiledCustomMediaPlayerBase, props);
|
|
7
7
|
const packageName = "@atlaskit/media-ui";
|
|
8
|
-
const packageVersion = "
|
|
8
|
+
const packageVersion = "30.0.0";
|
|
9
9
|
|
|
10
10
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
11
11
|
export const CustomMediaPlayer = withMediaAnalyticsContext({
|
|
@@ -7,9 +7,9 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
7
7
|
import { injectIntl } from 'react-intl';
|
|
8
8
|
import { formatLocale } from './captions';
|
|
9
9
|
import MediaButton from '../../MediaButton';
|
|
10
|
-
import { popupCustomStyles, createPopupSelectComponentsWithIcon } from '../dropdownControlCommon';
|
|
10
|
+
import { popupCustomStyles, createPopupSelectComponentsWithIcon, popperProps, getPopperPropsForFullscreen } from '../dropdownControlCommon';
|
|
11
11
|
import { PopupSelect } from '@atlaskit/select';
|
|
12
|
-
import {
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
const ADD_CAPTIONS_VALUE = 'add-captions';
|
|
14
14
|
const OptionIcon = ({
|
|
15
15
|
value
|
|
@@ -31,7 +31,8 @@ export const _CaptionsAdminControls = ({
|
|
|
31
31
|
intl,
|
|
32
32
|
textTracks = {},
|
|
33
33
|
onUpload,
|
|
34
|
-
onDelete
|
|
34
|
+
onDelete,
|
|
35
|
+
isFullScreen = false
|
|
35
36
|
}) => {
|
|
36
37
|
const manageCaptions = intl.formatMessage(messages.manage_captions);
|
|
37
38
|
const addCaptions = intl.formatMessage(messages.add_captions);
|
|
@@ -83,7 +84,7 @@ export const _CaptionsAdminControls = ({
|
|
|
83
84
|
})
|
|
84
85
|
})),
|
|
85
86
|
styles: popupCustomStyles,
|
|
86
|
-
popperProps: popperProps
|
|
87
|
+
popperProps: fg('platform_editor_video_caption_commit') ? getPopperPropsForFullscreen(isFullScreen) : popperProps
|
|
87
88
|
});
|
|
88
89
|
};
|
|
89
90
|
export const CaptionsAdminControls = injectIntl(_CaptionsAdminControls);
|
|
@@ -7,14 +7,16 @@ import { messages } from '../../messages';
|
|
|
7
7
|
import { formatLocale } from './captions';
|
|
8
8
|
import { PopupSelect } from '@atlaskit/select';
|
|
9
9
|
import MediaButton from '../../MediaButton';
|
|
10
|
-
import { popperProps, popupCustomStyles, popupSelectComponents } from '../dropdownControlCommon';
|
|
10
|
+
import { popperProps, popupCustomStyles, popupSelectComponents, getPopperPropsForFullscreen } from '../dropdownControlCommon';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
const CaptionsSelectControlsWithIntl = /*#__PURE__*/memo(({
|
|
12
13
|
textTracks,
|
|
13
14
|
onSelected,
|
|
14
15
|
intl,
|
|
15
16
|
areCaptionsEnabled,
|
|
16
17
|
onCaptionsEnabledChange,
|
|
17
|
-
selectedTracksIndex
|
|
18
|
+
selectedTracksIndex,
|
|
19
|
+
isFullScreen = false
|
|
18
20
|
}) => {
|
|
19
21
|
const closedCaptions = useMemo(() => intl.formatMessage(messages.video_captions_enable), [intl]);
|
|
20
22
|
const selectCaptions = useMemo(() => intl.formatMessage(messages.video_captions_select_captions), [intl]);
|
|
@@ -70,7 +72,7 @@ const CaptionsSelectControlsWithIntl = /*#__PURE__*/memo(({
|
|
|
70
72
|
})
|
|
71
73
|
})),
|
|
72
74
|
styles: popupCustomStyles,
|
|
73
|
-
popperProps: popperProps
|
|
75
|
+
popperProps: fg('platform_editor_video_caption_commit') ? getPopperPropsForFullscreen(isFullScreen) : popperProps
|
|
74
76
|
}));
|
|
75
77
|
});
|
|
76
78
|
export const CaptionsSelectControls = injectIntl(CaptionsSelectControlsWithIntl);
|
|
@@ -6,7 +6,7 @@ import { MediaPlayerBase } from './mediaPlayerBase';
|
|
|
6
6
|
import { useTextTracks } from './useTextTracks';
|
|
7
7
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
8
8
|
const packageName = "@atlaskit/media-ui";
|
|
9
|
-
const packageVersion = "
|
|
9
|
+
const packageVersion = "30.0.0";
|
|
10
10
|
export const MediaPlayerWihtoutContext = ({
|
|
11
11
|
onPlay,
|
|
12
12
|
...props
|
|
@@ -196,7 +196,8 @@ class _MediaPlayerBase extends Component {
|
|
|
196
196
|
_defineProperty(this, "shouldRenderSpeedControls", () => breakpointControls.speedControls(this.state.playerWidth));
|
|
197
197
|
_defineProperty(this, "renderSpeedControls", () => {
|
|
198
198
|
const {
|
|
199
|
-
playbackSpeed
|
|
199
|
+
playbackSpeed,
|
|
200
|
+
isFullScreenEnabled
|
|
200
201
|
} = this.state;
|
|
201
202
|
const {
|
|
202
203
|
originalDimensions
|
|
@@ -205,7 +206,8 @@ class _MediaPlayerBase extends Component {
|
|
|
205
206
|
originalDimensions: originalDimensions,
|
|
206
207
|
playbackSpeed: playbackSpeed,
|
|
207
208
|
onPlaybackSpeedChange: this.onPlaybackSpeedChange,
|
|
208
|
-
onClick: () => this.createAndFireUIEvent('mediaButtonClick', 'playbackSpeedButton')
|
|
209
|
+
onClick: () => this.createAndFireUIEvent('mediaButtonClick', 'playbackSpeedButton'),
|
|
210
|
+
isFullScreen: isFullScreenEnabled
|
|
209
211
|
});
|
|
210
212
|
});
|
|
211
213
|
_defineProperty(this, "shouldRenderVolume", () => breakpointControls.volume(this.state.playerWidth));
|
|
@@ -543,12 +545,16 @@ class _MediaPlayerBase extends Component {
|
|
|
543
545
|
const {
|
|
544
546
|
areCaptionsEnabled
|
|
545
547
|
} = this.props;
|
|
548
|
+
const {
|
|
549
|
+
isFullScreenEnabled
|
|
550
|
+
} = this.state;
|
|
546
551
|
return textTracks && /*#__PURE__*/React.createElement(CaptionsSelectControls, {
|
|
547
552
|
textTracks: textTracks,
|
|
548
553
|
onSelected: this.onTextTracksSelected,
|
|
549
554
|
areCaptionsEnabled: !!areCaptionsEnabled,
|
|
550
555
|
onCaptionsEnabledChange: this.onCaptionsEnabledChange,
|
|
551
|
-
selectedTracksIndex: selectedTrackIndex
|
|
556
|
+
selectedTracksIndex: selectedTrackIndex,
|
|
557
|
+
isFullScreen: isFullScreenEnabled
|
|
552
558
|
});
|
|
553
559
|
});
|
|
554
560
|
_defineProperty(this, "shouldRenderCaptionsAdminControls", () => {
|
|
@@ -561,7 +567,8 @@ class _MediaPlayerBase extends Component {
|
|
|
561
567
|
_defineProperty(this, "renderCaptionsAdminControls", () => {
|
|
562
568
|
const {
|
|
563
569
|
isArtifactUploaderOpen,
|
|
564
|
-
artifactToDelete
|
|
570
|
+
artifactToDelete,
|
|
571
|
+
isFullScreenEnabled
|
|
565
572
|
} = this.state;
|
|
566
573
|
const {
|
|
567
574
|
textTracks,
|
|
@@ -572,7 +579,8 @@ class _MediaPlayerBase extends Component {
|
|
|
572
579
|
onUpload: () => this.setState({
|
|
573
580
|
isArtifactUploaderOpen: true
|
|
574
581
|
}),
|
|
575
|
-
onDelete: this.onCaptionDelete
|
|
582
|
+
onDelete: this.onCaptionDelete,
|
|
583
|
+
isFullScreen: isFullScreenEnabled
|
|
576
584
|
}), /*#__PURE__*/React.createElement(CaptionsUploaderBrowser, {
|
|
577
585
|
identifier: identifier,
|
|
578
586
|
isOpen: isArtifactUploaderOpen,
|
|
@@ -7,7 +7,8 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
7
7
|
import MediaButton from '../MediaButton';
|
|
8
8
|
import { messages } from '../messages';
|
|
9
9
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
10
|
-
import { popperProps, popupCustomStyles, popupSelectComponents } from './dropdownControlCommon';
|
|
10
|
+
import { popperProps, popupCustomStyles, popupSelectComponents, getPopperPropsForFullscreen } from './dropdownControlCommon';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
export class PlaybackSpeedControls extends Component {
|
|
12
13
|
constructor(...args) {
|
|
13
14
|
super(...args);
|
|
@@ -68,7 +69,8 @@ export class PlaybackSpeedControls extends Component {
|
|
|
68
69
|
const {
|
|
69
70
|
playbackSpeed,
|
|
70
71
|
intl,
|
|
71
|
-
onClick
|
|
72
|
+
onClick,
|
|
73
|
+
isFullScreen = false
|
|
72
74
|
} = this.props;
|
|
73
75
|
const {
|
|
74
76
|
popupHeight
|
|
@@ -100,7 +102,7 @@ export class PlaybackSpeedControls extends Component {
|
|
|
100
102
|
"aria-expanded": isOpen
|
|
101
103
|
}, playbackSpeed, "x")),
|
|
102
104
|
styles: popupCustomStyles,
|
|
103
|
-
popperProps: popperProps
|
|
105
|
+
popperProps: fg('platform_editor_video_caption_commit') ? getPopperPropsForFullscreen(isFullScreen) : popperProps
|
|
104
106
|
}));
|
|
105
107
|
}
|
|
106
108
|
}
|
|
@@ -13,6 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
// with the compiled react, we are leaving the static colors in tact for now.
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { components } from '@atlaskit/select';
|
|
16
|
+
import { getDocument } from '@atlaskit/browser-apis';
|
|
16
17
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
17
18
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
18
19
|
export var popupCustomStyles = {
|
|
@@ -46,6 +47,9 @@ export var popupCustomStyles = {
|
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
};
|
|
50
|
+
|
|
51
|
+
/** Distance (px) between the trigger element and the popup menu. */
|
|
52
|
+
var POPUP_OFFSET = 10;
|
|
49
53
|
export var popperProps = {
|
|
50
54
|
strategy: 'fixed',
|
|
51
55
|
modifiers: [{
|
|
@@ -61,11 +65,62 @@ export var popperProps = {
|
|
|
61
65
|
name: 'offset',
|
|
62
66
|
enabled: true,
|
|
63
67
|
options: {
|
|
64
|
-
offset: [0,
|
|
68
|
+
offset: [0, POPUP_OFFSET]
|
|
65
69
|
}
|
|
66
70
|
}],
|
|
67
71
|
placement: 'top'
|
|
68
72
|
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Repositions a popup-select element when the video player is in fullscreen mode.
|
|
76
|
+
*
|
|
77
|
+
* When fullscreen is active, the browser's Fullscreen API makes the fullscreen element
|
|
78
|
+
* the containing block for `position: fixed` descendants. Popper.js computes transform
|
|
79
|
+
* coordinates assuming the viewport is the containing block, which results in the popup
|
|
80
|
+
* being rendered off-screen inside the fullscreen container.
|
|
81
|
+
*
|
|
82
|
+
* This function is called by Popper's `onFirstUpdate` callback with the Popper state,
|
|
83
|
+
* which provides direct references to both the popup and trigger elements — avoiding
|
|
84
|
+
* fragile DOM traversal like `previousElementSibling`.
|
|
85
|
+
*/
|
|
86
|
+
var repositionPopupInFullscreen = function repositionPopupInFullscreen(state) {
|
|
87
|
+
var _getDocument, _state$elements, _state$elements2;
|
|
88
|
+
var fullscreenEl = (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : _getDocument.fullscreenElement;
|
|
89
|
+
if (!fullscreenEl) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
var popupEl = (_state$elements = state.elements) === null || _state$elements === void 0 ? void 0 : _state$elements.popper;
|
|
93
|
+
var triggerEl = (_state$elements2 = state.elements) === null || _state$elements2 === void 0 ? void 0 : _state$elements2.reference;
|
|
94
|
+
if (!popupEl || !triggerEl || !fullscreenEl.contains(popupEl) || !popupEl.isConnected) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
var triggerRect = triggerEl.getBoundingClientRect();
|
|
98
|
+
var popupRect = popupEl.getBoundingClientRect();
|
|
99
|
+
var left = Math.round(Math.max(0, Math.min(fullscreenEl.clientWidth - popupRect.width, triggerRect.left + triggerRect.width / 2 - popupRect.width / 2)));
|
|
100
|
+
var bottom = Math.round(fullscreenEl.clientHeight - triggerRect.top + POPUP_OFFSET);
|
|
101
|
+
popupEl.style.setProperty('position', 'fixed');
|
|
102
|
+
popupEl.style.setProperty('inset', "auto auto ".concat(bottom, "px ").concat(left, "px"));
|
|
103
|
+
popupEl.style.setProperty('transform', 'none');
|
|
104
|
+
};
|
|
105
|
+
var fullscreenPopperProps = _objectSpread(_objectSpread({}, popperProps), {}, {
|
|
106
|
+
onFirstUpdate: function onFirstUpdate(state) {
|
|
107
|
+
// Double rAF ensures the popup content has rendered so we get accurate dimensions
|
|
108
|
+
requestAnimationFrame(function () {
|
|
109
|
+
requestAnimationFrame(function () {
|
|
110
|
+
repositionPopupInFullscreen(state);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns the appropriate popperProps based on fullscreen state.
|
|
118
|
+
* When in fullscreen, includes an `onFirstUpdate` callback that repositions the popup
|
|
119
|
+
* after Popper's initial (incorrect) positioning.
|
|
120
|
+
*/
|
|
121
|
+
export var getPopperPropsForFullscreen = function getPopperPropsForFullscreen(isFullScreen) {
|
|
122
|
+
return isFullScreen ? fullscreenPopperProps : popperProps;
|
|
123
|
+
};
|
|
69
124
|
var selectOptionStyles = {
|
|
70
125
|
root: "_1di6r5ow"
|
|
71
126
|
};
|
|
@@ -7,7 +7,7 @@ export var CustomMediaPlayerBase = function CustomMediaPlayerBase(props) {
|
|
|
7
7
|
return /*#__PURE__*/React.createElement(CompiledCustomMediaPlayerBase, props);
|
|
8
8
|
};
|
|
9
9
|
var packageName = "@atlaskit/media-ui";
|
|
10
|
-
var packageVersion = "
|
|
10
|
+
var packageVersion = "30.0.0";
|
|
11
11
|
|
|
12
12
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
13
13
|
export var CustomMediaPlayer = withMediaAnalyticsContext({
|
|
@@ -8,9 +8,9 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
8
8
|
import { injectIntl } from 'react-intl';
|
|
9
9
|
import { formatLocale } from './captions';
|
|
10
10
|
import MediaButton from '../../MediaButton';
|
|
11
|
-
import { popupCustomStyles, createPopupSelectComponentsWithIcon } from '../dropdownControlCommon';
|
|
11
|
+
import { popupCustomStyles, createPopupSelectComponentsWithIcon, popperProps, getPopperPropsForFullscreen } from '../dropdownControlCommon';
|
|
12
12
|
import { PopupSelect } from '@atlaskit/select';
|
|
13
|
-
import {
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
var ADD_CAPTIONS_VALUE = 'add-captions';
|
|
15
15
|
var OptionIcon = function OptionIcon(_ref) {
|
|
16
16
|
var value = _ref.value;
|
|
@@ -32,7 +32,9 @@ export var _CaptionsAdminControls = function _CaptionsAdminControls(_ref2) {
|
|
|
32
32
|
_ref2$textTracks = _ref2.textTracks,
|
|
33
33
|
textTracks = _ref2$textTracks === void 0 ? {} : _ref2$textTracks,
|
|
34
34
|
onUpload = _ref2.onUpload,
|
|
35
|
-
onDelete = _ref2.onDelete
|
|
35
|
+
onDelete = _ref2.onDelete,
|
|
36
|
+
_ref2$isFullScreen = _ref2.isFullScreen,
|
|
37
|
+
isFullScreen = _ref2$isFullScreen === void 0 ? false : _ref2$isFullScreen;
|
|
36
38
|
var manageCaptions = intl.formatMessage(messages.manage_captions);
|
|
37
39
|
var addCaptions = intl.formatMessage(messages.add_captions);
|
|
38
40
|
var popupSelectOptions = useMemo(function () {
|
|
@@ -86,7 +88,7 @@ export var _CaptionsAdminControls = function _CaptionsAdminControls(_ref2) {
|
|
|
86
88
|
}));
|
|
87
89
|
},
|
|
88
90
|
styles: popupCustomStyles,
|
|
89
|
-
popperProps: popperProps
|
|
91
|
+
popperProps: fg('platform_editor_video_caption_commit') ? getPopperPropsForFullscreen(isFullScreen) : popperProps
|
|
90
92
|
});
|
|
91
93
|
};
|
|
92
94
|
export var CaptionsAdminControls = injectIntl(_CaptionsAdminControls);
|
|
@@ -8,14 +8,17 @@ import { messages } from '../../messages';
|
|
|
8
8
|
import { formatLocale } from './captions';
|
|
9
9
|
import { PopupSelect } from '@atlaskit/select';
|
|
10
10
|
import MediaButton from '../../MediaButton';
|
|
11
|
-
import { popperProps, popupCustomStyles, popupSelectComponents } from '../dropdownControlCommon';
|
|
11
|
+
import { popperProps, popupCustomStyles, popupSelectComponents, getPopperPropsForFullscreen } from '../dropdownControlCommon';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
var CaptionsSelectControlsWithIntl = /*#__PURE__*/memo(function (_ref) {
|
|
13
14
|
var textTracks = _ref.textTracks,
|
|
14
15
|
onSelected = _ref.onSelected,
|
|
15
16
|
intl = _ref.intl,
|
|
16
17
|
areCaptionsEnabled = _ref.areCaptionsEnabled,
|
|
17
18
|
onCaptionsEnabledChange = _ref.onCaptionsEnabledChange,
|
|
18
|
-
selectedTracksIndex = _ref.selectedTracksIndex
|
|
19
|
+
selectedTracksIndex = _ref.selectedTracksIndex,
|
|
20
|
+
_ref$isFullScreen = _ref.isFullScreen,
|
|
21
|
+
isFullScreen = _ref$isFullScreen === void 0 ? false : _ref$isFullScreen;
|
|
19
22
|
var closedCaptions = useMemo(function () {
|
|
20
23
|
return intl.formatMessage(messages.video_captions_enable);
|
|
21
24
|
}, [intl]);
|
|
@@ -83,7 +86,7 @@ var CaptionsSelectControlsWithIntl = /*#__PURE__*/memo(function (_ref) {
|
|
|
83
86
|
}));
|
|
84
87
|
},
|
|
85
88
|
styles: popupCustomStyles,
|
|
86
|
-
popperProps: popperProps
|
|
89
|
+
popperProps: fg('platform_editor_video_caption_commit') ? getPopperPropsForFullscreen(isFullScreen) : popperProps
|
|
87
90
|
}));
|
|
88
91
|
});
|
|
89
92
|
export var CaptionsSelectControls = injectIntl(CaptionsSelectControlsWithIntl);
|
|
@@ -8,7 +8,7 @@ import { MediaPlayerBase } from './mediaPlayerBase';
|
|
|
8
8
|
import { useTextTracks } from './useTextTracks';
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
var packageName = "@atlaskit/media-ui";
|
|
11
|
-
var packageVersion = "
|
|
11
|
+
var packageVersion = "30.0.0";
|
|
12
12
|
export var MediaPlayerWihtoutContext = function MediaPlayerWihtoutContext(_ref) {
|
|
13
13
|
var _onPlay = _ref.onPlay,
|
|
14
14
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -230,7 +230,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
230
230
|
return breakpointControls.speedControls(_this.state.playerWidth);
|
|
231
231
|
});
|
|
232
232
|
_defineProperty(_this, "renderSpeedControls", function () {
|
|
233
|
-
var
|
|
233
|
+
var _this$state2 = _this.state,
|
|
234
|
+
playbackSpeed = _this$state2.playbackSpeed,
|
|
235
|
+
isFullScreenEnabled = _this$state2.isFullScreenEnabled;
|
|
234
236
|
var originalDimensions = _this.props.originalDimensions;
|
|
235
237
|
return /*#__PURE__*/React.createElement(PlaybackSpeedControls, {
|
|
236
238
|
originalDimensions: originalDimensions,
|
|
@@ -238,7 +240,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
238
240
|
onPlaybackSpeedChange: _this.onPlaybackSpeedChange,
|
|
239
241
|
onClick: function onClick() {
|
|
240
242
|
return _this.createAndFireUIEvent('mediaButtonClick', 'playbackSpeedButton');
|
|
241
|
-
}
|
|
243
|
+
},
|
|
244
|
+
isFullScreen: isFullScreenEnabled
|
|
242
245
|
});
|
|
243
246
|
});
|
|
244
247
|
_defineProperty(_this, "shouldRenderVolume", function () {
|
|
@@ -491,9 +494,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
491
494
|
isHDAvailable = _this$props9.isHDAvailable,
|
|
492
495
|
isHDActive = _this$props9.isHDActive,
|
|
493
496
|
type = _this$props9.type;
|
|
494
|
-
var _this$
|
|
495
|
-
isFullScreenEnabled = _this$
|
|
496
|
-
playbackSpeed = _this$
|
|
497
|
+
var _this$state3 = _this.state,
|
|
498
|
+
isFullScreenEnabled = _this$state3.isFullScreenEnabled,
|
|
499
|
+
playbackSpeed = _this$state3.playbackSpeed;
|
|
497
500
|
var _this3 = _this,
|
|
498
501
|
playerSize = _this3.playerSize;
|
|
499
502
|
var status = videoState.status,
|
|
@@ -565,12 +568,14 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
565
568
|
_ref2$selectedTrackIn = _ref2.selectedTrackIndex,
|
|
566
569
|
selectedTrackIndex = _ref2$selectedTrackIn === void 0 ? -1 : _ref2$selectedTrackIn;
|
|
567
570
|
var areCaptionsEnabled = _this.props.areCaptionsEnabled;
|
|
571
|
+
var isFullScreenEnabled = _this.state.isFullScreenEnabled;
|
|
568
572
|
return textTracks && /*#__PURE__*/React.createElement(CaptionsSelectControls, {
|
|
569
573
|
textTracks: textTracks,
|
|
570
574
|
onSelected: _this.onTextTracksSelected,
|
|
571
575
|
areCaptionsEnabled: !!areCaptionsEnabled,
|
|
572
576
|
onCaptionsEnabledChange: _this.onCaptionsEnabledChange,
|
|
573
|
-
selectedTracksIndex: selectedTrackIndex
|
|
577
|
+
selectedTracksIndex: selectedTrackIndex,
|
|
578
|
+
isFullScreen: isFullScreenEnabled
|
|
574
579
|
});
|
|
575
580
|
});
|
|
576
581
|
_defineProperty(_this, "shouldRenderCaptionsAdminControls", function () {
|
|
@@ -579,9 +584,10 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
579
584
|
return (!_this.props.fileState || _this.props.fileState.status !== 'uploading') && breakpointControls.captionsAdminControls(playerWidth) && !!((_this$props$mediaSett = _this.props.mediaSettings) !== null && _this$props$mediaSett !== void 0 && _this$props$mediaSett.canUpdateVideoCaptions);
|
|
580
585
|
});
|
|
581
586
|
_defineProperty(_this, "renderCaptionsAdminControls", function () {
|
|
582
|
-
var _this$
|
|
583
|
-
isArtifactUploaderOpen = _this$
|
|
584
|
-
artifactToDelete = _this$
|
|
587
|
+
var _this$state4 = _this.state,
|
|
588
|
+
isArtifactUploaderOpen = _this$state4.isArtifactUploaderOpen,
|
|
589
|
+
artifactToDelete = _this$state4.artifactToDelete,
|
|
590
|
+
isFullScreenEnabled = _this$state4.isFullScreenEnabled;
|
|
585
591
|
var _this$props10 = _this.props,
|
|
586
592
|
textTracks = _this$props10.textTracks,
|
|
587
593
|
identifier = _this$props10.identifier;
|
|
@@ -592,7 +598,8 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
592
598
|
isArtifactUploaderOpen: true
|
|
593
599
|
});
|
|
594
600
|
},
|
|
595
|
-
onDelete: _this.onCaptionDelete
|
|
601
|
+
onDelete: _this.onCaptionDelete,
|
|
602
|
+
isFullScreen: isFullScreenEnabled
|
|
596
603
|
}), /*#__PURE__*/React.createElement(CaptionsUploaderBrowser, {
|
|
597
604
|
identifier: identifier,
|
|
598
605
|
isOpen: isArtifactUploaderOpen,
|
|
@@ -649,9 +656,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
649
656
|
isHDActive = _this$props11.isHDActive,
|
|
650
657
|
onFirstPlay = _this$props11.onFirstPlay,
|
|
651
658
|
createAnalyticsEvent = _this$props11.createAnalyticsEvent;
|
|
652
|
-
var _this$
|
|
653
|
-
isFullScreenEnabled = _this$
|
|
654
|
-
playbackSpeed = _this$
|
|
659
|
+
var _this$state5 = this.state,
|
|
660
|
+
isFullScreenEnabled = _this$state5.isFullScreenEnabled,
|
|
661
|
+
playbackSpeed = _this$state5.playbackSpeed;
|
|
655
662
|
var playerSize = this.playerSize;
|
|
656
663
|
fireAnalyticsEvent(createCustomMediaPlayerScreenEvent(type, {
|
|
657
664
|
isAutoPlay: isAutoPlay,
|
|
@@ -713,9 +720,9 @@ var _MediaPlayerBase = /*#__PURE__*/function (_Component) {
|
|
|
713
720
|
isHDAvailable = _this$props14.isHDAvailable,
|
|
714
721
|
isAutoPlay = _this$props14.isAutoPlay,
|
|
715
722
|
createAnalyticsEvent = _this$props14.createAnalyticsEvent;
|
|
716
|
-
var _this$
|
|
717
|
-
isFullScreenEnabled = _this$
|
|
718
|
-
playbackSpeed = _this$
|
|
723
|
+
var _this$state6 = this.state,
|
|
724
|
+
isFullScreenEnabled = _this$state6.isFullScreenEnabled,
|
|
725
|
+
playbackSpeed = _this$state6.playbackSpeed;
|
|
719
726
|
var playerSize = this.playerSize;
|
|
720
727
|
var playbackState = _objectSpread(_objectSpread({}, this.videoState), {}, {
|
|
721
728
|
isAutoPlay: isAutoPlay,
|
|
@@ -14,7 +14,8 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
14
14
|
import MediaButton from '../MediaButton';
|
|
15
15
|
import { messages } from '../messages';
|
|
16
16
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
17
|
-
import { popperProps, popupCustomStyles, popupSelectComponents } from './dropdownControlCommon';
|
|
17
|
+
import { popperProps, popupCustomStyles, popupSelectComponents, getPopperPropsForFullscreen } from './dropdownControlCommon';
|
|
18
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
19
|
export var PlaybackSpeedControls = /*#__PURE__*/function (_Component) {
|
|
19
20
|
function PlaybackSpeedControls() {
|
|
20
21
|
var _this;
|
|
@@ -82,7 +83,9 @@ export var PlaybackSpeedControls = /*#__PURE__*/function (_Component) {
|
|
|
82
83
|
var _this$props = this.props,
|
|
83
84
|
playbackSpeed = _this$props.playbackSpeed,
|
|
84
85
|
intl = _this$props.intl,
|
|
85
|
-
onClick = _this$props.onClick
|
|
86
|
+
onClick = _this$props.onClick,
|
|
87
|
+
_this$props$isFullScr = _this$props.isFullScreen,
|
|
88
|
+
isFullScreen = _this$props$isFullScr === void 0 ? false : _this$props$isFullScr;
|
|
86
89
|
var popupHeight = this.state.popupHeight;
|
|
87
90
|
var value = this.speedOptions()[0].options.find(function (option) {
|
|
88
91
|
return option.value === playbackSpeed;
|
|
@@ -114,7 +117,7 @@ export var PlaybackSpeedControls = /*#__PURE__*/function (_Component) {
|
|
|
114
117
|
}, playbackSpeed, "x"));
|
|
115
118
|
},
|
|
116
119
|
styles: popupCustomStyles,
|
|
117
|
-
popperProps: popperProps
|
|
120
|
+
popperProps: fg('platform_editor_video_caption_commit') ? getPopperPropsForFullscreen(isFullScreen) : popperProps
|
|
118
121
|
}));
|
|
119
122
|
}
|
|
120
123
|
}]);
|
|
@@ -2,6 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { type PopupSelect, type OptionType, type StylesConfig } from '@atlaskit/select';
|
|
3
3
|
export declare const popupCustomStyles: StylesConfig<OptionType>;
|
|
4
4
|
export declare const popperProps: PopupSelect['props']['popperProps'];
|
|
5
|
+
/**
|
|
6
|
+
* Returns the appropriate popperProps based on fullscreen state.
|
|
7
|
+
* When in fullscreen, includes an `onFirstUpdate` callback that repositions the popup
|
|
8
|
+
* after Popper's initial (incorrect) positioning.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getPopperPropsForFullscreen: (isFullScreen: boolean) => PopupSelect["props"]["popperProps"];
|
|
5
11
|
export declare const popupSelectComponents: PopupSelect['props']['components'];
|
|
6
12
|
export declare const createPopupSelectComponentsWithIcon: (IconComponent: React.ComponentType<{
|
|
7
13
|
label: string;
|
|
@@ -5,8 +5,9 @@ export interface CaptionsAdminControlsProps {
|
|
|
5
5
|
textTracks?: VideoTextTracks;
|
|
6
6
|
onUpload: () => void;
|
|
7
7
|
onDelete: (artifactName: string) => void;
|
|
8
|
+
isFullScreen?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const _CaptionsAdminControls: ({ intl, textTracks, onUpload, onDelete, }: CaptionsAdminControlsProps & WrappedComponentProps) => React.JSX.Element;
|
|
10
|
+
export declare const _CaptionsAdminControls: ({ intl, textTracks, onUpload, onDelete, isFullScreen, }: CaptionsAdminControlsProps & WrappedComponentProps) => React.JSX.Element;
|
|
10
11
|
export declare const CaptionsAdminControls: React.FC<WithIntlProps<CaptionsAdminControlsProps & WrappedComponentProps>> & {
|
|
11
12
|
WrappedComponent: React.ComponentType<CaptionsAdminControlsProps & WrappedComponentProps>;
|
|
12
13
|
};
|
|
@@ -7,6 +7,7 @@ export interface CaptionsSelectControlsProps {
|
|
|
7
7
|
areCaptionsEnabled: boolean;
|
|
8
8
|
onCaptionsEnabledChange: (areCaptionsEnabled: boolean) => void;
|
|
9
9
|
selectedTracksIndex: number;
|
|
10
|
+
isFullScreen?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export declare const CaptionsSelectControls: React.FC<WithIntlProps<CaptionsSelectControlsProps & WrappedComponentProps>> & {
|
|
12
13
|
WrappedComponent: React.ComponentType<CaptionsSelectControlsProps & WrappedComponentProps>;
|
|
@@ -8,6 +8,7 @@ export interface PlaybackSpeedControlsProps {
|
|
|
8
8
|
originalDimensions?: NumericalCardDimensions;
|
|
9
9
|
onClick?: () => void;
|
|
10
10
|
onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
|
|
11
|
+
isFullScreen?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export interface PlaybackSpeedControlsState {
|
|
13
14
|
popupHeight: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-ui",
|
|
3
|
-
"version": "30.0.
|
|
3
|
+
"version": "30.0.1",
|
|
4
4
|
"description": "Includes common components and utilities used by other media packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/afm-i18n-platform-media-media-ui": "2.130.0",
|
|
34
34
|
"@atlaskit/analytics-next": "^12.0.0",
|
|
35
|
+
"@atlaskit/browser-apis": "^1.0.0",
|
|
35
36
|
"@atlaskit/button": "^24.0.0",
|
|
36
37
|
"@atlaskit/code": "^18.0.0",
|
|
37
38
|
"@atlaskit/css": "^1.0.0",
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
"@babel/runtime": "^7.0.0",
|
|
59
60
|
"@compiled/react": "^0.20.0",
|
|
60
61
|
"@emotion/styled": "^11.0.0",
|
|
62
|
+
"@popperjs/core": "^2.11.8",
|
|
61
63
|
"blueimp-load-image": "2.19.0",
|
|
62
64
|
"bytes": "^3.1.0",
|
|
63
65
|
"exenv": "^1.2.2",
|
|
@@ -95,6 +97,10 @@
|
|
|
95
97
|
"platform-feature-flags": {
|
|
96
98
|
"platform_media_resume_video_on_token_expiry": {
|
|
97
99
|
"type": "boolean"
|
|
100
|
+
},
|
|
101
|
+
"platform_editor_video_caption_commit": {
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"referenceOnly": true
|
|
98
104
|
}
|
|
99
105
|
},
|
|
100
106
|
"techstack": {
|