TinyMCE - Insert / Edit embedded media - Video not showing?

This board for support questions on Joomla 1.6 RC (= Release Candidate - which should NOT be used on a production server) is NO longer active because Joomla 1.6.0 has been released.

>> For Joomla! 1.6 Support Questions, please use viewforum.php?f=614 instead <<
Forum rules
Please use the Forum Post Assistant to give your server setting details which are necessary to determine the problem.
bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

TinyMCE - Insert / Edit embedded media - Video not showing?

Postby bongobongo » Wed Jul 07, 2010 11:01 am

Hi

I try to insert a video into an article using the TinyMCE in extended mode.

I click the button: "Insert / Edit embedded media"

Then I paste an url from [youtube] into the File / URL field in the dialog box.
Type: Flash
When I leave the "File / URL" field, then the video show up in the preview area in the dialogbox.

Now, when I click Insert, I only see a yellow square with a flash icon in the middle.

When I save it and show the article on the frontend, then no video is displayed.

What do I have to do to make this work?

User avatar
srikanthg
Joomla! Guru
Joomla! Guru
Posts: 509
Joined: Tue Aug 05, 2008 11:34 am
Location: Hyderabad
Contact:

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby srikanthg » Wed Jul 07, 2010 11:43 am

Disable the TinyMCE in Global Configuration or For a particular user account.Then it should work.
Last edited by srikanthg on Wed Jul 07, 2010 11:53 am, edited 1 time in total.

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Wed Jul 07, 2010 11:50 am

srikanthg wrote:Disable the TinyMCE in Global Configuration or For a particular user account.Then it should word.


Could you please be more specific?
I do not understand what you mean.

User avatar
srikanthg
Joomla! Guru
Joomla! Guru
Posts: 509
Joined: Tue Aug 05, 2008 11:34 am
Location: Hyderabad
Contact:

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby srikanthg » Wed Jul 07, 2010 12:03 pm

In your Global Settings set editor to "No Editor" and insert video.
OR
Create a new user account and set User Editor as "No Editor" for that user.Then login with this user account and embed videos in articles.

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Wed Jul 07, 2010 12:31 pm

Hi

This sounds like a pretty weird solution.
Do you tell your customers to use your "workaround"? I definitely do not want to do that!

I want to use the TinyMCE built in solution for inserting videos to an article.
Why is it not working in TinyMCE, in Joomla 1.6 as is, and how can I make it work?

Maybe the TinyMCE editor in Joomla 1.6 filter away some tags when the code is inserted into the editor when I click the Insert button in "Insert / Edit embedded media" dialog....?
Does anybody know if this is the case?

User avatar
srikanthg
Joomla! Guru
Joomla! Guru
Posts: 509
Joined: Tue Aug 05, 2008 11:34 am
Location: Hyderabad
Contact:

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby srikanthg » Wed Jul 07, 2010 12:47 pm

bongobongo wrote:Hi
I want to use the TinyMCE built in solution for inserting videos to an article.
Why is it not working in TinyMCE, in Joomla 1.6 as is, and how can I make it work?

Maybe the TinyMCE editor in Joomla 1.6 filter away some tags when the code is inserted into the editor when I click the Insert button in "Insert / Edit embedded media" dialog....?
Does anybody know if this is the case?

All WYSIWYG editors strip any code pasted in them if they don't understand properly.
Use some plugins to embed media :http://extensions.joomla.org/extensions/812/details
Last edited by srikanthg on Wed Jul 07, 2010 2:29 pm, edited 1 time in total.

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Wed Jul 07, 2010 2:19 pm

Hi

I appreciate the feedback

But none of them works in Joomla 1.6.
Well, disabling TinyMCE might work, but is not an option for me.
JoomlaWorks AllVideos are joomla 1.5 compatible.

I find it hard to belive that there is no setting in Joomla 1.6 that enable the inserted code from the TinyMCE "Insert / Edit embedded media" dialog to actually be inserted without beeing filtered.

