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 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- html , body {
6+ html {
77 width : 100% ;
88 height : 100% ;
99 text-align : center;
1010}
1111
1212body {
1313 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 );
2816 display : flex;
2917 justify-content : center;
3018 align-items : center;
19+ -webkit-user-select : none;
20+ user-select : none;
3121}
3222
3323.loading-indicator {
Original file line number Diff line number Diff line change 2626 let hasLoadedMedia = false ;
2727
2828 // Elements
29- const container = document . createElement ( 'div' ) ;
30- container . className = 'video-container' ;
31- document . body . appendChild ( container ) ;
32-
3329 const video = document . createElement ( 'video' ) ;
3430 if ( settings . src !== null ) {
3531 video . src = settings . src ;
4440
4541 document . body . classList . remove ( 'loading' ) ;
4642 document . body . classList . add ( 'ready' ) ;
47- container . append ( video ) ;
43+ document . body . append ( video ) ;
4844 }
4945
5046 video . addEventListener ( 'error' , e => {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ class VideoPreview extends MediaPreview {
7979 <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 } ';">
8080 <meta id="settings" data-settings="${ escapeAttribute ( JSON . stringify ( settings ) ) } ">
8181</head>
82- <body class="container loading">
82+ <body class="loading">
8383 <div class="loading-indicator"></div>
8484 <div class="loading-error">
8585 <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