Skip to main content

Command Palette

Search for a command to run...

Embed YouTube in Oracle APEX Rich Text Editor (RTE)

Updated
1 min read

By default, a YouTube video or other iframe based content cannot be embedded in the Oracle APEX Rich Text Editor (RTE). To accomplish this, add the following code to an RTE Page Item in the Initialization JavaScript Function property:

function(options){
  DOMPurify.setConfig({
      ADD_TAGS: ['iframe']
  });
  options.editorOptions.extended_valid_elements = "iframe[src|frameborder|style|scrolling|class|width|height|name|align]";
  return options;
}

Many more options await as well.

Fullscreen editing:

function(options){
  options.editorOptions.plugins += " fullscreen";
  options.editorOptions.toolbar.find(i => i.name === "Extras").items.push("fullscreen");
  return options;
}

Word Count:

function(options){
  options.editorOptions.plugins += " wordcount";
  options.editorOptions.toolbar.find(i => i.name === "Extras").items.push("wordcount");
  return options;
}

There are so many fun options, check it out over at the TinyMCE Docs

More from this blog

Redstone Apps

7 posts

Redstone Content Solutions provides cutting edge solutions on Cloud platforms specializing in Oracle Cloud Infrastructure (OCI).