Unwanted moxieplayer code added

7 posts by 2 authors in: Forums > CMS Builder
Last Post: May 21, 2013   (RSS)

By Thomas - May 19, 2013

Hi,

I am trying to use the HTML box to add a flowplayer video box

<div style="width: 550px; margin: 0 auto;" align="center">
<div class="flowplayer" data-swf="http://rba-online.s3.amazonaws.com/flowplayer/flowplayer.swf" data-ratio="0.5625" style="text-align: center;"><video width="320" height="240"><source src="http://rba-online.s3.amazonaws.com/videos/ATLCo-AAT.mp4" type="video/mp4" /><source src="http://rba-online.s3.amazonaws.com/videos/ATLCo-AAT.flv" type="video/flash" /></video></div>
</div>

but it gets auto converted to 

<div style="width: 550px; margin: 0 auto;" align="center">
<div class="flowplayer" data-swf="http://rba-online.s3.amazonaws.com/flowplayer/flowplayer.swf" data-ratio="0.5625" style="text-align: center;"><video width="320" height="240"><source src="http://rba-online.s3.amazonaws.com/videos/ATLCo-AAT.mp4" type="video/mp4" /><source src="http://rba-online.s3.amazonaws.com/videos/ATLCo-AAT.flv" type="video/flash" /><object width="320" height="240" data="http://www.rba-online.com/ivf/3rdParty/tiny_mce/plugins/media/moxieplayer.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.rba-online.com/ivf/3rdParty/tiny_mce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//rba-online.s3.amazonaws.com/videos/ATLCo-AAT.mp4&amp;poster=/" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /></object></video></div>
</div>

How can I prevent this from happening?

Many thanks

By gregThomas - May 20, 2013

Hi Thomas,

Have you tried asking in the flow player forum? You can find it here:

http://flowplayer.org/forum/

Cheers

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Thomas - May 20, 2013

Thank you gregThomas.

I can do that, but it does not seem Flowplayer related.

The Flowplayer code works if I hand code an HTML test page, it's just that when I try to add code to a CMS builder page via HTML in the WYSIWYG form it adds the new code.

<object width="320" height="240" data="http://www.rba-online.com/ivf/3rdParty/tiny_mce/plugins/media/moxieplayer.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.rba-online.com/ivf/3rdParty/tiny_mce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//rba-online.s3.amazonaws.com/videos/ATLCo-AAT.mp4&amp;poster=/" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /></object>

It is trying to add this from the /3rdParty/tiny_mce/plugins/media/moxieplayer.swf which is associated with the CMS builder installation.

If I just have flash in the <video> tags this doesn't happen, just when I add the mp4 handler.

I guess the editor is trying to create a non HTML 5 flash fallback, but I already have one built into Flowplayer so it is messing that up.

By gregThomas - May 20, 2013

Hi Thomas,

You're right, this is a Tiny MCE issue. I've found a work around that stops Tiny MCE trying to add it's own flash system. If you go to cmsAdmin/lib/wysiwyg_custom.php. Half way down the page you should see a large JavaScript script tag, if you add the following code to it around line 82:

paste_text_sticky: true, // if user clicks "paste as text" don't unselect it after they paste, wait for them to click it again
    setup: function(ed) {
      ed.onInit.add(function(ed) { // from: http://tinymce.moxiecode.net/punbb/viewtopic.php?pid=73053#p73053
       ed.pasteAsPlainText = true;
       ed.controlManager.setActive("pastetext", true);
      });
    },
    flash_video_player_url: false,
    // v2.50 - allow style in body (invalid XHTML but required to style html emails since many email clients won't display remote styles or styles from head)
    // Reference: http://www.tinymce.com/wiki.php/Configuration:valid_children
    valid_children : "+body[style]",

The code you need to add is highlighted in green. 

This will stop TinyMCE trying to add its own flash player.

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By Thomas - May 21, 2013

I figured it out the wysiwyg_custom.php with this page

http://www.interactivetools.com/kb/article.php?Customizing-the-WYSIWYG-editor-buttons-22

I added the code and all seems to work :)

Thanks again Greg!

By gregThomas - May 21, 2013

Sorry, I should have mentioned about setting up wysiwyg_custom.php. Glad you've got it working.

Thanks

Greg

Greg Thomas







PHP Programmer - interactivetools.com