I find in Joomla 1.6 in "Article managers" -> Options dialog -> Tab: Text filters

Is it not possible to set up Text filters in such way that the inserted code from the TinyMCE "Insert / Edit embedded media" dialog actually works (not get filtered)?

Anybody?

*** UPDATE ****

Here is the code that should have been inserted when using
the TinyMCE "Insert / Edit embedded media" dialog
(this is what is in the preview area of the dialog if you inspect it):


Code: Select all

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="300" height="200" id="obj" name="eobj" align=""><param name="src" value="http://www.[youtube].com/v/LTGwBpigmKw&amp;feature"><param name="url" value="http://www.[youtube].com/v/LTGwBpigmKw&amp;feature"><param name="width" value="300"><param name="height" value="200"><param name="id" value="obj"><param name="name" value="eobj"><param name="align" value=""><embed type="application/x-shockwave-flash" src="http://www.[youtube].com/v/LTGwBpigmKw&amp;feature" width="300" height="200" id="obj" name="eobj" align=""></object>


Here is the code that is actually left when looking at the code in TinyMCE after inserting the video:

Code: Select all

<img src="http://www.mydomain.no/socrith/media/editors/tinymce/jscripts/tiny_mce/plugins/media/img/trans.gif" mce_src="media/editors/tinymce/jscripts/tiny_mce/plugins/media/img/trans.gif" class="mceItemFlash" title="src:'http://www.[youtube].com/v/LTGwBpigmKw&amp;feature',width:'300',height:'200'" width="300" height="200" align=""><br mce_bogus="1">


Now if someone could tell me how to use the
"Article managers" -> Options dialog -> Tab: Text filters


so the video related stuff not get filtered out, then things would look a lot brighter

I have tried to do this the following here:
"Article managers" -> Options dialog -> Tab: Text filters

I have selected "Administrator" and "Super users" from "Filter groups"
Then I set "Filter type" to "Blacklist (Default)"
"Filter tags" and "Filter attributes" are both empty.

Then I try to insert a video into an article using the TinyMCE butto:
"Insert / Edit embedded media"

Flash, and just insert a [youtube] URL to the video.
The code that is inserted when I click Insert button in the dialog still gets filtered.... bahhhhh

Is the text filters not working yet?

f3cp
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jul 08, 2010 5:01 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby f3cp » Thu Jul 08, 2010 5:13 am

In my trials making changes to the text filter features in the Joomla admin does not appear to be working correctly.
As a temporary measure I have removed the black list used in the text filtering altogether:

In the filterinput.php file I deleted all the items from the blacklist arrays I didn't want blacklisted. You can probably just delete the ones that are used in your video code.

e.g.

Line 51

Code: Select all

    * @var   array   A list of the default blacklisted tags.
    */
   var $tagBlacklist = array ('applet', 'body', 'bgsound', 'base', 'basefont', 'embed', 'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link', 'meta', 'name', 'object', 'script', 'style', 'title', 'xml');

   /**
    * @var   array   A list of the default blacklisted tag attributes.
    */
   var $attrBlacklist = array ('action', 'background', 'codebase', 'dynsrc', 'lowsrc'); // also will strip ALL event handlers


Line 51

Code: Select all

    * @var   array   A list of the default blacklisted tags.
    */
   var $tagBlacklist = array ('body');

   /**
    * @var   array   A list of the default blacklisted tag attributes.
    */
   var $attrBlacklist = array ('lowsrc'); // also will strip ALL event handlers

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Thu Jul 08, 2010 6:00 am

A bug has been opened in the tracker:

See:
http://joomlacode.org/gf/project/joomla ... m_id=21338

I really hope this will be fixed ASAP.

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Thu Jul 08, 2010 6:26 am

I tried to change the filterinput.php so $tagBlacklist and $attrBlacklist look like this:

