Donate Share January 2009: Project of the Month

TinyMCE

Tracker: Plugins

5 YouTube Plugin - ID: 1669296
Last Update: Comment added ( jestershoot )

This one works ok for me.

You can insert the URL or the movie ID.
If you wan't to insert the embedded code, just use the HTML code window.

I think this one doesn't interfere with flash, because I used another
classname.

Good luck!

regards,
Victor


VvL ( victor_a36 ) - 2007-02-26 17:16

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 58 )

Date: 2009-01-15 09:03
Sender: jestershoot

Thanks


Date: 2008-07-19 04:20
Sender: geshan_m


HOw do I download the files?


Date: 2008-07-15 17:48
Sender: nobody

Logged In: NO

merci


Date: 2008-07-11 23:09
Sender: nobody

Logged In: NO

Hi,

I can see this hasnt been working since version 3 of mce, I have got it
working but not fully as yet. I will keep you all posted on my progress on
this.

I was going to go down the route of the input would be the youtube video
code i.e. http://www.youtube.com/watch?v=XXX

Where XXX is this is what you would enter. Then you could choose you width
height and then it would insert valid xhtml code.

If anyone else has any suggestions please let me know.

Thanks.

Offender


Date: 2008-07-07 00:09
Sender: manete


good


Date: 2008-07-04 16:28
Sender: nobody

Logged In: NO

wvwcv


Date: 2008-07-03 12:24
Sender: hadinasrun


ok i am intersting


Date: 2008-06-27 13:36
Sender: nobody

Logged In: NO

logged


Date: 2008-06-19 20:45
Sender: smagruder


I downloaded youtube.zip, but my system is saying it's not a valid .zip
file. Can this be fixed? Thanks!


Date: 2008-04-24 20:21
Sender: nobody

Logged In: NO

hhhhhh


Date: 2008-04-24 19:21
Sender: nobody

Logged In: NO

hi


Date: 2008-04-17 15:09
Sender: deigote


Around line 214, why not substitute the video id detection with something
like the following?

var videoId = "";
if (src.indexOf("youtube.com/watch?") > -1) {
var parametersString = src.substring(src.indexOf("?")+1, src.length);
var parameters = new Array();
for (var i = 0; i < parametersString.split("&").length; i++)
parameters[i] = parametersString.split("&")[i];
for (var j = 0; j < parameters.length; j++)
if (parameters[j].split("=")[0] == "v")
videoId = parameters[j].split("=")[1];
}

This would work with Youtube URLs with www or not, or from any country
(youtube subdomains such as es.youtube.com, etc).


Date: 2008-04-04 18:28
Sender: nobody

Logged In: NO

For some reason, the plugin works but when posted the video is not
there... Could anyon help me with this? Example at
http://www.oomaoo.com/fridge


Date: 2008-04-01 18:47
Sender: nobody

Logged In: NO

From where I can download this youtube plugin.


Date: 2008-03-28 12:45
Sender: paulsilveruk


I couldn't get this working under the latest version of TinyMCE (v3.0.5)
as they've changed the way plugins work. When I downloaded v2.1.3 stable
from their Downloads page ( http://tinymce.moxiecode.com/download.php ) the
plugin worked fine.


Date: 2008-03-20 19:14
Sender: noidph


Sorry, just found the links. Couldn't see it at the far right of the page.
:)


Date: 2008-03-20 18:35
Sender: noidph


Hi,

How do I download the youtube plug-in? Can't find the link.


Date: 2008-03-14 15:26
Sender: nobody

Logged In: NO

Installed this plugin and it worked fine in IE6 and IE7 as is, but for
Firefox2, the video would not render. After some debugging, I found that
the OBJECT tag was generating the height and width through an inline style
and for some reason was being stripped (perhaps because of our tinyMCE
settings). I modified the "editor_plugin_src.js" file to render the OBJECT
tag with height and width attributes instead of using inline styling and
this solved the problem.

If it was a setting in tinyMCE that stripped the style attribute (which I
never bothered to check for), this fix also saved us from allowing the
style attribute to be accepted as valid, which do not want. Just thought I
throw this out there in case others have a similar problem.


Date: 2008-03-09 23:38
Sender: nobody

Logged In: NO

