Hi everyone, I'm using:
https://github.com/frozeman/MediaEmbed
To embed youtube videos etc, and it works fine, except i've got an error in IE9, the more annoying thing is that it's not even showing up as an error, it's just not working!
In firefox the box opens up and then after adding the embed code, you click "ok" and it puts it in the editor, however in ie9, the box opens up, and you can paste your code the box, you can click the cancel button and the box closes, but if you click ok, nothing at all happens!
Any help appreciated, completely blown away by this now!
Code here:
/*
* Embed Media Dialog based on http://www.fluidbyte.net/embed-youtube-vimeo-etc-into-ckeditor
*
* Plugin name: mediaembed
* Menu button name: MediaEmbed
*
* Youtube Editor Icon
* http://paulrobertlloyd.com/
*
* @author Fabian Vogelsteller [frozeman.de]
* @version 0.1
*/
( function() {
CKEDITOR.plugins.add( 'mediaembed',
{
init: function( editor )
{
var me = this;
CKEDITOR.dialog.add( 'MediaEmbedDialog', function ()
{
return {
title : 'Embed Media',
minWidth : 550,
minHeight : 200,
contents :
[
{
id : 'iframe',
expand : true,
elements :[{
id : 'embedArea',
type : 'textarea',
label : 'Paste Embed Code Here',
'autofocus':'autofocus',
setup: function(element){
},
commit: function(element){
}
}]
}
],
onOk : function() {
for (var i=0; i<window.frames.length; i++) {
if(window.frames[i].name == 'iframeMediaEmbed') {
var content = window.frames[i].document.getElementById('embed').value;
}
}
console.log(this.getContentElement( 'iframe', 'embedArea' ).getValue());
editor.insertHtml(this.getContentElement( 'iframe', 'embedArea' ).getValue());
}
};
} );editor.addCommand( 'MediaEmbed', new CKEDITOR.dialogCommand( 'MediaEmbedDialog' ) );
editor.ui.addButton( 'MediaEmbed',
{
label: 'Embed Media',
command: 'MediaEmbed',
icon: this.path + 'images/icon.png'
} );
}
} );
} )();

I should add, have also tried
I should add, have also tried the code from the plugin page http://ckeditor.com/addon/mediaembed but with the same result.