Hi all,

When i edit the config.js and uncomment the following lines

// 'MediaEmbed' plugin. To enable it, uncomment lines below and add 'MediaEmbed' button to selected toolbars.
  config.extraPlugins += (config.extraPlugins ? ',mediaembed' : 'mediaembed' );
  CKEDITOR.plugins.addExternal('mediaembed', Drupal.settings.ckeditor.module_path + '/plugins/mediaembed/');

The editor disappears. The code for IMCE however is working fine. There's a plugin.js in /ckeditor/plugins/mediaembed. So i'm wondering what i'm doing wrong. Is there somewhere additional documentation how to install this plugin?

Comments

MatthijsG’s picture

Extra info: I followed exactly the readme.txt. The editor shows not up

mephir’s picture

Status: Active » Postponed (maintainer needs more info)

Have you got any javascript error ? Can you provide me information about using browser/operating system and ckeditor module version ?

wreford’s picture

Same thing is happening to me, in fact, the entire Body field just disappears, flashing briefly before showing a smooth white space.

ckeditor module 6.x-1.1 (i.e. no wysiwyg module)
ckeditor code and mediaembed plugin are from this week
browser: safari/chrome/ffox, osx, and ffox/chrom, win7
server: osx server 10.6 with php5.2

Firebug says:
uncaught exception: [CKEDITOR.resourceManager.load] Resource name "MediaEmbed" was not found at "http://[my site]/sites/all/modules/ckeditor/ckeditor/plugins/MediaEmbed/plugin.js?t=A39E".

I've renamed the directory to the proper case, the path is correct except for the "?t=A39E"

I've tried disabling security filters, or different ones.

The 'switch to plain editor' link is inactive.

The field outputs this for firebug:

<div class="form-item" id="edit-body-wrapper">
215 <label for="edit-body">Body: <span class="form-required" title="This field is required.">*</span></label>
216 <textarea cols="60" rows="5" name="body" id="edit-body" class="form-textarea resizable required img_assist ckeditor-mod filterxss2">&lt;p&gt;
217 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. &amp;nbsp;&lt;br /&gt;
[... snipped out for brevity, you get the idea...]
</textarea>
227</div>
228<a class="ckeditor_links" style="display:none" href="javascript:Drupal.ckeditorToggle('edit-body','Switch to plain text editor','Switch to rich text editor',1);" id="switch_edit-body">Switch to plain text editor</a><ul class="tips"><li>Web page addresses and e-mail addresses turn into links automatically.</li><li>Allowed HTML tags: &lt;a&gt; &lt;p&gt; &lt;span&gt; &lt;div&gt; &lt;h1&gt; &lt;h2&gt; &lt;h3&gt; &lt;h4&gt; &lt;h5&gt; &lt;h6&gt; &lt;img&gt; &lt;map&gt; &lt;area&gt; &lt;hr&gt; &lt;br&gt; &lt;br /&gt; &lt;ul&gt; &lt;ol&gt; &lt;li&gt; &lt;dl&gt; &lt;dt&gt; &lt;dd&gt; &lt;table&gt; &lt;caption&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;em&gt; &lt;b&gt; &lt;u&gt; &lt;i&gt; &lt;strong&gt; &lt;del&gt; &lt;ins&gt; &lt;sub&gt; &lt;sup&gt; &lt;quote&gt; &lt;blockquote&gt; &lt;pre&gt; &lt;address&gt; &lt;code&gt; &lt;cite&gt; &lt;embed&gt; &lt;object&gt; &lt;param&gt; &lt;strike&gt; </li><li>HTML tags will be transformed to conform to HTML standards.</li></ul><p><a href="/filter/tips">More information about formatting options</a></p></div>

Hope that reveals something simple and obvious, I would really like to have users embedding media this way.

mephir’s picture

There is mistake in path. It should looks like
http://[my site]/sites/all/modules/ckeditor/plugins/mediaembed/plugin.js?t=A39E. Can you paste which lines related to mediaembed have you got into configuration file ? Everything into path should be written with small chars.

wreford’s picture