<object width="425" height="350"><param name="movie"
value="http://tu.tv/tutvweb.swf?kpt=aHR0cDovL3R1LnR2L3ZpZGVvc2NvZGkvdC9oL3RoZS1zaW1wc29ucy0xN3gwOS1sYXRpbm8uZmx2&xtp=156714"></param><param
name="wmode" value="transparent"></param><embed
src="http://tu.tv/tutvweb.swf?kpt=aHR0cDovL3R1LnR2L3ZpZGVvc2NvZGkvdC9oL3RoZS1zaW1wc29ucy0xN3gwOS1sYXRpbm8uZmx2&xtp=156714"
type="application/x-shockwave-flash" wmode="transparent" width="425"
height="350"></embed></object><br /><a href="http://www.tu.tv"><img
src="http://www.tu.tv/img/tranparente.gif" alt="www.Tu.tv" border="0"
/></a><br />


Date: 2007-12-10 21:35
Sender: nobody

Logged In: NO

The same plugin now comes with new tinymce version. Media button and
choose flash and then insert the URL

-dirar


Date: 2007-12-10 20:22
Sender: nobody

Logged In: NO

How I can install this plugin??
In search in readme file, tinyMCE website/wiki an google and didn't
find...
thanks!


Date: 2007-12-10 20:21
Sender: nobody

Logged In: NO

How I can install this plugin??
In search in readme file, tinyMCE website/wiki an google and didn't
find...
thanks!


Date: 2007-11-20 16:47
Sender: nobody

Logged In: NO

A bug fix for Youtube plugin. If the users inserts a Youtube link begging
with http://youtube.com/ then the final URL will be like this one:
http://www.youtube.com/v/http://youtube.com/watch?v=xxxx.

Line 202, add this:

if( src.indexOf("http://youtube.com/") != -1 )
src = src.replace("http://youtube.com/", "http://www.youtube.com/");



Date: 2007-11-13 21:15
Sender: nobody

Logged In: NO

How to install YouTube plugin under Drupal:
http://drupal.org/node/154877#comment-253803


Date: 2007-09-19 07:27
Sender: nobody

Logged In: NO

I have multiple instance of tinyMCE in one page (many tiny mce_editor_id)
and if I insert a youtube video for each editor the script don't read
correctly width and height in every editor. For editor where I focused
width and height are right and in the other editor return width and height
undefined (i try a alert in parseAttribute). This problem is the same in
plugin flash. Help me.
Raffaele P.


Date: 2007-08-25 17:59
Sender: thinfu


Good Job


Date: 2007-08-13 05:59
Sender: nobody

Logged In: NO

The same plugin now comes with new tinymce version. Media button and
choose flash and then insert the URL

-dirar


Date: 2007-08-12 17:17
Sender: gamescoper


i am new to tinymce and i cant seem to install this plugin can someone
point me in the right direction
thx


Date: 2007-08-12 17:17
Sender: gamescoper


i am new to tinymce and i cant seem to install this plugin can someone
point me in the right direction
thx


Date: 2007-08-05 16:01
Sender: admejack


ghhghg


Date: 2007-06-28 10:59
Sender: dxz2


I have a problem when submitting or changing to HTML mode and going back,
other media is turn to youtube.

I have the last version "youtube_xhtml_workaround.zip"

Thanks


Date: 2007-06-28 10:04
Sender: dxz2


Hi,

Thank for the plugin. I added this line:
if( src.indexOf("http://youtube.com/watch?v=") > -1 )
src = src.replace("http://youtube.com/watch?v=", "");

problem when the url has no wwww at the beginning and this solves it.





Date: 2007-06-27 00:51
Sender: kyle_vh


Which file should I install into my Drupal website?
The lastest?
Or all three?

I've installed tinyMCE, and it's working.



Date: 2007-06-19 22:25
Sender: nobody

Logged In: NO

Nobody (I) said: "This pluggin is not needed... It is just to use the
media pluggin that
comes with TinyMCE."

I was wrong, the media pluggin that comes with tinymce does not post valid
html or xhtml. Sorry guys!


Date: 2007-06-19 21:51
Sender: nobody

Logged In: NO

This pluggin is not needed... It is just to use the media pluggin that
comes with TinyMCE.


Date: 2007-05-04 04:56
Sender: nobody

Logged In: NO

Ok sussed it .. because I used this code to remove the "Click to Activate"
problem in IE

http://www.amarasoftware.com/flash-problem.htm

it killed the YouTube Flash movie in IE .... sorry to bother :) Keep up
the good work!


Date: 2007-05-04 04:51
Sender: nobody

Logged In: NO

correction... if i get the code it generates - it works OK in IE and
Firefox ... but in my page with IE it does not show .. right clicking the
movie: context menu says "Movie not Loaded" ..

still investigating


Date: 2007-05-04 04:41
Sender: nobody

