Hi,

the combination of Media, Media_Youtube, Styles, File Styles is incredibly confusing. I spent hours trying to do the following:

- show a playable YouTube video in a full node
- set custom widht & height for the video

In D6 you could easily do this with Embedded_Media_Field. In D7 it has become a great mystery. Here's my steps:

1. I created a Media Field 'field_video' for my content type 'video'.

2. Under the field's Display settings / Standard I chose 'Large'

3. At admin/config/media/types/manage/video I selected to include YouTube links

4. At admin/config/media/file-styles I tried to edit the 'large' type, but this 'large' seems completely unrelated to whatever the Display setting 'Large' stands for. The confusion starts here. I selected the 'video' preset under the YouTube tab. The three settings 'Large', 'large' and 'video' seem to have no relation to each other whatsoever.

5. I added a node, and succesfully added a YouTube video.

Expected result:
a playable video in my full node

Actual result:
a movie still picture, with the dimensions of the 'medium' image style (!)

What is going on here? How to play a YouTube video?

Comments

Anonymous’s picture

I figured out how to play a video, it is incredible confusing:

- the field display settings 'Format' has no meaning, it is only there to confuse you, set it to whatever you want

- go to admin/config/media/file-styles and add a new file style, e.g. youtube

- on the new File style's 'YouTube' tab, select 'video'

- go to admin/config/media/types and edit the Video's display settings

- Choose as format, "file style: YouTube"

Now you get a playing video. But now, how to change the 'video' preset dimensions? These seem to be hardcoded in media_youtube_variable_default on line 105-106 of media_youtube.variables.inc

It doesn't make any sense. You should be able to choose whatever format you want directly from the field display settings on the content type. And there you should be able to set dimensions in the field's settings.

heyyo’s picture

Any updates to change the preset dimensions ?

cartagena’s picture

