By sp_key on
Right, after watching tutorial videos on Youtube, searching online and wasting at least an hour on trying to achieve blogspot functionality on my d7 blog I am coming to ask you guys what I need to do to embed YouTube videos on drupal 7.
I have WYSIWYG, media, styles, media youtube modules all installed and enabled and configured properly for admin role. I have also enabled "Converts Media tags to Markup" under text formats and obviously, I have cleared all cache.
Is there anything else one needs to do before displaying a video on a blog?
Please?
Many thanks in advance
Comments
Maybe if you're having
Maybe if you're having trouble getting it to embed, once you've completed making changes to your blog post through a WYSIWYG editor you can switch to plain text and embed the code that way. With the right editor the text formatting should remain. Maybe the media tags are not being properly converted. This is what I have done with sites in the past.
Why would I need to switch to
Why would I need to switch to plain text, I don't understand.
But anyway, switching to plain text results in the html tags being displayed as text.
btw, Youtube is now using iframe tags for embeding videos.
I am using CKeditor with WYSIWYG. I was under the impression that this was "the right editor" with drupal.
Any ideas anyone? Surely Drupal 7, is able to display videos on posts almost 1 year after it's first release?
Because, by switching to
Because, by switching to plain text, embedding the code, and then saving the node it ensures that the WYSIWYG editor will not place any html tags within the embed code which would ruin it and prevent it from working properly. Placing an embed code within the CKEditor may cause it to translate it as html text rather than markup. WYSIWYG editors sometimes do some crazy things with markup. I'm pretty sure trying to enter markup into CKEditor will not work in most cases, as it assumes you are using it to avoid entering html. Just sayin. Did you try it? Sure, switching to plain text while you're editing shows you the tags, but once its saved and the data is displayed on the node it is read as markup and not displayed. You should be able to just switch to plain text, embed the code wherever you need it, and switch back even.
I was using CKEditor, and this is what I did to display embedded YouTube videos. Any site can display a YouTube video with the embed code, so this should not be an issue at all.
Hi, Thanks for the
Hi,
Thanks for the explanation.
Apparently it is necessary to switch to plain text when adding the embed code. You then have to switch back to full html before saving.
Saving the post as plain text won't embed the video in my case.
Thanks for your assistance.
Hopefully, in the near future we won't have to do all these workarounds to achieve such a simple task.
Great!
Great! Thanks for the instructions on how to accomplish this. I certainly agree that this would be a great feature to add to a WYSIWYG editor. I use CKEditor on all my sites, and a feature like this would definitely help clients that are not savvy enough to understand markup when switching to plain text. Maybe this should be a feature request in one of the WYSIWYG editor queues.
I realize this is several
I realize this is several months later, so you may not benefit from this - but maybe someone else out there will. :-)
It's likely that your problem stems from not having iframe being on your list of allowed tags for the text format.
Naturally be aware that you're enabling anyone using that format to embed iframes.
I'm not as familiar with the media module off the top of my head, but I imagine the problem there may be that you may not have that box checked on the list of "enabled filters" (look for it after step 2).
Good luck!
--
David Needham
How it done
I had a same problem with Drupal 7, but it finally works. I don´t know what exactly I do, but I install moduls Media, Media Youtube, Ctools. Than make a new article (or whatever), disable rich-text, insert
<iframe title="YouTube video player" src="http://www.youtube.com/embed/-J3HfllvXWE" frameborder="0" width="547" height="333"></iframe>and then enable rich-text. Youtube video should appear.Youtube plugin for ckeditor
Ckeditor has plugins, there is a youtube embed plugin which is working perfectly. You can find it here:
http://sourceforge.net/projects/ckeditoryoutube/
What it does is simply add iframe tags in the way Youtube likes it. So no need to switch or anything.
A Slighlty Different Method
The method documented in the link below does not embed a YouTube video via WYSIWYG, but instead allows you to post the YouTube video through a content field provided by a combination of the Media and Media: YouTube modules. It may not be exactly what you're looking for, but it works very well and may be a good alternative.
Check out this post: Post YouTube Videos with Media + Media: YouTube
Embedded Media Field is your
Embedded Media Field is your best solution.
Not sure if this will help but....
When I need to add an iframe type of tag, I myself, had to switch to the plain text editor, insert the iframe link then saved it at that point. Kind of annoying having to re-insert it every time I opened the node for editing.
What I ended up doing is downloading the latest CKEditor version, installed it's library with all the addons in the build library feature. (This included an iframe handler button).
Then I went into the Home » Administration » Configuration » Content authoring » Wysiwyg profiles » List
Brought up the CKEditor Buttons and BUTTONS AND PLUGINS section and clicked on the iFrame check box.
Now when you open up a node with the WYSIWYG Editor running as FullHTML, the iframe now appears as a box that you can click right on to edit it's internal properties.
Saving with WYSIWYG still turned on will now be preserved.
Hope this helps someone.
By following way you can embed youtube video in drupal
Following are way to embed any youtube video to html basic page...
1]Login to drupal admin panel.
2]Go to Structure =>Content types=> add content types "Give any name to a content types" and click on save button.
3] Go to you tube , you can see at the bottom of the video there is option Share => Embed click on it.
You will find source code inside Iframe tag
just copy that all source code
4]Go to content and add content and click on newly created content. you can see different fields there like
title , body , text format.
a) title => you can enter any title in the title field you want.
b) In the body field select source code option and put already copied source code .... step (3)
c) Select text format "Full Html " and click on save button.
5] Done.
Thanks Chandravilas
Thanks Chandravilas!
You instructions worked perfectly for me!