@atlaskit/media-viewer 52.7.2 → 52.7.4
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 +14 -0
- package/dist/cjs/viewers/video.js +23 -54
- package/dist/es2019/viewers/video.js +5 -30
- package/dist/esm/viewers/video.js +23 -54
- package/dist/types/viewers/codeViewer/styles.d.ts +3 -3
- package/dist/types/viewers/video.d.ts +1 -4
- package/dist/types-ts4.5/viewers/codeViewer/styles.d.ts +3 -3
- package/dist/types-ts4.5/viewers/video.d.ts +1 -4
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/media-viewer
|
|
2
2
|
|
|
3
|
+
## 52.7.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 52.7.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4785b4823f2b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4785b4823f2b6) -
|
|
14
|
+
Removed platform_media_disable_video_640p_artifact_usage FG
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 52.7.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -25,9 +25,7 @@ var _getObjectUrlFromFileState = require("../utils/getObjectUrlFromFileState");
|
|
|
25
25
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
26
|
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)); }
|
|
27
27
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
28
|
-
var sdArtifact = 'video_640.mp4';
|
|
29
28
|
var hdArtifact = 'video_1280.mp4';
|
|
30
|
-
var localStorageKeyName = 'mv_video_player_quality';
|
|
31
29
|
var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
32
30
|
function VideoViewer() {
|
|
33
31
|
var _this;
|
|
@@ -36,15 +34,6 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
36
34
|
args[_key] = arguments[_key];
|
|
37
35
|
}
|
|
38
36
|
_this = _callSuper(this, VideoViewer, [].concat(args));
|
|
39
|
-
(0, _defineProperty2.default)(_this, "onHDChange", function () {
|
|
40
|
-
var isHDActive = !_this.state.isHDActive;
|
|
41
|
-
var preferredQuality = isHDActive ? 'hd' : 'sd';
|
|
42
|
-
localStorage.setItem(localStorageKeyName, preferredQuality);
|
|
43
|
-
_this.setState({
|
|
44
|
-
isHDActive: isHDActive
|
|
45
|
-
});
|
|
46
|
-
_this.init(isHDActive);
|
|
47
|
-
});
|
|
48
37
|
(0, _defineProperty2.default)(_this, "onFirstPlay", function () {
|
|
49
38
|
var _this$props = _this.props,
|
|
50
39
|
item = _this$props.item,
|
|
@@ -75,17 +64,13 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
75
64
|
return (0, _createClass2.default)(VideoViewer, [{
|
|
76
65
|
key: "initialState",
|
|
77
66
|
get: function get() {
|
|
78
|
-
var item = this.props.item;
|
|
79
|
-
var preferredQuality = (0, _platformFeatureFlags.fg)('platform_media_disable_video_640p_artifact_usage') ? 'hd' : localStorage.getItem(localStorageKeyName);
|
|
80
67
|
return {
|
|
81
|
-
content: _domain.Outcome.pending()
|
|
82
|
-
isHDActive: isHDAvailable(item) && preferredQuality !== 'sd'
|
|
68
|
+
content: _domain.Outcome.pending()
|
|
83
69
|
};
|
|
84
70
|
}
|
|
85
71
|
}, {
|
|
86
72
|
key: "renderSuccessful",
|
|
87
73
|
value: function renderSuccessful(content) {
|
|
88
|
-
var isHDActive = this.state.isHDActive;
|
|
89
74
|
var _this$props2 = this.props,
|
|
90
75
|
item = _this$props2.item,
|
|
91
76
|
showControls = _this$props2.showControls,
|
|
@@ -94,17 +79,15 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
94
79
|
var useCustomVideoPlayer = !(0, _isIE.isIE)();
|
|
95
80
|
var isAutoPlay = previewCount === 0;
|
|
96
81
|
var hdAvailable = isHDAvailable(item);
|
|
97
|
-
var hdActiveOverride = (0, _platformFeatureFlags.fg)('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
98
82
|
return useCustomVideoPlayer ? /*#__PURE__*/_react.default.createElement(_styleWrappers.CustomVideoPlayerWrapper, {
|
|
99
83
|
"data-testid": "media-viewer-video-content"
|
|
100
84
|
}, (0, _mediaClient.isFileIdentifier)(identifier) && (0, _platformFeatureFlags.fg)('platform_media_video_captions') ? /*#__PURE__*/_react.default.createElement(_mediaUi.MediaPlayer, {
|
|
101
85
|
identifier: identifier,
|
|
102
86
|
type: "video",
|
|
103
87
|
isAutoPlay: isAutoPlay,
|
|
104
|
-
onHDToggleClick: this.onHDChange,
|
|
105
88
|
showControls: showControls,
|
|
106
89
|
src: content,
|
|
107
|
-
isHDActive:
|
|
90
|
+
isHDActive: hdAvailable,
|
|
108
91
|
isHDAvailable: hdAvailable,
|
|
109
92
|
isShortcutEnabled: true,
|
|
110
93
|
onFirstPlay: this.onFirstPlay,
|
|
@@ -117,11 +100,10 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
117
100
|
}) : /*#__PURE__*/_react.default.createElement(_mediaUi.CustomMediaPlayer, {
|
|
118
101
|
type: "video",
|
|
119
102
|
isAutoPlay: isAutoPlay,
|
|
120
|
-
onHDToggleClick: this.onHDChange,
|
|
121
103
|
showControls: showControls,
|
|
122
104
|
src: content,
|
|
123
105
|
fileId: item.id,
|
|
124
|
-
isHDActive:
|
|
106
|
+
isHDActive: hdAvailable,
|
|
125
107
|
isHDAvailable: hdAvailable,
|
|
126
108
|
isShortcutEnabled: true,
|
|
127
109
|
onFirstPlay: this.onFirstPlay,
|
|
@@ -141,71 +123,58 @@ var VideoViewer = exports.VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
141
123
|
key: "init",
|
|
142
124
|
value: function () {
|
|
143
125
|
var _init = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
144
|
-
var
|
|
145
|
-
_this$props3,
|
|
146
|
-
mediaClient,
|
|
147
|
-
item,
|
|
148
|
-
collectionName,
|
|
149
|
-
contentUrl,
|
|
150
|
-
hdAvailable,
|
|
151
|
-
hdActiveOverride,
|
|
152
|
-
preferHd,
|
|
153
|
-
_args = arguments;
|
|
126
|
+
var _this$props3, mediaClient, item, collectionName, contentUrl;
|
|
154
127
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
155
128
|
while (1) switch (_context.prev = _context.next) {
|
|
156
129
|
case 0:
|
|
157
|
-
isHDActive = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.state.isHDActive;
|
|
158
130
|
_this$props3 = this.props, mediaClient = _this$props3.mediaClient, item = _this$props3.item, collectionName = _this$props3.collectionName;
|
|
159
|
-
_context.prev =
|
|
131
|
+
_context.prev = 1;
|
|
160
132
|
if (!(item.status === 'processed')) {
|
|
161
|
-
_context.next =
|
|
133
|
+
_context.next = 10;
|
|
162
134
|
break;
|
|
163
135
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
_context.next = 9;
|
|
168
|
-
return mediaClient.file.getArtifactURL(item.artifacts, preferHd ? hdArtifact : sdArtifact, collectionName);
|
|
169
|
-
case 9:
|
|
136
|
+
_context.next = 5;
|
|
137
|
+
return mediaClient.file.getArtifactURL(item.artifacts, hdArtifact, collectionName);
|
|
138
|
+
case 5:
|
|
170
139
|
contentUrl = _context.sent;
|
|
171
140
|
if (contentUrl) {
|
|
172
|
-
_context.next =
|
|
141
|
+
_context.next = 8;
|
|
173
142
|
break;
|
|
174
143
|
}
|
|
175
144
|
throw new _errors.MediaViewerError("videoviewer-missing-artefact");
|
|
176
|
-
case
|
|
177
|
-
_context.next = 20;
|
|
178
|
-
break;
|
|
179
|
-
case 14:
|
|
145
|
+
case 8:
|
|
180
146
|
_context.next = 16;
|
|
147
|
+
break;
|
|
148
|
+
case 10:
|
|
149
|
+
_context.next = 12;
|
|
181
150
|
return (0, _getObjectUrlFromFileState.getObjectUrlFromFileState)(item);
|
|
182
|
-
case
|
|
151
|
+
case 12:
|
|
183
152
|
contentUrl = _context.sent;
|
|
184
153
|
if (contentUrl) {
|
|
185
|
-
_context.next =
|
|
154
|
+
_context.next = 16;
|
|
186
155
|
break;
|
|
187
156
|
}
|
|
188
157
|
this.setState({
|
|
189
158
|
content: _domain.Outcome.pending()
|
|
190
159
|
});
|
|
191
160
|
return _context.abrupt("return");
|
|
192
|
-
case
|
|
161
|
+
case 16:
|
|
193
162
|
this.setState({
|
|
194
163
|
content: _domain.Outcome.successful(contentUrl)
|
|
195
164
|
});
|
|
196
|
-
_context.next =
|
|
165
|
+
_context.next = 22;
|
|
197
166
|
break;
|
|
198
|
-
case
|
|
199
|
-
_context.prev =
|
|
200
|
-
_context.t0 = _context["catch"](
|
|
167
|
+
case 19:
|
|
168
|
+
_context.prev = 19;
|
|
169
|
+
_context.t0 = _context["catch"](1);
|
|
201
170
|
this.setState({
|
|
202
171
|
content: _domain.Outcome.failed(new _errors.MediaViewerError('videoviewer-fetch-url', _context.t0 instanceof Error ? _context.t0 : undefined))
|
|
203
172
|
});
|
|
204
|
-
case
|
|
173
|
+
case 22:
|
|
205
174
|
case "end":
|
|
206
175
|
return _context.stop();
|
|
207
176
|
}
|
|
208
|
-
}, _callee, this, [[
|
|
177
|
+
}, _callee, this, [[1, 19]]);
|
|
209
178
|
}));
|
|
210
179
|
function init() {
|
|
211
180
|
return _init.apply(this, arguments);
|
|
@@ -9,21 +9,10 @@ import { isIE } from '../utils/isIE';
|
|
|
9
9
|
import { BaseViewer } from './base-viewer';
|
|
10
10
|
import { getObjectUrlFromFileState } from '../utils/getObjectUrlFromFileState';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
-
const sdArtifact = 'video_640.mp4';
|
|
13
12
|
const hdArtifact = 'video_1280.mp4';
|
|
14
|
-
const localStorageKeyName = 'mv_video_player_quality';
|
|
15
13
|
export class VideoViewer extends BaseViewer {
|
|
16
14
|
constructor(...args) {
|
|
17
15
|
super(...args);
|
|
18
|
-
_defineProperty(this, "onHDChange", () => {
|
|
19
|
-
const isHDActive = !this.state.isHDActive;
|
|
20
|
-
const preferredQuality = isHDActive ? 'hd' : 'sd';
|
|
21
|
-
localStorage.setItem(localStorageKeyName, preferredQuality);
|
|
22
|
-
this.setState({
|
|
23
|
-
isHDActive
|
|
24
|
-
});
|
|
25
|
-
this.init(isHDActive);
|
|
26
|
-
});
|
|
27
16
|
_defineProperty(this, "onFirstPlay", () => {
|
|
28
17
|
const {
|
|
29
18
|
item,
|
|
@@ -53,19 +42,11 @@ export class VideoViewer extends BaseViewer {
|
|
|
53
42
|
});
|
|
54
43
|
}
|
|
55
44
|
get initialState() {
|
|
56
|
-
const {
|
|
57
|
-
item
|
|
58
|
-
} = this.props;
|
|
59
|
-
const preferredQuality = fg('platform_media_disable_video_640p_artifact_usage') ? 'hd' : localStorage.getItem(localStorageKeyName);
|
|
60
45
|
return {
|
|
61
|
-
content: Outcome.pending()
|
|
62
|
-
isHDActive: isHDAvailable(item) && preferredQuality !== 'sd'
|
|
46
|
+
content: Outcome.pending()
|
|
63
47
|
};
|
|
64
48
|
}
|
|
65
49
|
renderSuccessful(content) {
|
|
66
|
-
const {
|
|
67
|
-
isHDActive
|
|
68
|
-
} = this.state;
|
|
69
50
|
const {
|
|
70
51
|
item,
|
|
71
52
|
showControls,
|
|
@@ -75,17 +56,15 @@ export class VideoViewer extends BaseViewer {
|
|
|
75
56
|
const useCustomVideoPlayer = !isIE();
|
|
76
57
|
const isAutoPlay = previewCount === 0;
|
|
77
58
|
const hdAvailable = isHDAvailable(item);
|
|
78
|
-
const hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
79
59
|
return useCustomVideoPlayer ? /*#__PURE__*/React.createElement(CustomVideoPlayerWrapper, {
|
|
80
60
|
"data-testid": "media-viewer-video-content"
|
|
81
61
|
}, isFileIdentifier(identifier) && fg('platform_media_video_captions') ? /*#__PURE__*/React.createElement(MediaPlayer, {
|
|
82
62
|
identifier: identifier,
|
|
83
63
|
type: "video",
|
|
84
64
|
isAutoPlay: isAutoPlay,
|
|
85
|
-
onHDToggleClick: this.onHDChange,
|
|
86
65
|
showControls: showControls,
|
|
87
66
|
src: content,
|
|
88
|
-
isHDActive:
|
|
67
|
+
isHDActive: hdAvailable,
|
|
89
68
|
isHDAvailable: hdAvailable,
|
|
90
69
|
isShortcutEnabled: true,
|
|
91
70
|
onFirstPlay: this.onFirstPlay,
|
|
@@ -98,11 +77,10 @@ export class VideoViewer extends BaseViewer {
|
|
|
98
77
|
}) : /*#__PURE__*/React.createElement(CustomMediaPlayer, {
|
|
99
78
|
type: "video",
|
|
100
79
|
isAutoPlay: isAutoPlay,
|
|
101
|
-
onHDToggleClick: this.onHDChange,
|
|
102
80
|
showControls: showControls,
|
|
103
81
|
src: content,
|
|
104
82
|
fileId: item.id,
|
|
105
|
-
isHDActive:
|
|
83
|
+
isHDActive: hdAvailable,
|
|
106
84
|
isHDAvailable: hdAvailable,
|
|
107
85
|
isShortcutEnabled: true,
|
|
108
86
|
onFirstPlay: this.onFirstPlay,
|
|
@@ -118,7 +96,7 @@ export class VideoViewer extends BaseViewer {
|
|
|
118
96
|
src: content
|
|
119
97
|
});
|
|
120
98
|
}
|
|
121
|
-
async init(
|
|
99
|
+
async init() {
|
|
122
100
|
const {
|
|
123
101
|
mediaClient,
|
|
124
102
|
item,
|
|
@@ -127,10 +105,7 @@ export class VideoViewer extends BaseViewer {
|
|
|
127
105
|
try {
|
|
128
106
|
let contentUrl;
|
|
129
107
|
if (item.status === 'processed') {
|
|
130
|
-
|
|
131
|
-
const hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
132
|
-
const preferHd = hdActiveOverride && hdAvailable;
|
|
133
|
-
contentUrl = await mediaClient.file.getArtifactURL(item.artifacts, preferHd ? hdArtifact : sdArtifact, collectionName);
|
|
108
|
+
contentUrl = await mediaClient.file.getArtifactURL(item.artifacts, hdArtifact, collectionName);
|
|
134
109
|
if (!contentUrl) {
|
|
135
110
|
throw new MediaViewerError(`videoviewer-missing-artefact`);
|
|
136
111
|
}
|
|
@@ -18,9 +18,7 @@ import { isIE } from '../utils/isIE';
|
|
|
18
18
|
import { BaseViewer } from './base-viewer';
|
|
19
19
|
import { getObjectUrlFromFileState } from '../utils/getObjectUrlFromFileState';
|
|
20
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
|
-
var sdArtifact = 'video_640.mp4';
|
|
22
21
|
var hdArtifact = 'video_1280.mp4';
|
|
23
|
-
var localStorageKeyName = 'mv_video_player_quality';
|
|
24
22
|
export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
25
23
|
function VideoViewer() {
|
|
26
24
|
var _this;
|
|
@@ -29,15 +27,6 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
29
27
|
args[_key] = arguments[_key];
|
|
30
28
|
}
|
|
31
29
|
_this = _callSuper(this, VideoViewer, [].concat(args));
|
|
32
|
-
_defineProperty(_this, "onHDChange", function () {
|
|
33
|
-
var isHDActive = !_this.state.isHDActive;
|
|
34
|
-
var preferredQuality = isHDActive ? 'hd' : 'sd';
|
|
35
|
-
localStorage.setItem(localStorageKeyName, preferredQuality);
|
|
36
|
-
_this.setState({
|
|
37
|
-
isHDActive: isHDActive
|
|
38
|
-
});
|
|
39
|
-
_this.init(isHDActive);
|
|
40
|
-
});
|
|
41
30
|
_defineProperty(_this, "onFirstPlay", function () {
|
|
42
31
|
var _this$props = _this.props,
|
|
43
32
|
item = _this$props.item,
|
|
@@ -68,17 +57,13 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
68
57
|
return _createClass(VideoViewer, [{
|
|
69
58
|
key: "initialState",
|
|
70
59
|
get: function get() {
|
|
71
|
-
var item = this.props.item;
|
|
72
|
-
var preferredQuality = fg('platform_media_disable_video_640p_artifact_usage') ? 'hd' : localStorage.getItem(localStorageKeyName);
|
|
73
60
|
return {
|
|
74
|
-
content: Outcome.pending()
|
|
75
|
-
isHDActive: isHDAvailable(item) && preferredQuality !== 'sd'
|
|
61
|
+
content: Outcome.pending()
|
|
76
62
|
};
|
|
77
63
|
}
|
|
78
64
|
}, {
|
|
79
65
|
key: "renderSuccessful",
|
|
80
66
|
value: function renderSuccessful(content) {
|
|
81
|
-
var isHDActive = this.state.isHDActive;
|
|
82
67
|
var _this$props2 = this.props,
|
|
83
68
|
item = _this$props2.item,
|
|
84
69
|
showControls = _this$props2.showControls,
|
|
@@ -87,17 +72,15 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
87
72
|
var useCustomVideoPlayer = !isIE();
|
|
88
73
|
var isAutoPlay = previewCount === 0;
|
|
89
74
|
var hdAvailable = isHDAvailable(item);
|
|
90
|
-
var hdActiveOverride = fg('platform_media_disable_video_640p_artifact_usage') ? hdAvailable : isHDActive;
|
|
91
75
|
return useCustomVideoPlayer ? /*#__PURE__*/React.createElement(CustomVideoPlayerWrapper, {
|
|
92
76
|
"data-testid": "media-viewer-video-content"
|
|
93
77
|
}, isFileIdentifier(identifier) && fg('platform_media_video_captions') ? /*#__PURE__*/React.createElement(MediaPlayer, {
|
|
94
78
|
identifier: identifier,
|
|
95
79
|
type: "video",
|
|
96
80
|
isAutoPlay: isAutoPlay,
|
|
97
|
-
onHDToggleClick: this.onHDChange,
|
|
98
81
|
showControls: showControls,
|
|
99
82
|
src: content,
|
|
100
|
-
isHDActive:
|
|
83
|
+
isHDActive: hdAvailable,
|
|
101
84
|
isHDAvailable: hdAvailable,
|
|
102
85
|
isShortcutEnabled: true,
|
|
103
86
|
onFirstPlay: this.onFirstPlay,
|
|
@@ -110,11 +93,10 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
110
93
|
}) : /*#__PURE__*/React.createElement(CustomMediaPlayer, {
|
|
111
94
|
type: "video",
|
|
112
95
|
isAutoPlay: isAutoPlay,
|
|
113
|
-
onHDToggleClick: this.onHDChange,
|
|
114
96
|
showControls: showControls,
|
|
115
97
|
src: content,
|
|
116
98
|
fileId: item.id,
|
|
117
|
-
isHDActive:
|
|
99
|
+
isHDActive: hdAvailable,
|
|
118
100
|
isHDAvailable: hdAvailable,
|
|
119
101
|
isShortcutEnabled: true,
|
|
120
102
|
onFirstPlay: this.onFirstPlay,
|
|
@@ -134,71 +116,58 @@ export var VideoViewer = /*#__PURE__*/function (_BaseViewer) {
|
|
|
134
116
|
key: "init",
|
|
135
117
|
value: function () {
|
|
136
118
|
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
137
|
-
var
|
|
138
|
-
_this$props3,
|
|
139
|
-
mediaClient,
|
|
140
|
-
item,
|
|
141
|
-
collectionName,
|
|
142
|
-
contentUrl,
|
|
143
|
-
hdAvailable,
|
|
144
|
-
hdActiveOverride,
|
|
145
|
-
preferHd,
|
|
146
|
-
_args = arguments;
|
|
119
|
+
var _this$props3, mediaClient, item, collectionName, contentUrl;
|
|
147
120
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
148
121
|
while (1) switch (_context.prev = _context.next) {
|
|
149
122
|
case 0:
|
|
150
|
-
isHDActive = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.state.isHDActive;
|
|
151
123
|
_this$props3 = this.props, mediaClient = _this$props3.mediaClient, item = _this$props3.item, collectionName = _this$props3.collectionName;
|
|
152
|
-
_context.prev =
|
|
124
|
+
_context.prev = 1;
|
|
153
125
|
if (!(item.status === 'processed')) {
|
|
154
|
-
_context.next =
|
|
126
|
+
_context.next = 10;
|
|
155
127
|
break;
|
|
156
128
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
_context.next = 9;
|
|
161
|
-
return mediaClient.file.getArtifactURL(item.artifacts, preferHd ? hdArtifact : sdArtifact, collectionName);
|
|
162
|
-
case 9:
|
|
129
|
+
_context.next = 5;
|
|
130
|
+
return mediaClient.file.getArtifactURL(item.artifacts, hdArtifact, collectionName);
|
|
131
|
+
case 5:
|
|
163
132
|
contentUrl = _context.sent;
|
|
164
133
|
if (contentUrl) {
|
|
165
|
-
_context.next =
|
|
134
|
+
_context.next = 8;
|
|
166
135
|
break;
|
|
167
136
|
}
|
|
168
137
|
throw new MediaViewerError("videoviewer-missing-artefact");
|
|
169
|
-
case
|
|
170
|
-
_context.next = 20;
|
|
171
|
-
break;
|
|
172
|
-
case 14:
|
|
138
|
+
case 8:
|
|
173
139
|
_context.next = 16;
|
|
140
|
+
break;
|
|
141
|
+
case 10:
|
|
142
|
+
_context.next = 12;
|
|
174
143
|
return getObjectUrlFromFileState(item);
|
|
175
|
-
case
|
|
144
|
+
case 12:
|
|
176
145
|
contentUrl = _context.sent;
|
|
177
146
|
if (contentUrl) {
|
|
178
|
-
_context.next =
|
|
147
|
+
_context.next = 16;
|
|
179
148
|
break;
|
|
180
149
|
}
|
|
181
150
|
this.setState({
|
|
182
151
|
content: Outcome.pending()
|
|
183
152
|
});
|
|
184
153
|
return _context.abrupt("return");
|
|
185
|
-
case
|
|
154
|
+
case 16:
|
|
186
155
|
this.setState({
|
|
187
156
|
content: Outcome.successful(contentUrl)
|
|
188
157
|
});
|
|
189
|
-
_context.next =
|
|
158
|
+
_context.next = 22;
|
|
190
159
|
break;
|
|
191
|
-
case
|
|
192
|
-
_context.prev =
|
|
193
|
-
_context.t0 = _context["catch"](
|
|
160
|
+
case 19:
|
|
161
|
+
_context.prev = 19;
|
|
162
|
+
_context.t0 = _context["catch"](1);
|
|
194
163
|
this.setState({
|
|
195
164
|
content: Outcome.failed(new MediaViewerError('videoviewer-fetch-url', _context.t0 instanceof Error ? _context.t0 : undefined))
|
|
196
165
|
});
|
|
197
|
-
case
|
|
166
|
+
case 22:
|
|
198
167
|
case "end":
|
|
199
168
|
return _context.stop();
|
|
200
169
|
}
|
|
201
|
-
}, _callee, this, [[
|
|
170
|
+
}, _callee, this, [[1, 19]]);
|
|
202
171
|
}));
|
|
203
172
|
function init() {
|
|
204
173
|
return _init.apply(this, arguments);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const codeViewWrapperStyles: import("@emotion/
|
|
2
|
-
export declare const codeViewerHeaderBarStyles: import("@emotion/
|
|
3
|
-
export declare const codeViewerHTMLStyles: import("@emotion/
|
|
1
|
+
export declare const codeViewWrapperStyles: import("@emotion/utils").SerializedStyles;
|
|
2
|
+
export declare const codeViewerHeaderBarStyles: import("@emotion/utils").SerializedStyles;
|
|
3
|
+
export declare const codeViewerHTMLStyles: import("@emotion/utils").SerializedStyles;
|
|
@@ -16,20 +16,17 @@ export type Props = Readonly<{
|
|
|
16
16
|
traceContext: MediaTraceContext;
|
|
17
17
|
} & WithShowControlMethodProp>;
|
|
18
18
|
export type State = BaseState<string> & {
|
|
19
|
-
isHDActive: boolean;
|
|
20
19
|
coverUrl?: string;
|
|
21
20
|
};
|
|
22
21
|
export declare class VideoViewer extends BaseViewer<string, Props, State> {
|
|
23
22
|
protected get initialState(): {
|
|
24
23
|
content: Outcome<string, MediaViewerError>;
|
|
25
|
-
isHDActive: boolean;
|
|
26
24
|
};
|
|
27
|
-
private onHDChange;
|
|
28
25
|
private onFirstPlay;
|
|
29
26
|
private onPlay;
|
|
30
27
|
private onTimeChanged;
|
|
31
28
|
private onError;
|
|
32
29
|
protected renderSuccessful(content: string): React.JSX.Element;
|
|
33
|
-
protected init(
|
|
30
|
+
protected init(): Promise<void>;
|
|
34
31
|
protected release(): void;
|
|
35
32
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const codeViewWrapperStyles: import("@emotion/
|
|
2
|
-
export declare const codeViewerHeaderBarStyles: import("@emotion/
|
|
3
|
-
export declare const codeViewerHTMLStyles: import("@emotion/
|
|
1
|
+
export declare const codeViewWrapperStyles: import("@emotion/utils").SerializedStyles;
|
|
2
|
+
export declare const codeViewerHeaderBarStyles: import("@emotion/utils").SerializedStyles;
|
|
3
|
+
export declare const codeViewerHTMLStyles: import("@emotion/utils").SerializedStyles;
|
|
@@ -16,20 +16,17 @@ export type Props = Readonly<{
|
|
|
16
16
|
traceContext: MediaTraceContext;
|
|
17
17
|
} & WithShowControlMethodProp>;
|
|
18
18
|
export type State = BaseState<string> & {
|
|
19
|
-
isHDActive: boolean;
|
|
20
19
|
coverUrl?: string;
|
|
21
20
|
};
|
|
22
21
|
export declare class VideoViewer extends BaseViewer<string, Props, State> {
|
|
23
22
|
protected get initialState(): {
|
|
24
23
|
content: Outcome<string, MediaViewerError>;
|
|
25
|
-
isHDActive: boolean;
|
|
26
24
|
};
|
|
27
|
-
private onHDChange;
|
|
28
25
|
private onFirstPlay;
|
|
29
26
|
private onPlay;
|
|
30
27
|
private onTimeChanged;
|
|
31
28
|
private onError;
|
|
32
29
|
protected renderSuccessful(content: string): React.JSX.Element;
|
|
33
|
-
protected init(
|
|
30
|
+
protected init(): Promise<void>;
|
|
34
31
|
protected release(): void;
|
|
35
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-viewer",
|
|
3
|
-
"version": "52.7.
|
|
3
|
+
"version": "52.7.4",
|
|
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/"
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@atlaskit/code": "^17.4.0",
|
|
37
37
|
"@atlaskit/css": "^0.19.0",
|
|
38
38
|
"@atlaskit/form": "^15.3.0",
|
|
39
|
-
"@atlaskit/heading": "^5.
|
|
40
|
-
"@atlaskit/icon": "^
|
|
39
|
+
"@atlaskit/heading": "^5.3.0",
|
|
40
|
+
"@atlaskit/icon": "^31.0.0",
|
|
41
41
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
42
|
-
"@atlaskit/icon-lab": "^5.
|
|
42
|
+
"@atlaskit/icon-lab": "^5.16.0",
|
|
43
43
|
"@atlaskit/media-client": "^35.7.0",
|
|
44
44
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
45
45
|
"@atlaskit/media-common": "^12.3.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@atlaskit/media-test-helpers": "^39.0.0",
|
|
92
92
|
"@atlaskit/ssr": "workspace:^",
|
|
93
93
|
"@atlaskit/toggle": "^15.2.0",
|
|
94
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
94
|
+
"@atlassian/a11y-jest-testing": "^0.10.0",
|
|
95
95
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
96
96
|
"@atlassian/ufo": "^0.7.0",
|
|
97
97
|
"@testing-library/dom": "^10.1.0",
|
|
@@ -110,9 +110,6 @@
|
|
|
110
110
|
"wait-for-expect": "^1.2.0"
|
|
111
111
|
},
|
|
112
112
|
"platform-feature-flags": {
|
|
113
|
-
"platform_media_disable_video_640p_artifact_usage": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
113
|
"platform_media_video_captions": {
|
|
117
114
|
"type": "boolean"
|
|
118
115
|
},
|