Code: Select all

 * @var   array   A list of the default blacklisted tags.
    */
   var $tagBlacklist = array ('body');

   /**
    * @var   array   A list of the default blacklisted tag attributes.
    */
   var $attrBlacklist = array ('lowsrc'); // also will strip ALL event handlers


Did not work after that change was made... by some reason....
Anything else that need a change to make it work?

User avatar
srikanthg
Joomla! Guru
Joomla! Guru
Posts: 509
Joined: Tue Aug 05, 2008 11:34 am
Location: Hyderabad
Contact:

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby srikanthg » Thu Jul 08, 2010 7:22 am

bongobongo wrote:Hi
JoomlaWorks AllVideos are joomla 1.5 compatible.

I guess this Plugin should work with J1.6 also(but i did't check).Check it and let me know how it works.

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Thu Jul 08, 2010 8:31 am

Please do not post anymore JoomlaWorks stuff in this thread!

This thread is about inserting videos using TinyMCE editor.

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Thu Jul 08, 2010 2:57 pm

Found something interesting:

When you click the "Insert" button in the "Insert / Edit embedded media" dialog in TinyMCE
then it run the JS function "insertMedia()" in this file:
/media/editors/tinymce/jscripts/tiny_mce/plugins/media/js/media.js

What happens is that this test:

Code: Select all

if (fe != null && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(ed.dom.getAttrib(fe, 'class'))) {


never runs, which cause the function to run the code inside the ELSE block instead, and I belive this just output an IMG tag.

If somebody understand how to make the first part of the IF to work, please post an explanation here?

*** UPDATE - tested in joomla 1.5.x ****
I have tested the same feature in TinyMCE in Joomla 1.5.x
The code in media.js for that version look very similar to the code used for Joomla 1.6.
In Joomla 1.5.x it does not strip away the object tag, in the editor it does not look good because the only thing I see there is a yellow "placeholder" for the video, but when one view the article on the front-end then it works like a charm.
So I guess it must be the Text filter bug that causes the problems in joomla 1.6

bongobongo
Joomla! Explorer
Joomla! Explorer
Posts: 345
Joined: Mon Dec 15, 2008 11:10 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby bongobongo » Thu Aug 12, 2010 2:12 pm

I just want to confirm that the "hack" presented by f3cp earlier in this thread actually do work.

What I did was to edit this file:

/libraries/joomla/filter/filterinput.php

And change this variable ($tagBlacklist) so it look like this: (just removed object and embed):

Code: Select all

var $tagBlacklist = array ('applet', 'body', 'bgsound', 'base', 'basefont',
'frame', 'frameset', 'head', 'html', 'id', 'iframe', 'ilayer', 'layer', 'link',
'meta', 'name', 'script', 'style', 'title', 'xml');


You do not even have to mess with the "Extended Valid Elements" in the TinyMCE plugin, leave it empty.
But you might have to set "Functionality": to Extended in the plugin, in order to see the "Insert / edit embedded media" button (the one that looks like a film-strip).

This way you can omit the bug in Joomla (that the dev team are working to fix) and finally be able to insert video into your Joomla 1.6 articles, when using TinyMCE.

Just be aware that next time you update Joomla 1.6 you will have to remember to replace the filterinput.php file.

Hope this helps some other that otherwise have to use hours to figure this mess out.

leobrian
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu May 06, 2010 11:25 pm

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby leobrian » Sat Feb 26, 2011 11:58 pm

the hack that bongobongo suggested worked great for me even while using a different editor (CKEditor). So this could be a universal quick fix. Thanks for your help!

ramaolson1
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Jan 07, 2011 2:15 am

Re: TinyMCE - Insert / Edit embedded media - Video not showi

Postby ramaolson1 » Fri Mar 25, 2011 3:13 am

Nice... This was bugging the s*** out of me. Thanks for posting that fix guys. Works great for me! There's gotta be a more user friendly way to adjust what tags are filtered from the back end. Hopefully they fix that.


Return to “Joomla! 1.6 RC Support [closed]”

Who is online

Users browsing this forum: No registered users and 1 guest