Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:41:46+00:00 2026-06-08T13:41:46+00:00

I am using TinyMCE 3.4.9 and am trying to force the media plugin to

  • 0

I am using TinyMCE 3.4.9 and am trying to force the media plugin to always use the Flash embedding instead of iFrame embedding.

For security reasons, I don’t want to allow any embedding of iFrames.

I have formatted the URL manually to get a Flash embed object instead of the iFrame object.

IE-

  • Flash embed: http://www.youtube.com/v/fWNaR-rxAic
  • iFrame embed:
    http://www.youtube.com/watch?v=fWNaR-rxAic

Is there a way to do one of the two:

  1. Onchange of the embed file/URL field, modify the URL so that the Flash object will be embedded by default. (http://www.youtube.com/watch?v=fWNaR-rxAic would be converted to http://www.youtube.com/v/fWNaR-rxAic)
  2. Change the call to youtube so that youtube will return the Flash object instead of the iFrame.

My TinyMCE initialization code is:

<script language="javascript" type="text/javascript">
    tinyMCE.init(
        {
            paste_remove_styles : true,
            gecko_spellcheck : true,
            theme_advanced_font_sizes : "1,2,3,4,5",
            extended_valid_elements:"script[charset|defer|language|src|type]",
            theme : "advanced",
            mode: "exact",
            plugins: "inlinepopups,emotions,searchreplace,paste,media",
            elements : "blogcontent",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_buttons1 : "bold,italic,underline,strikethrough,sub,sup,|,fontselect,fontsizeselect,forecolor,|,link,unlink,|,backcolor",
            theme_advanced_buttons2 : "justifyleft,justifycenter,justifyright,|,search,replace,|,image,charmap,emotions, media,|,undo,redo",
            theme_advanced_buttons3 : "",
            theme_advanced_resize_horizontal : false,
            theme_advanced_resizing : false,
            file_browser_callback : 'file_browser',
            relative_urls : false,
            remove_script_host : false,
            paste_retain_style_properties : "font-size,color,font-family,background-color",
            setup : 
                function(ed)
                {
                    ed.onKeyUp.add(
                        function(ed, e)
                        {
                            ed.nodeChanged();
                        }
                    );
                }
        }
    );

</script>

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:41:48+00:00Added an answer on June 8, 2026 at 1:41 pm

    Since I haven’t found a way to force flash embedding of youtube videos I created a work around for the iframe security problem.

    I have added the iframe to the allowed tags list and on display of the content to the user after saving, I have a whitelist filter applied to any iframes that pulls out any iframes that don’t have a src in the whitelist.

    function filterIframeBySource($text, $allowed_sources)
    {
        // regex to retrieve just the iframes
        $regex      = '/<iframe[0-9a-zA-Z \.\/=>:\-"]*<\/iframe>/';
        $matches    = array();
        $reg_pos    = preg_match($regex, $text, $matches);
    
        // loop through each match and check the src for that iframe
        $src_expression = '/ src="http:\/\/('.str_replace('.', '\.', implode('|', $allowed_sources)).')[0-9a-zA-Z\/-]*" /';
        foreach($matches as $match)
        {
            $src_pos    = preg_match($src_expression, $match);
    
            if($src_pos !== false && $src_pos === 0)
                $text   = str_replace($match, '[Removed iFrame]', $text);
        }
        return $text;
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the jQuery plugin for TinyMCE and have had a hard time trying
I'm using tinymce jquery plugin and trying to access the api after initializing an
I have been using tinyMce_hammer plugin to use tinymce in my rails app... but
I am using TinyMCE Editor Extender and trying to show the text on clicking
I am trying to absolutely position a TinyMCE editor at a set position using
I am using the fullpage plugin: I am trying to create a way for
I am using tinyMCE editor plugin. It converts texareas into iframes and a toolbar
I'm using TinyMCE editor version 3.5 with jQuery. I'm having problem when I'm trying
I am using TinyMCE jquery plugin in my project. It works fine. I am
I am trying to select a specified text in TinyMCE editor using JavaScript in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.