Ah! solved, thank you. I was confused by the sites/all/modules/ckeditor/ckeditor/plugins path (i.e. the ckeditor module uses another ckeditor directory in it), and followed the instructions included with the plugin incorrectly:

1. Copy the "mediaembed" folder and place it in the ~/ckeditor/plugins directory.

2. Enable the plugin by changing or adding the extraPlugins line in your configuration (config.js):

    config.extraPlugins = 'MediaEmbed';

Because I didn't interpret the "~" properly in those instructions, and there are two plugin folders, I put the plugin into the module's plugin folder not the editor's plugin folder.

I also tried uncommenting the mediaembed lines at the bottom the config file, but that didn't work. I think some clearer documentation would help us noobs, as there are ambiguous/conflicting instructions and duplicated files in both module and editor. The upper case letters were there because the server's case-sensitive and I was trying various things as troubleshooting, including renaming the directory.

So now the path I provided works, thanks. Hope this clarifies things for others, too.

mephir’s picture

Status: Postponed (maintainer needs more info) » Fixed

If you have any lack of clarity about issue, feel free to reopen it.

MatthijsG’s picture

Status: Fixed » Active

Opening. Followed above instructions and can't get it to work

@5 - so i do need to add config.extraPlugins = 'MediaEmbed'; without uncommenting the lines 145 + 146 (Mediaembed plugin)? These are the lines 20-33

 // side
  // (as does Drupal), so just leave this line as is.
  config.protectedSource.push(/<\?[\s\S]*?\?>/g); // PHP Code
  config.extraPlugins = 'mediaembed';
  if (Drupal.ckeditorCompareVersion('3.1')) {
    config.extraPlugins += (config.extraPlugins ? ',drupalbreaks' : 'drupalbreaks' );
  }

  if (Drupal.settings.ckeditor.linktocontent_node) {
    config.extraPlugins += (config.extraPlugins ? ',linktonode' : 'linktonode' );
  }
  if (Drupal.settings.ckeditor.linktocontent_menu) {
    config.extraPlugins += (config.extraPlugins ? ',linktomenu' : 'linktomenu' );
  }

This gives me a blank bodyfield. Removing the 'mediaembed' resolves the problem. I noticed that all these plugins aren't working .. The plugins are placed in /sites/all/modules/ckeditor/plugins

I'm not familiar with Firebug, however i tried it. Somewhere in the DOM section i found this reference (window >> CKEDITOR >> config >> templates_files >> 0 : http://www.[site.tld]/sites/all/libraries/ckeditor/plugins/templates/tem...
.../templates/templates/.. is a directory that does not exist. Where and how to alter this?

wwalc’s picture

Status: Active » Closed (fixed)

Check the latest dev release, it should be working fine (I've just checked it). Make sure you have uncommented only:

  config.extraPlugins += (config.extraPlugins ? ',mediaembed' : 'mediaembed' );
  CKEDITOR.plugins.addExternal('mediaembed', Drupal.settings.ckeditor.module_path + '/plugins/mediaembed/');
Standard Machine’s picture

I was having this same issue, got it working, thought I'd share what helped.
I tried the latest dev version and did the uncomment thing in ckeditor.config.js, to no avail.
Looking at this patch showed me what I was doing wrong. http://drupal.org/node/655938

In ckeditor.config.js

Step 1
Remove (line 23)
config.extraPlugins = '';
Replace with
config.extraPlugins = 'MediaEmbed';

Step 2
Remove (line 130)
//config.extraPlugins += (config.extraPlugins ? ',mediaembed' : 'mediaembed' );
//CKEDITOR.plugins.addExternal('mediaembed', Drupal.settings.ckeditor.module_path + '/plugins/mediaembed/');

Replace with
CKEDITOR.plugins.addExternal('MediaEmbed', Drupal.settings.ckeditor.module_path + '/plugins/mediaembed/');

Step 3 (line 82)
Put the button in the toolbar.
Remove
['DrupalBreak', 'DrupalPageBreak']
Replace with
['DrupalBreak', 'DrupalPageBreak', 'MediaEmbed']

Step 4
That got the editor working again and provided the proper button, but when you click it you won't get right input field (iframe breaks), so replace the mediaembed plugin (in the module's plugins directory) with the one from here:
http://www.fluidbyte.net/index.php?view=embed-youtube-vimeo-etc-into-cke...

