Hello

I propose to change function media_youtube_styles_default_presets() at media_youtube.styles.inc.
So we can
1. change the size of video linked_thumbnail from configuration -> image style -> thumbnail
2. change the size of video unlinked_thumbnail from configuration -> image style -> thumbnail
3. make large video same with default youtube iframe. From: 480 x 360 ----> 640 x 390
This is also because (default) video size was 540 x 360. I think large_video should be larger than (default) video.

Thanks
Robby

This is the edited function

function media_youtube_styles_default_presets() {
return array(
'file' => array(
'containers' => array(
'media_youtube' => array(
'default preset' => 'linked_thumbnail',
'styles' => array(
'original' => array(
'default preset' => 'video',
),
'thumbnail' => array(
'default preset' => 'linked_thumbnail',
),
'square_thumbnail' => array(
'default preset' => 'linked_square_thumbnail',
),
'medium' => array(
'default preset' => 'linked_medium',
),
'large' => array(
'default preset' => 'large_video',
),
),
'presets' => array(
'unlinked_thumbnail' => array(

/* --------------> Add lines Begin <------------- */
array(
'name' => 'image_style',
'settings' => array(
'image_style' => 'thumbnail',
),
),
/* --------------> Add lines End <------------- */

array(
'name' => 'thumbnail',
'settings' => array(),
),
),
'linked_thumbnail' => array(
array(
'name' => 'link_to_media',
'settings' => array(),
),

/* --------------> Add lines Begin <------------- */
array(
'name' => 'image_style',
'settings' => array(
'image_style' => 'thumbnail',
),
),
/* --------------> Add lines End <------------- */

array(
'name' => 'thumbnail',
'settings' => array(),
),
),
'linked_square_thumbnail' => array(
array(
'name' => 'link_to_media',
'settings' => array(),
),
array(
'name' => 'image_style',
'settings' => array(
'image_style' => 'square_thumbnail',
),
),
array(
'name' => 'thumbnail',
'settings' => array(),
),
),
'linked_medium' => array(
array(
'name' => 'link_to_media',
'settings' => array(),
),
array(
'name' => 'image_style',
'settings' => array(
'image_style' => 'medium',
),
),
array(
'name' => 'thumbnail',
'settings' => array(),
),
),
'video' => array(
array(
'name' => 'video',
'settings' => array(),
),
),
'large_video' => array(
array(
'name' => 'resize',
'settings' => array(
'width' => 640, /* --------------> Default youtube iframe width <------------- */
'height' => 390, /* --------------> Default youtube iframe width <------------- */
),
),
array(
'name' => 'video',
'settings' => array(),
),
),
),
),
),
),
);
}

Comments

picciuto’s picture

If Drupal had a "Like" button like Facebook, I'd "Like" this post.

Rj-dupe-1’s picture

subscribe

daycrom’s picture

Very very important modification.
I used this patch in www.creativedance.com.ar

Attach GIT Patch

subscribe

jonaswouters’s picture

+1

morningtime’s picture

Don't forget, you should be able to set custom video dimensions via the config admin somewhere! Why in Drupal God's name would you hardcode these settings EVER? Where is the documentation how to properly override these on a per-content-type basis? For both teaser, full node and other displays?

ids@isabeldesmet.be’s picture

I have applied the patch, but I do not see any change in the large_format....
Maybe it's easier to embed the code and change the size here ? But when I try this I get the message "Unable to handle the provided embed string or URL."

ids@isabeldesmet.be’s picture

I am sorry, I does work, but you need to go to file types again.
Open de "large" type and save to see the changes.

Ganganation’s picture

#5 Good one! Where can I find that? Have been looking for it like crazy. With "that" I mean:

"you should be able to set custom video dimensions via the config admin somewhere!"

Thanks for your answer :D

blemmie’s picture

subscribe

xpla’s picture

+1 Where do i find the settings for custom sizes of a video?

jorisx’s picture

+1 Where do i find the settings for custom sizes of a video?

sebish’s picture

Subscribe

maartenstorm’s picture

With this patch now I have thumbnails as preview, but I still can't get them to work as a linked thumbnail.
@daycrom How did you do this for your site?

vikfroberg’s picture

Subscribe

heyyo’s picture

Do we still need this patch with the last version of this module or there is another way to do it ?

aaron’s picture

Status:Active» Fixed

committed. thanks!

aaron’s picture

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Martijn Houtman’s picture

To those who are wondering where to set the image style for a preview of a video media element, go here: /admin/config/media/file-types/manage/video/file-display/media_preview