Is there some setting to control how large the youtube video appears in the lightbox? it seems smaller than it is on the main Youtube page on my screen.

Comments

SuperRookie’s picture

I've noticed that for some reason it's pulling the minimum size Youtube video (560 wide) despite the embed code.

sgabe’s picture

I always get 220*165, no matter what size I set for any view mode...

jkaine’s picture

I had similar problems, but was able to hack a work-around with some CSS.

Set your desired height and width for the video on the following:

  • object
  • embed
  • .media-youtube-outer-wrapper

Here's my CSS:

.field-name-field-image-gallery-3-title .video-right-320 object, .field-name-field-image-gallery-3-title .video-right-320 embed, .field-name-field-image-gallery-3-title .video-right-320 .media-youtube-outer-wrapper {
	width: 320px !important;
	height: 205px !important;
}

Adjust height and width as needed.

Not an ideal solution, but might get you through temporarily.

RobW’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

220x165 makes me think Lightbox is probably stripping the width and height attributes from the YouTube embed.

To fix, first update to Media: YouTube 2.x, which has configurable height and width attributes that can be overridden with css without !importants.
Then add width:{yourwidth}; height:auto; css targeting the YouTube iframe embed, where {yourwidth} is the width you want.

You might also want to check what view mode the gallery module is using, and check the formatter settings in Structure -> file types -> manage file display.

Beyond this, it's probably an issue for the Lightbox queue.

sheldonkreger’s picture

I was able to resize the Youtube video display with the following CSS:

.media-youtube-preview-wrapper,
.media-youtube-outer-wrapper {
max-width: 380px;
max-height: 280px;
}

Obviously, you can choose any px size you like. Using height: auto did not work for me, even when I targeted the iframe div. It's important to work with the wrappers, because otherwise the surrounding content will still be offset incorrectly. Also note that my video displays inside of a Panel; not sure if that's relevant or not, though.

The downside to this method is that this defines the max size EVERYWHERE on my site. So, I can't have different sizes of Youtube previews on different places on my site - which would be very cool. I'll post if I find a good way to accomplish this.

dddave’s picture

Please note that currently the size setting option seems to be pretty broken due to massive changes in media/file entity: #1815176: After Media changes: Regain responsivness

devin carlson’s picture

Status: Active » Closed (works as designed)

It doesn't sound like there's anything that Media: YouTube can do here. It's up to the lightbox module or site theme to support Media: YouTube.