@atlaskit/media-viewer 49.2.6 → 49.2.7
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 +8 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/analytics/ufoExperiences.js +1 -1
- package/dist/cjs/viewers/video.js +25 -19
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/analytics/ufoExperiences.js +1 -1
- package/dist/es2019/viewers/video.js +7 -3
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/analytics/ufoExperiences.js +1 -1
- package/dist/esm/viewers/video.js +25 -19
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 49.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#156911](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156911)
|
|
8
|
+
[`194066533e77e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/194066533e77e) -
|
|
9
|
+
Overriding HDActive flag and using HDAvailable instead to request for 1280p video
|
|
10
|
+
|
|
3
11
|
## 49.2.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -10,7 +10,7 @@ exports.packageVersion = exports.packageName = void 0;
|
|
|
10
10
|
var _analytics = require("@atlaskit/media-common/analytics");
|
|
11
11
|
var componentName = exports.component = exports.componentName = 'mediaViewer';
|
|
12
12
|
var packageName = exports.packageName = "@atlaskit/media-viewer";
|
|
13
|
-
var packageVersion = exports.packageVersion = "49.2.
|
|
13
|
+
var packageVersion = exports.packageVersion = "49.2.7";
|
|
14
14
|
function getFileAttributes(fileState) {
|
|
15
15
|
if (!fileState) {
|
|
16
16
|
return {
|
|
@@ -12,7 +12,7 @@ var _mediaCommon = require("@atlaskit/media-common");
|
|
|
12
12
|
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; }
|
|
13
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
14
|
var packageName = "@atlaskit/media-viewer";
|
|
15
|
-
var packageVersion = "49.2.
|
|
15
|
+
var packageVersion = "49.2.7";
|
|
16
16
|
var ufoExperience;
|
|
17
17
|
var getExperience = function getExperience() {
|
|
18
18
|
if (!ufoExperience) {
|
|
@@ -84,6 +84,8 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
84
84
|
previewCount = _this$props2.previewCount;
|
|
85
85
|
var useCustomVideoPlayer = !(0, _isIE.isIE)();
|
|
86
86
|
var isAutoPlay = previewCount === 0;
|
|
87
|
+
var hdAvailable = isHDAvailable(item);
|
|
88
|
+
var hdActiveOverride = (0, _platformFeatureFlags.fg)('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
87
89
|
return useCustomVideoPlayer ? /*#__PURE__*/_react.default.createElement(_styleWrappers.CustomVideoPlayerWrapper, {
|
|
88
90
|
"data-testid": "media-viewer-video-content"
|
|
89
91
|
}, /*#__PURE__*/_react.default.createElement(_mediaUi.CustomMediaPlayer, {
|
|
@@ -93,8 +95,8 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
93
95
|
showControls: showControls,
|
|
94
96
|
src: content,
|
|
95
97
|
fileId: item.id,
|
|
96
|
-
isHDActive:
|
|
97
|
-
isHDAvailable:
|
|
98
|
+
isHDActive: hdActiveOverride,
|
|
99
|
+
isHDAvailable: hdAvailable,
|
|
98
100
|
isShortcutEnabled: true,
|
|
99
101
|
onFirstPlay: this.onFirstPlay,
|
|
100
102
|
onError: this.onError,
|
|
@@ -117,6 +119,8 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
117
119
|
item,
|
|
118
120
|
collectionName,
|
|
119
121
|
contentUrl,
|
|
122
|
+
hdAvailable,
|
|
123
|
+
hdActiveOverride,
|
|
120
124
|
preferHd,
|
|
121
125
|
_args = arguments;
|
|
122
126
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
@@ -126,52 +130,54 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
126
130
|
_this$props3 = this.props, mediaClient = _this$props3.mediaClient, item = _this$props3.item, collectionName = _this$props3.collectionName;
|
|
127
131
|
_context.prev = 2;
|
|
128
132
|
if (!(item.status === 'processed')) {
|
|
129
|
-
_context.next =
|
|
133
|
+
_context.next = 14;
|
|
130
134
|
break;
|
|
131
135
|
}
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
hdAvailable = isHDAvailable(item);
|
|
137
|
+
hdActiveOverride = (0, _platformFeatureFlags.fg)('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
138
|
+
preferHd = hdActiveOverride && hdAvailable;
|
|
139
|
+
_context.next = 9;
|
|
134
140
|
return mediaClient.file.getArtifactURL(item.artifacts, preferHd ? hdArtifact : sdArtifact, collectionName);
|
|
135
|
-
case
|
|
141
|
+
case 9:
|
|
136
142
|
contentUrl = _context.sent;
|
|
137
143
|
if (contentUrl) {
|
|
138
|
-
_context.next =
|
|
144
|
+
_context.next = 12;
|
|
139
145
|
break;
|
|
140
146
|
}
|
|
141
147
|
throw new _errors.MediaViewerError("videoviewer-missing-artefact");
|
|
142
|
-
case 10:
|
|
143
|
-
_context.next = 18;
|
|
144
|
-
break;
|
|
145
148
|
case 12:
|
|
146
|
-
_context.next =
|
|
147
|
-
|
|
149
|
+
_context.next = 20;
|
|
150
|
+
break;
|
|
148
151
|
case 14:
|
|
152
|
+
_context.next = 16;
|
|
153
|
+
return (0, _getObjectUrlFromFileState.getObjectUrlFromFileState)(item);
|
|
154
|
+
case 16:
|
|
149
155
|
contentUrl = _context.sent;
|
|
150
156
|
if (contentUrl) {
|
|
151
|
-
_context.next =
|
|
157
|
+
_context.next = 20;
|
|
152
158
|
break;
|
|
153
159
|
}
|
|
154
160
|
this.setState({
|
|
155
161
|
content: _domain.Outcome.pending()
|
|
156
162
|
});
|
|
157
163
|
return _context.abrupt("return");
|
|
158
|
-
case
|
|
164
|
+
case 20:
|
|
159
165
|
this.setState({
|
|
160
166
|
content: _domain.Outcome.successful(contentUrl)
|
|
161
167
|
});
|
|
162
|
-
_context.next =
|
|
168
|
+
_context.next = 26;
|
|
163
169
|
break;
|
|
164
|
-
case
|
|
165
|
-
_context.prev =
|
|
170
|
+
case 23:
|
|
171
|
+
_context.prev = 23;
|
|
166
172
|
_context.t0 = _context["catch"](2);
|
|
167
173
|
this.setState({
|
|
168
174
|
content: _domain.Outcome.failed(new _errors.MediaViewerError('videoviewer-fetch-url', _context.t0 instanceof Error ? _context.t0 : undefined))
|
|
169
175
|
});
|
|
170
|
-
case
|
|
176
|
+
case 26:
|
|
171
177
|
case "end":
|
|
172
178
|
return _context.stop();
|
|
173
179
|
}
|
|
174
|
-
}, _callee, this, [[2,
|
|
180
|
+
}, _callee, this, [[2, 23]]);
|
|
175
181
|
}));
|
|
176
182
|
function init() {
|
|
177
183
|
return _init.apply(this, arguments);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
const componentName = 'mediaViewer';
|
|
3
3
|
const packageName = "@atlaskit/media-viewer";
|
|
4
|
-
const packageVersion = "49.2.
|
|
4
|
+
const packageVersion = "49.2.7";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -2,7 +2,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
2
2
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
3
3
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
4
4
|
const packageName = "@atlaskit/media-viewer";
|
|
5
|
-
const packageVersion = "49.2.
|
|
5
|
+
const packageVersion = "49.2.7";
|
|
6
6
|
let ufoExperience;
|
|
7
7
|
const getExperience = () => {
|
|
8
8
|
if (!ufoExperience) {
|
|
@@ -63,6 +63,8 @@ export class VideoViewer extends BaseViewer {
|
|
|
63
63
|
} = this.props;
|
|
64
64
|
const useCustomVideoPlayer = !isIE();
|
|
65
65
|
const isAutoPlay = previewCount === 0;
|
|
66
|
+
const hdAvailable = isHDAvailable(item);
|
|
67
|
+
const hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
66
68
|
return useCustomVideoPlayer ? /*#__PURE__*/React.createElement(CustomVideoPlayerWrapper, {
|
|
67
69
|
"data-testid": "media-viewer-video-content"
|
|
68
70
|
}, /*#__PURE__*/React.createElement(CustomMediaPlayer, {
|
|
@@ -72,8 +74,8 @@ export class VideoViewer extends BaseViewer {
|
|
|
72
74
|
showControls: showControls,
|
|
73
75
|
src: content,
|
|
74
76
|
fileId: item.id,
|
|
75
|
-
isHDActive:
|
|
76
|
-
isHDAvailable:
|
|
77
|
+
isHDActive: hdActiveOverride,
|
|
78
|
+
isHDAvailable: hdAvailable,
|
|
77
79
|
isShortcutEnabled: true,
|
|
78
80
|
onFirstPlay: this.onFirstPlay,
|
|
79
81
|
onError: this.onError,
|
|
@@ -95,7 +97,9 @@ export class VideoViewer extends BaseViewer {
|
|
|
95
97
|
try {
|
|
96
98
|
let contentUrl;
|
|
97
99
|
if (item.status === 'processed') {
|
|
98
|
-
const
|
|
100
|
+
const hdAvailable = isHDAvailable(item);
|
|
101
|
+
const hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
102
|
+
const preferHd = hdActiveOverride && hdAvailable;
|
|
99
103
|
contentUrl = await mediaClient.file.getArtifactURL(item.artifacts, preferHd ? hdArtifact : sdArtifact, collectionName);
|
|
100
104
|
if (!contentUrl) {
|
|
101
105
|
throw new MediaViewerError(`videoviewer-missing-artefact`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ANALYTICS_MEDIA_CHANNEL, sanitiseAnalyticsPayload } from '@atlaskit/media-common/analytics';
|
|
2
2
|
var componentName = 'mediaViewer';
|
|
3
3
|
var packageName = "@atlaskit/media-viewer";
|
|
4
|
-
var packageVersion = "49.2.
|
|
4
|
+
var packageVersion = "49.2.7";
|
|
5
5
|
export { packageName, packageVersion, componentName, componentName as component };
|
|
6
6
|
export function getFileAttributes(fileState) {
|
|
7
7
|
if (!fileState) {
|
|
@@ -5,7 +5,7 @@ import { UFOExperience, ExperiencePerformanceTypes, ExperienceTypes } from '@atl
|
|
|
5
5
|
import { getMediaEnvironment, getMediaRegion } from '@atlaskit/media-client';
|
|
6
6
|
import { getFeatureFlagKeysAllProducts } from '@atlaskit/media-common';
|
|
7
7
|
var packageName = "@atlaskit/media-viewer";
|
|
8
|
-
var packageVersion = "49.2.
|
|
8
|
+
var packageVersion = "49.2.7";
|
|
9
9
|
var ufoExperience;
|
|
10
10
|
var getExperience = function getExperience() {
|
|
11
11
|
if (!ufoExperience) {
|
|
@@ -77,6 +77,8 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
77
77
|
previewCount = _this$props2.previewCount;
|
|
78
78
|
var useCustomVideoPlayer = !isIE();
|
|
79
79
|
var isAutoPlay = previewCount === 0;
|
|
80
|
+
var hdAvailable = isHDAvailable(item);
|
|
81
|
+
var hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
80
82
|
return useCustomVideoPlayer ? /*#__PURE__*/React.createElement(CustomVideoPlayerWrapper, {
|
|
81
83
|
"data-testid": "media-viewer-video-content"
|
|
82
84
|
}, /*#__PURE__*/React.createElement(CustomMediaPlayer, {
|
|
@@ -86,8 +88,8 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
86
88
|
showControls: showControls,
|
|
87
89
|
src: content,
|
|
88
90
|
fileId: item.id,
|
|
89
|
-
isHDActive:
|
|
90
|
-
isHDAvailable:
|
|
91
|
+
isHDActive: hdActiveOverride,
|
|
92
|
+
isHDAvailable: hdAvailable,
|
|
91
93
|
isShortcutEnabled: true,
|
|
92
94
|
onFirstPlay: this.onFirstPlay,
|
|
93
95
|
onError: this.onError,
|
|
@@ -110,6 +112,8 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
110
112
|
item,
|
|
111
113
|
collectionName,
|
|
112
114
|
contentUrl,
|
|
115
|
+
hdAvailable,
|
|
116
|
+
hdActiveOverride,
|
|
113
117
|
preferHd,
|
|
114
118
|
_args = arguments;
|
|
115
119
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -119,52 +123,54 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
119
123
|
_this$props3 = this.props, mediaClient = _this$props3.mediaClient, item = _this$props3.item, collectionName = _this$props3.collectionName;
|
|
120
124
|
_context.prev = 2;
|
|
121
125
|
if (!(item.status === 'processed')) {
|
|
122
|
-
_context.next =
|
|
126
|
+
_context.next = 14;
|
|
123
127
|
break;
|
|
124
128
|
}
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
hdAvailable = isHDAvailable(item);
|
|
130
|
+
hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
131
|
+
preferHd = hdActiveOverride && hdAvailable;
|
|
132
|
+
_context.next = 9;
|
|
127
133
|
return mediaClient.file.getArtifactURL(item.artifacts, preferHd ? hdArtifact : sdArtifact, collectionName);
|
|
128
|
-
case
|
|
134
|
+
case 9:
|
|
129
135
|
contentUrl = _context.sent;
|
|
130
136
|
if (contentUrl) {
|
|
131
|
-
_context.next =
|
|
137
|
+
_context.next = 12;
|
|
132
138
|
break;
|
|
133
139
|
}
|
|
134
140
|
throw new MediaViewerError("videoviewer-missing-artefact");
|
|
135
|
-
case 10:
|
|
136
|
-
_context.next = 18;
|
|
137
|
-
break;
|
|
138
141
|
case 12:
|
|
139
|
-
_context.next =
|
|
140
|
-
|
|
142
|
+
_context.next = 20;
|
|
143
|
+
break;
|
|
141
144
|
case 14:
|
|
145
|
+
_context.next = 16;
|
|
146
|
+
return getObjectUrlFromFileState(item);
|
|
147
|
+
case 16:
|
|
142
148
|
contentUrl = _context.sent;
|
|
143
149
|
if (contentUrl) {
|
|
144
|
-
_context.next =
|
|
150
|
+
_context.next = 20;
|
|
145
151
|
break;
|
|
146
152
|
}
|
|
147
153
|
this.setState({
|
|
148
154
|
content: Outcome.pending()
|
|
149
155
|
});
|
|
150
156
|
return _context.abrupt("return");
|
|
151
|
-
case
|
|
157
|
+
case 20:
|
|
152
158
|
this.setState({
|
|
153
159
|
content: Outcome.successful(contentUrl)
|
|
154
160
|
});
|
|
155
|
-
_context.next =
|
|
161
|
+
_context.next = 26;
|
|
156
162
|
break;
|
|
157
|
-
case
|
|
158
|
-
_context.prev =
|
|
163
|
+
case 23:
|
|
164
|
+
_context.prev = 23;
|
|
159
165
|
_context.t0 = _context["catch"](2);
|
|
160
166
|
this.setState({
|
|
161
167
|
content: Outcome.failed(new MediaViewerError('videoviewer-fetch-url', _context.t0 instanceof Error ? _context.t0 : undefined))
|
|
162
168
|
});
|
|
163
|
-
case
|
|
169
|
+
case 26:
|
|
164
170
|
case "end":
|
|
165
171
|
return _context.stop();
|
|
166
172
|
}
|
|
167
|
-
}, _callee, this, [[2,
|
|
173
|
+
}, _callee, this, [[2, 23]]);
|
|
168
174
|
}));
|
|
169
175
|
function init() {
|
|
170
176
|
return _init.apply(this, arguments);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "49.2.
|
|
3
|
+
"version": "49.2.7",
|
|
4
4
|
"description": "MediaViewer is Atlassian's powerful solution for viewing files on the web. It's both powerful and extendable yet easy-to-integrate",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/spinner": "^16.3.0",
|
|
52
52
|
"@atlaskit/textfield": "^6.5.0",
|
|
53
53
|
"@atlaskit/theme": "^14.0.0",
|
|
54
|
-
"@atlaskit/tokens": "^2.
|
|
54
|
+
"@atlaskit/tokens": "^2.2.0",
|
|
55
55
|
"@atlaskit/ufo": "^0.3.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"@kenjiuno/msgreader": "^1.2.6",
|