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(),
),
),
),
),
),
),
);
}
Comment | File | Size | Author |
---|---|---|---|
#3 | Issue+Thumbnail+and+Large+Video+Size+in+Media+YouTube+Module.patch | 1.65 KB | daycrom |
media_youtube.styles_after_modification.zip | 1.01 KB | robbycandra |
Comments
Comment #1
picciuto CreditAttribution: picciuto commentedIf Drupal had a "Like" button like Facebook, I'd "Like" this post.
Comment #2
Rj-dupe-1 CreditAttribution: Rj-dupe-1 commentedsubscribe
Comment #3
daycrom CreditAttribution: daycrom commentedVery very important modification.
I used this patch in www.creativedance.com.ar
Attach GIT Patch
subscribe
Comment #4
jonaswouters CreditAttribution: jonaswouters commented+1
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedDon'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?
Comment #6
ids@isabeldesmet.be CreditAttribution: ids@isabeldesmet.be commentedI 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."
Comment #7
ids@isabeldesmet.be CreditAttribution: ids@isabeldesmet.be commentedI am sorry, I does work, but you need to go to file types again.
Open de "large" type and save to see the changes.
Comment #8
Ganganation CreditAttribution: Ganganation commented#5 Good one! Where can I find that? Have been looking for it like crazy. With "that" I mean:
Thanks for your answer :D
Comment #9
blemmie CreditAttribution: blemmie commentedsubscribe
Comment #10
xpla CreditAttribution: xpla commented+1 Where do i find the settings for custom sizes of a video?
Comment #11
jorisx CreditAttribution: jorisx commented+1 Where do i find the settings for custom sizes of a video?
Comment #12
sebish CreditAttribution: sebish commentedSubscribe
Comment #13
maartenstorm CreditAttribution: maartenstorm commentedWith 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?
Comment #14
vikfroberg CreditAttribution: vikfroberg commentedSubscribe
Comment #15
heyyo CreditAttribution: heyyo commentedDo we still need this patch with the last version of this module or there is another way to do it ?
Comment #16
aaron CreditAttribution: aaron commentedcommitted. thanks!
Comment #17
aaron CreditAttribution: aaron commentedadded all image styles at http://drupalcode.org/project/media_youtube.git/commitdiff/aaccefe?hp=cc...
Comment #19
Martijn Houtman CreditAttribution: Martijn Houtman commentedTo 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