It has the extra html, that the embed field's iframe is looking for.

Hope this helps.

geantbrun’s picture

Status: Closed (fixed) » Active

Hi,
I am having this same issue, could I ask you to clarify things, information I got from different sources seems contradictory.

1) Where should I unzip the CK_Media_Embed file? In ckeditor/ckeditor/plugins or in ckeditor/plugins?
2) what .js files should I modify? Only config.js in ckeditor/ckeditor? Only ckeditor/ckeditor.config.js? Both?
3) what modifications should I make in the file(s)?
4) should I apply any patch?
5) what version of ckeditor is needed? Is .dev mandatory?

thank you in advance,
Patrick

Anonymous’s picture

hey Patrick

I was havinh trouble with this and realized i and placed the plugin in the wrong directory. It should be placed in the /libraries/ckeditor/plugins dir.

Although after that it still was not working. Instead of uncommenting the two lines i just added
config.extraPlugins = 'MediaEmbed';
and the added 'MediaEmbed' to the toolbar.

2. Edit the config.js in the module dir
5. I was using the latest stable release

hope you come right

Anonymous’s picture

Hi

I have the same issue but the thing is ...It works on the localhost but as soon as i transfer the files over to the server then the error occurs.

uncaught exception: [CKEDITOR.resourceManager.load] Resource name "MediaEmbed" was not found at "http://msf-dev.co.za/sites/all/libraries/ckeditor/plugins/MediaEmbed/plu...".

Any suggestions?

dczepierga’s picture

@bukem, could u try update to last dev version?

It's look like u get wrong path to plugin...

Anonymous’s picture

Yeah that work!

Thanks

dczepierga’s picture

Status: Active » Fixed

Ok as I see everything work so i closed it...

All people who have problem with it pls update to last DEV version :)

Grretings

Status: Fixed » Closed (fixed)

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

hatuhay’s picture

Version: 6.x-1.1 » 6.x-1.5
Category: feature » bug

Upgrade CKEditor to version 6.x-1.5, CKEditor to 3.6.1 and enable MediaEmbed.
Following instructions, added the MediaEmbed buttom to the ckeditor.config.js as follows:

  config.toolbar_DrupalFull = [
      ['Source'],
      ['Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker', 'Scayt'],
      ['Undo','Redo','Find','Replace','-','SelectAll','RemoveFormat'],
      ['Image','Flash','MediaEmbed','Table','HorizontalRule','Smiley','SpecialChar'],
      '/',
      ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
      ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
      ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiRtl','BidiLtr'],
      ['Link','Unlink','Anchor','Linkit','LinkToNode', 'LinkToMenu'],
      '/',
      ['Format','Font','FontSize'],
      ['TextColor','BGColor'],
      ['Maximize', 'ShowBlocks'],
      ['DrupalBreak', 'DrupalPageBreak']
     ];

Editor is gone.
This is HTML in place of CKEditor:

<div class="resizable-textarea">
<span>
<textarea class="form-textarea resizable ckeditor-mod textarea-processed ckeditor-processed" id="edit-body" name="body" rows="20" cols="60" style="visibility: hidden;">
</textarea>
<div class="grippie" style="margin-right: -6px; display: none;">
</div>
</span>
</div>

Upgrade to 6.x-dev, same thing.
Caches flushed.
No idea what to do.

simohell’s picture

At the site http://www.fluidbyte.net

eamonn said on Feb 4, 2012:

Hey, Thanks for your plugin! It didnt work out of the box for me. I had to rename the mediaembed folder to MediaEmbed. I hope this helps someone else!

This worked for me (6.x-1.10 + 3.6.2).

mkesicki’s picture

Status: Closed (fixed) » Needs review

@simohell thank you for notice this.