Logged In: NO

implemented the "youtube_xhtml_workaround.zip" .. works great in FireFox
... not in IE 7


Date: 2007-04-03 19:28
Sender: nobody

Logged In: NO

Installed the youtube_xhtml_workaround.zip and tested it. Everything is
working now. It does not destroy other media links in Drupal 5.

Only problem that I still have is you cannot start a new text line after a
video or it will disappear when you press enter. You can however edit
existing text and all lines after existing text.

Feature to add would be the ability to use the video ID and/or the url
without the www.


Date: 2007-04-03 16:16
Sender: mrbinky3000


Noticed something else...

When you try and edit a post that has other types of media links... the
youtube plugin alters the HTML code for the non-youtube media links.

For example this code...

<!-- Include this video on your site :: Start Copy -->
<!-- Make sure to link to the AMN. The more people that visit the AMN,
-->
<!-- the better it is for everyone in the local scene -->
<!-- Please note : All videos will be moving to a new server soon. -->
<!-- Check back for updated code if your video breaks -->
<object style="background-color:#000099"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="300"
height="250"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="SRC"
value="http://marshal.frognet.net:7070/amn/2006-09-22_reddahlia.mp4">
<param name="AUTOPLAY" value="false">
<param name="CONTROLLER" value="true">
<param name="LOOP" value="false">
<param name="SCALE" value="aspect">
<param name="HREF"
value="RTSP://marshal.frognet.net:7070/amn/2006-09-22_reddahlia.mp4">
<param name="BGCOLOR" value="#000099">
<embed
src="HTTP://marshal.frognet.net:7070/amn/2006-09-22_reddahlia.mp4"
width="300"
height="250"
href="RTSP://marshal.frognet.net:7070/amn/2006-09-22_reddahlia.mp4"
target="QuickTimePlayer"
loop="false"
scale="aspect"
autoplay="false"
controller="true"
pluginspage="http://www.apple.com/quicktime/download/"
bgcolor="000099"
></embed></object>
<!-- End Copy -->


...is converted by the youtube plugin into this code...

<!-- Include this video on your site :: Start Copy -->
<!-- Make sure to link to the AMN. The more people that visit the AMN,
-->
<!-- the better it is for everyone in the local scene -->
<!-- Please note : All videos will be moving to a new server soon. -->
<!-- Check back for updated code if your video breaks -->
<object width="300" height="250"><param name="movie"

value="http://www.youtube.com/v/http://marshal.frognet.net:7070/amn/2006-01-21_rd.mp4"
/>
<param name="wmode" value="transparent" />
<embed
src="http://www.youtube.com/v/http://marshal.frognet.net:7070/amn/2006-01-21_rd.mp4"

type="application/x-shockwave-flash"
wmode="transparent"
type="application/x-shockwave-flash"
width="300"
height="250">
</embed>
</object>
<!-- End Copy -->


... Thus destroying all media links in a post.

Fixes: I don't know if this is possible, but the plugin should do the
following checks before assuming a media object is youtube.
1) check to see if the class-id attribute is present in an object tag. If
the class-id is present AND not flash, don't alter the code.
2) Use a regular expression to check the value attribute of the object tag
to see if youtube.com is present. If the value does not contain
youtube.com, do not alter the code


Thanks.



Date: 2007-04-02 09:36
Sender: victor_a36


File Added: youtube_xhtml_workaround.zip


Date: 2007-04-02 09:21
Sender: victor_a36


The function _parseAttributes() uses the embed tag to parse attributes and
values in stead of the object tag.
For now, i'm using a quick workaround that generates the embedded code as
comment. Not very need, but it works and it's xhtml valid.

For example:
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/271Pg1oQGEY" />
<param name="wmode" value="transparent" />
<!--<embed src="http://www.youtube.com/v/271Pg1oQGEY"
type="application/x-shockwave-flash" wmode="transparent"
type="application/x-shockwave-flash" width="425" height="350"></embed>-->
</object>

File Added: youtube_xhtml_workaround.zip


Date: 2007-03-30 16:49
Sender: nobody

Logged In: NO

Fix for the Drupal problem was to disable code cleanup under tinmyMCE. It
no longer removes the video after a edit but it will if you press enter
after a video to start a new line to type. If there is already typing under
the video you are fine.


Date: 2007-03-29 13:01
Sender: nobody

Logged In: NO

where can we put this filess any one help


Date: 2007-03-29 06:20
Sender: mrbinky3000


I don't know if this helps, but I finally got the plugin to NOT delete the
youtube code in the editor when editing an existing post.

