File tree Expand file tree Collapse file tree 3 files changed +7
-21
lines changed Expand file tree Collapse file tree 3 files changed +7
-21
lines changed Original file line number Diff line number Diff line change 3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- html , body {
6
+ html {
7
7
width : 100% ;
8
8
height : 100% ;
9
9
text-align : center;
10
10
}
11
11
12
12
body {
13
13
padding : 5px 10px ;
14
- box-sizing : border-box;
15
- -webkit-user-select : none;
16
- user-select : none;
17
- }
18
-
19
- .video-container {
20
- height : 100% ;
21
- display : flex;
22
- justify-content : center;
23
- align-items : center;
24
- }
25
-
26
- .container .loading ,
27
- .container .error {
14
+ width : calc (100% - 20px );
15
+ height : calc (100% - 10px );
28
16
display : flex;
29
17
justify-content : center;
30
18
align-items : center;
19
+ -webkit-user-select : none;
20
+ user-select : none;
31
21
}
32
22
33
23
.loading-indicator {
Original file line number Diff line number Diff line change 26
26
let hasLoadedMedia = false ;
27
27
28
28
// Elements
29
- const container = document . createElement ( 'div' ) ;
30
- container . className = 'video-container' ;
31
- document . body . appendChild ( container ) ;
32
-
33
29
const video = document . createElement ( 'video' ) ;
34
30
if ( settings . src !== null ) {
35
31
video . src = settings . src ;
44
40
45
41
document . body . classList . remove ( 'loading' ) ;
46
42
document . body . classList . add ( 'ready' ) ;
47
- container . append ( video ) ;
43
+ document . body . append ( video ) ;
48
44
}
49
45
50
46
video . addEventListener ( 'error' , e => {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ class VideoPreview extends MediaPreview {
79
79
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src data: ${ cspSource } ; media-src ${ cspSource } ; script-src 'nonce-${ nonce } '; style-src ${ cspSource } 'nonce-${ nonce } ';">
80
80
<meta id="settings" data-settings="${ escapeAttribute ( JSON . stringify ( settings ) ) } ">
81
81
</head>
82
- <body class="container loading">
82
+ <body class="loading">
83
83
<div class="loading-indicator"></div>
84
84
<div class="loading-error">
85
85
<p>${ localize ( 'preview.videoLoadError' , "An error occurred while loading the video file." ) } </p>
You can’t perform that action at this time.
0 commit comments