superembed.js icon indicating copy to clipboard operation
superembed.js copied to clipboard

Youtube screen only resizes to correct aspect ratio when I resize the browser

Open Aeroxander opened this issue 9 years ago • 6 comments

Like I said in the title, when I startup my site it still has black bars, it works well after I resize the window though... I've got an Div over the iFrame, that shouldn't be an issue right?

Aeroxander avatar Oct 14 '16 11:10 Aeroxander

That would be caused by the DOMContentLoaded event not firing correctly. Try placing the SuperEmbed script tag at the bottom of

and see what happens. If that doesn't work, you could try loading JQuery on your page before SuperEmbed, so it will use JQuery to determine when the page is done loading.

corbindavenport avatar Oct 14 '16 14:10 corbindavenport

Tried both, sadly still not working. I'm going to use an pop-up effect anyway so it doesn't matter personally. Need some code or dodo you know why it doesn't work?

Aeroxander avatar Oct 15 '16 21:10 Aeroxander

Is the video loaded dynamically (after page load)?

corbindavenport avatar Oct 15 '16 21:10 corbindavenport

Yeah it is, I use the youtube API

Aeroxander avatar Oct 16 '16 10:10 Aeroxander

Ah okay. SuperEmbed doesn't work right away with dynamically-added content. I'll try to add some sort of workaround for this.

corbindavenport avatar Oct 21 '16 22:10 corbindavenport

I think this plugin need calling and force the width and height of iframe to correct Aspect Ratio ;)

Uranbold avatar Jan 11 '17 10:01 Uranbold