I don't know the specifics, but I assume there is some javascript that
identifies a the youtube html code and then represents it as a large
colored box in the TinyMCE editor. The code works fine on the non-XHTML
compliant version. However, the XHTML compliant version has bugs. The
plugin can't recognize the xhtml code that it generated. So, when you
reload the code into the editor from a database, it strips out a bunch of
the code and does other weird stuff.

Is TinyMCE even XHTML compliant? Maybe it's a larger issue?


Date: 2007-03-29 05:41
Sender: mrbinky3000


What format should the URL be in? This URL...
http://drupal.org/node/130267
... claims that it must be in this form...
http://www.youtube.com/watch?v=sdfasdfadsfa
... however youtube lets you copy the link off their webiste in this
form....
http://www.youtube.com/v/sfasdfasdfa
... and this way ...
http://youtube.com/v/asdfasdfasd

Thanks


Date: 2007-03-29 05:05
Sender: mrbinky3000


Whenever I try to pull info from a database to display it in a tinyMCE
enabled textarea, tinymce strips out the youtube code. Hence, if I try and
allow my users to edit a previously submitted post that contains youtube,
the youtube info is removed. I am using the valid XHTML version of this
plugin. Anyone have similar problems?


Date: 2007-03-29 05:04
Sender: nobody

Logged In: NO

Whenever I try to pull info from a database to display it in a tinyMCE
enabled textarea, tinymce strips out the youtube code. Hence, if I try and
allow my users to edit a previously submitted post that contains youtube,
the youtube info is removed. I am using the valid XHTML version of this
plugin. Anyone have similar problems?


Date: 2007-03-28 13:10
Sender: nobody

Logged In: NO

This works in my Drupal install BUT when i go back and edit a node, the
video is a image in the editor but the code is gone. When I try and save
the video and all the code is gone.


Date: 2007-03-26 07:49
Sender: victor_a36


Try this code:

tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,paste,imagemanager,youtube",
theme_advanced_buttons3_add_before :
"tablecontrols,separator,youtube,separator"
});



Date: 2007-03-25 13:28
Sender: mryiac


Thanks for the post. Looks like just what I need. However, I can't seem
to get it to go. I've downloaded it and dropped it into the plugin
directory within TinyMCE. It does not seem to be initializing the plugin
and I can't get the code to go when I run TinyMCE.

Any comments as to what I am doing wrong? Sorry for the potentially
stupid question but I am kind of at a loss with this one.



Date: 2007-03-24 05:17
Sender: nobody

Logged In: NO

123


Date: 2007-03-05 02:13
Sender: nobody

Logged In: NO

shee



Date: 2007-03-02 19:33
Sender: nababx


Thanks for that, it works really well.

In case someone needs the fr.js:

// Fr lang variables

tinyMCE.addToLang('youtube',{
title : 'Ajouter / Modifier une video YouTube',
desc : 'Ajouter / Modifier une video YouTube',
file : 'URL de la video',
size : 'Taille',
general : 'G&eacute;n&eacute;ral'
});



Date: 2007-02-27 11:52
Sender: crazy2


Thnx

This works very wel :)


Date: 2007-02-27 11:46
Sender: victor_a36


Output of youtube_valid_xhtml.zip:

<object type="application/x-shockwave-flash" style="width: 425px;
height:350px;" data="http://www.youtube.com/v/KFtc_rpg-Wg">
<param name="movie" value="http://www.youtube.com/v/KFtc_rpg-Wg" />
<param name="wmode" value="transparent" />
</object>


Date: 2007-02-27 11:43
Sender: victor_a36


good point!


File Added: youtube_valid_xhtml.zip


Date: 2007-02-27 10:25
Sender: crazy2


What is the html the plugin enter?

I'm looking for a script that make valid xhtml


Attached Files ( 3 )

Filename Description Download
youtube.zip YouTube plugin [TinyMCE] Download
youtube_valid_xhtml.zip YouTube valid XHTML code Download
youtube_xhtml_workaround.zip Update with workaround "drupal problem" Download

Changes ( 5 )

Field Old Value Date By
File Added 223305: youtube_xhtml_workaround.zip 2007-04-02 09:36 victor_a36
File Deleted 223300: 2007-04-02 09:26 victor_a36
File Added 223300: youtube_xhtml_workaround.zip 2007-04-02 09:21 victor_a36
File Added 217970: youtube_valid_xhtml.zip 2007-02-27 11:43 victor_a36
File Added 217845: youtube.zip 2007-02-26 17:16 victor_a36