This repository was archived by the owner on Feb 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
src/components/slides/deckdeckgo-slide-youtube Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,13 @@ export class DeckdeckgoSlideYoutube implements DeckdeckgoSlide {
5353
5454 @Method ( )
5555 lazyLoadContent ( ) : Promise < void > {
56- return DeckdeckgoSlideUtils . lazyLoadContent ( this . el ) ;
56+ return new Promise < void > ( async ( resolve ) => {
57+ await DeckdeckgoSlideUtils . lazyLoadContent ( this . el ) ;
58+
59+ await this . resizeContent ( ) ;
60+
61+ resolve ( ) ;
62+ } ) ;
5763 }
5864
5965 @Method ( )
@@ -125,12 +131,16 @@ export class DeckdeckgoSlideYoutube implements DeckdeckgoSlide {
125131 private onResizeContent = async ( ) => {
126132 await this . initSize ( ) ;
127133
134+ await this . resizeContent ( ) ;
135+ } ;
136+
137+ private async resizeContent ( ) {
128138 const element : HTMLDeckgoYoutubeElement = this . el . shadowRoot . querySelector ( 'deckgo-youtube' ) ;
129139
130140 if ( element ) {
131141 await element . updateIFrame ( this . videoWidth , this . videoHeight ) ;
132142 }
133- } ;
143+ }
134144
135145 render ( ) {
136146 return < div class = "deckgo-slide" >
@@ -143,11 +153,7 @@ export class DeckdeckgoSlideYoutube implements DeckdeckgoSlide {
143153 }
144154
145155 private renderVideo ( ) {
146- if ( ! this . videoWidth || ! this . videoHeight ) {
147- return undefined ;
148- } else {
149- return < deckgo-youtube src = { this . src } width = { this . videoWidth } height = { this . videoHeight } frame-title = { this . frameTitle } > </ deckgo-youtube >
150- }
156+ return < deckgo-youtube src = { this . src } width = { this . videoWidth } height = { this . videoHeight } frame-title = { this . frameTitle } > </ deckgo-youtube >
151157 }
152158
153159 hostData ( ) {
You can’t perform that action at this time.
0 commit comments