Thank you, morningtime--
I'm still confused. Actually I had youtube videos working (using the media module on D7) and then they stopped working--My embed url was no longer creating a graphic in the files/youtube-media directory and instead were going into the files directory as an application/octet-streaming type rather than youtube type. And obviously they don't play. I back up the entire site a couple times a day so I went back to a version from two days ago when all was working (I'm on devCloud so I imported the older version to my dev server) and got the same result. I tried with videos that previously worked. I tried with random youtube videos and all the same result--nothing. The ones I had uploaded previously work fine.

Plan B I set up amazonS3 and cloudfront and I can get the video to play in the mediafront OSM player but there is no audio--must be missing a setting somewhere but I can't find it. I would be most grateful for any ideas as to what I'm doing. I am not a programmer and have not touched any code. I work with CSS but that's the extent of my ability.

I tried your instructions above but even choosing file sytle:YouTube all I get is an upload box. How do I get an embed video box there instead of upload? I am getting desperate as my site is supposed to launch last week. I have two more videos to upload...don't know why it couldn't wait to stop working until I had the last two in!!!
Thank you.

rggoode’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha5
Component: Code » Documentation
Category: support » feature

I'm struggling with the same kind of issue. I'm using Media 7.x-1.0-beta4, and Media: YouTube 7.x-1.0-alpha5, and I would like to use the Media field on a content type to place a youtube video (player, not image) that fits the column width. When I select anything but large for the file style, I just get the youtube image. But if I choose large to have the player enabled, the size is too wide for my column space.

The WYSIWYG implementation of Media Browser allows me to place a player-enabled video and then scale it--which is awesome. But I want to idiot-proof the content-type for the client--so that they ONLY place the image with the media field--and it's always in the right place, and automatically formatted to fit.

It seems that-as it's so easy to resize the player using WYSIWYG and the same media--that setting the size with the Media field should be a snap. Am I missing something here? I've been experimenting with image styles and file styles, and have been searching the issue queue for answers, but haven't found the right recipe yet.

computerology’s picture

To just play the video you can always use the video filter module. That works with D7. Less than perfect for what I'm looking for but it does work with a lot less hassle.

I am truly looking for a way where users can submit videos much like posts from a variety of engines which are then indexed and tagged not unlike articles for example but not using articles.

IronWorker’s picture

Hmmm.... attempting to find an incantation to actually make this work. I'm using CKedit and want to place media in the node with that (Media Browser). I've attempted to do #1 here but it's not working for me: all I get in the node is the image, not the player (with img tags, nor iframe tags).

Using media 1.0-Beta5 and media_youtube 1.0-alpha5

I created a file-style of youtube and set the YouTube tab preset to "Video"
In admin/config/media/file-types I've edited the video manage display section in a number of ways with the same result... This section has checkboxes for "file style: youtube" but also "YouTube Video" and "YouTube Preview Image"

It doesn't seem to matter which combination of these is checked. Also I'm not clear to which button this covers "default" .... "original" -- as far as I can see, none of the checks makes a difference on any of those selections but I might have missed something.

Right now all I can get is the image, not the player.

Any hints?

cartagena’s picture

This is a GREAT media video, got my player and playlists up and running in no time....
http://www.mediafront.org/dallas-drupal-days-2011-presenting-media

Anonymous’s picture

Well at least our alpha dog Dries Buytaert put the Media module on his Drupal 8 "priority list". See his keynote where he talks about it from London DrupalCon:

http://bcove.me/i6ccq8h1

IronWorker’s picture

OK, so this MediaFront is a cool and wonderful thing for use in fielded media. What about embedded media references inline with other content? These media files would not be attached with a field but inserted with an kind of tag.

Right now, it looks like I there's some sort of disconnect with exactly *what* the media module is supposed to embed in the body.

A related question I suppose is which module is this a problem in? CKEdit, Media or Media_youtube?

IronWorker’s picture

Ah. the problem was that I wasn't using the right combination of CKedit and WYSIWYG... What you want it to turn off CKedit and turn on WYSIWYG and use the CKeditor from inside *that*

positive instructions are here: http://drupal.org/node/703338

liquidcms’s picture

Version: 7.x-1.0-alpha5 » 7.x-1.x-dev
Category: feature » support
Priority: Normal » Major

Any chance we can keep this issue on how to create a youtube field? I think that was the original post but it has drifted into wysiwyg issues and other things unrelated.

Anyone have the recipe yet on how to make this module work?

I followed recipe in #1 and get as far as:

- go to admin/config/media/types and edit the Video's display settings

and this path is not found

i can now select display format as my new "File style: youtube" but it has no impact. All i see is a file type graphic and a url to the youtube page.

liquidcms’s picture

lol.. and 5 sec later.. i found my problem.

the display formatter does work and needs to be set; my issue was i had enabled the Full Content view mode and was editing the Default view mode not the Full Content one.

thanks a ton morningtime for your help.

liquidcms’s picture

still have not found how to make a second player format and set the size to something i define. would have to guess this capability isn't there??

let's get emfield converted to D7; media field is far to complex to be of much use... hmm.. or maybe a README file might help.

cartagena’s picture

I use mediafront module's osm player--can set as many presets as I want, use jquery themeroller and/or create my own templates, can separate the playlist from the player or display them as a piece. I've been using media module and youtube for my videos but the amazon S3 and aws sdk modules are now released and I got those set up yesterday so I think I'll go that route--but I'm still using mediafront as my player. Hope this helps!

liquidcms’s picture

@cartagena - sweet.. liking mediafront as a replacement for emfield!! gave up on media module.

cartagena’s picture

Great--glad it's working for you!

liquidcms’s picture

well.. almost.. it doesn't quite work.. but i am sure it will be fixed soon.. :)

donhajicek’s picture

Seriously. How hard is it to get a youtube video to play in D7? (Pretty hard, I am finding.) So far, every module I find and try leads to a thread that ends with people wondering where the developers are or waiting for a new version. Is video dead in D7?

liquidcms’s picture

i did manage to get youtube video working in D7 using MediaFront module (and a slew of other modules)... but certainly not a solid solution yet (and very little in the way of documentation). I pretty much had to work directly with the module designer to get it going and even still there are quite a few bugs.

also went down the Video module path and a major pita with that as well (ffmpeg or zencoder/s3)

i would say video in D7 is not quite ready for prime time yet... maybe in a few months.

cwithout’s picture

After a frustrating time of trying to figure out how to display the YouTube videos with a customized height/width, I finally found a video on it. The settings are not under "Manage Display" as I thought, but under "Manage File Display".

http://cleverlogic.net/tutorials/drupal-7-video-setup-using-media-and-me...

Most of the tutorial is basic stuff, so here's the specifics of setting up the display of a video field if you don't want to watch the thing.

Once you have added a "multimedia asset" field with the "media file selector" widget, go to Manage Display for your content type (admin/structure/types/manage/[type]/display).
-Set your video field to display with format "Media", "File view mode: Default"
(You don't need a custom display setting for "Full content" in this method like in the solution in #2. So if you have that, you can remove it.)

At admin/config/media/file-types/manage/video/file-display
-Check "YouTube Video" and "YouTube Preview Image"
-In the vertical tabs, click "YouTube Video". Set the width and height. (You can also check "Autoplay".)
-Again in vertical tabs, click "YouTube Preview Image" and choose the image style for the image. (Though for me, that setting didn't seem to change anything.)

imoreno’s picture

Last dev from January is now broken when using stylizer that used to be my favorite solution.

I have been trying all of the solution in this thread - #20 is the best and working bellyful as expected!

thank you cristinawithout.

JoshuaKissoon’s picture

mrP’s picture

Project: Media: YouTube » D7 Media
Version: 7.x-1.x-dev » 7.x-1.0-rc3
Component: Documentation » Media field

After following this basic setup video, I still had a situation where I could play the embedded videos at media/[mid] but not within the node. Not only could I not play it, but it wasn't rendered in the node (ie, no static image, not even a div holder for the field). Yet at admin/structure/types/manage/[type]/display it was not hidden.

Looking closer at the video posted in #20 and #22, at 2:37 you'll see that there isn't a File view mode: and widget next to the Videos field. However, in the teaser view mode there is (around 3:03 of the same video). The same was true for my situation. By simply moving the Videos field to the hidden area, saving, and then moving the field back to displayable, the File view mode: and widget magically appeared. After saving again and viewing the node, all was working and I could play the video.

I'm moving this Media issues because it appears to be a bug with the Media field rather then media_youtube integration.

My versions for other's reference:
media-7.x-1.0-rc3
media_youtube-7.x-1.0-alpha5

Hopefully, this is will help someone else get video working.

rwilson0429’s picture

Creating a field of type 'Multimedia Asset' and then formatting the field as 'Media' (admin/structure/types/manage/[your-content-type]/displays does get my Youtube videos to play.

However, using this method raises concerns because the multimedia asset field is deprecated in the latest Media module devs in favor of core's file field. Since Media field is deprecated in favor of core file field, the internet video solutions (ie. YouTube, Vimeo) using the deprecated Media field does not give me a good sense of stability. I've tried, it seems a hundred different ways, to get YouTube videos to play using file field, instead of Media field. No can do.

I admit to having a high degree of ignorance about multimedia in D7. Nevertheless, it seems to me that if Media module is the multimedia standard of the future in Drupal then, Media module will have to very soon find a way that users can use core file field to play YouTube and other internet videos, or possibly rescind the deprecation of Media fields in Media module.

Modules like Mediaelement (mediaelement.js) does a fairly descent job of playing a variety of locally stored videos and audios in an html5 player, however, most of my videos will not be stored locally for playback. Another solution, MediaFront does a great job of displaying and playing both locally stored and internet videos (YouTube, vimeo, etc) and audio but, it seems to be very limited to the formats that it can handle. Considering it has a great maintainer (same as MediaFront), I'm hoping that Html5 Media module will fill in the Drupal 7 video gaps very soon.

chris_h’s picture

Guide to adding a YouTube video on a fresh install with Media Youtube-7.x-1.0-beta1 & Media-7.x-2.x-dev
1) Install Media Youtube. This will install the following dependencies: Media Internet Sources, Media, File entity, Chaos tools, Views
2) Create a new content type.
3) Add a new field, called video, field type: file, widget: media file selector
4) Save field settings (there are none)
5) Video field settings. Enabled browser plugins: video. Allowed remote media types: video. Allowed URI schemes: youtube:// (YouTube videos). Save settings.
6) Manage display for the default view mode. Format: rendered file. View mode: large. To also get the video to appear in the teaser view, repeat 6 for teaser view mode.

Start adding videos to your heart's content...

esbite’s picture

chris_h: This discussion is about Media 1.0. As far as I can see there is no way to add videos without using the deprecated field type "Multimedia Asset".

Dave Reid’s picture

Status: Active » Fixed

Use the core 'File' field type and not the Multimedia asset field type. In the settings for the file field ensure that you allow the proper video remote file type and URI schemes for Youtube as well.

chris_h’s picture

Version: 7.x-1.0-rc3 » 7.x-1.x-dev
Status: Fixed » Active

Media 1.x branch needs this patch to get the rendered file option - http://drupal.org/node/1390878#comment-5495648

Dave Reid’s picture

Status: Active » Fixed

Ok, then let's have everyone follow and review #1390878: File fields do not have the media formatter option and we can leave this issue fixed then!

Status: Fixed » Closed (fixed)

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

skoehn180’s picture

THANK YOU for this! I've tried all sorts of things and this finally got it working for me.