English 中文(简体)
jwplayer and tinymce
原标题:

I would like to get jw player to play nicely with tinymce. Currently, tinymce just strips the embed code out, or converts it to ... which breaks it.

first aim is to even allow the jw player code

a nice-to-have would be a button to add the code through the interface.

any help much appreciated

问题回答

Here s how you can insert video to play in the JW Player in TinyMCE. You need to have the Media plugin added to the TinyMCE editor the ImageManager add-on installed.

Edit /tiny_mce/plugins/media/langs/en_dlg.js:

Anywhere after the first line insert:

allowfullscreen:"Allow Full Screen",

Edit /tiny_mce/plugins/media/media.htm:

Immediately after line 216 (contains the that ends the row that adds the Menu and Live Connect checkboxes to the Advanced section of the Insert Media dialog) insert:

{#media_dlg.allowfullscreen}

Edit /tiny_mce/plugins/media/js/media.js:

After line 73:

setBool(pl, flash , swliveconnect );

insert:

setBool(pl, flash , allowfullscreen );

After line 307 insert (Just before the code that detects a URL for YouTube has been used):

if (v.match(/(.+)(.*).flv/) || v.match(/(.+)(.*).mp4/)) {
    f.width.value =  328 ;
    f.height.value =  200 ;
    f.src.value =  /mediaplayer/player.swf?file=  + v;
    return  flash ;
}

(change /mediaplayer/player.swf to the location and name of your jw player swf file).

After line 382:

s += getBool( flash , swliveconnect , false);

insert:

s += getBool( flash , allowfullscreen , false);

Edit the ImageManager config file to allow upload of flv and mp4 files.

To insert a video, click the Insert Media button in the TinyMCE Editor Toolbar. Leave it set to Flash and Browse for the file. This will open the ImageManager. Upload the video file or select the file if it has already been uploaded to your ImageManager. The URL to the file will be inserted into the URL field of the Media dialog. This will give a preview of the video. You can change the size here is you like. Click the Insert button and a Flash Placeholder is inserted.

The answer from Barry Dixon worked from me, with a little fix in media.htm.

the onchange event did not fire in my case, as I use a personal file manager to choose the media file. I just added an onblur event:

<td><input id="src" name="src" type="text" value="" class="mceFocus" onblur="switchType(this.value);generatePreview();" onchange="switchType(this.value);generatePreview();" /></td>




相关问题
Tinymce Model Binding with ASP.NET MVC

Does anyone know how to auto-populate the tinymce editor from the ASP.NET MVC model? In other words, what code do I need to use to set the contents of tinymce? EDITED: My problem is that tinyMCE is ...

How to dynamically load & unload a TinyMCE Plugin

Does anyone know if there is a way I can dynamically load and unload a TinyMCE plugin after TinyMCE has already been loaded? Specifically, I m thinking about asking the user whether or not they wish ...

tinyMCE problem with jQuery load

I have a DIV and a Load button on my page and when I click in Load button the jQuery loads a HTML from another file, this HTML file have texteareas and start tinymce. Ex: <script language="...

TinyMCE - adding an ON/OFF toggle switch

I m using TinyMCE on the text-areas in my Magento admin section. I have my TinyMCE editor visible form the start, but I want the option to disable/re-enable it. I m using the jQuery plugin version, ...

My admin panel and upload

I have written an admin panel for my site (im beginner in php). In content.php I have insert tinyMCE editor. I want to upload images from editor. What is the best way to do this. (not very familiar ...

How to click TinyMCE toolbar s button programmatically?

I want to make preview button as usual form button next to submit button(as it made in most cases of "Post new topic" forms). How can I programmatically simulate toolbar s preview button click ? I ...

热门标签