Embed videos in HTML fields

You can insert videos into HTML fields. You can also add videos to the video library using the HTML Insert/Modify Video form.

Before you begin

Role required: The role necessary to update the record that contains the HTML field. For example, any user with a role can create a knowledge article and embed a video in it.

About this task

The following file formats are supported in the base system.
  • MPEG-4 video .mp4
  • WebM Video .webm
Internet Explorer and Safari have difficulty streaming videos uploaded to the database. Attach a file rather than embedding if you intend to use one of these browsers or an unsupported file type. For more information on attaching files, see Add and manage attachments.
Note: Administrators and users with the image_admin role can manage the video library at System UI > Videos.

Procedure

  1. Open the form that contains the HTML field.
  2. Click the position where the video is to appear, or to modify an existing video, click the video.
  3. Click the insert/edit video icon (Insert or edit video) on the HTML editor toolbar.
  4. Enter information in each field.
    Table 1. Insert/Modify Video form
    Field Description
    Type
    Select the video type.
    • Video Library: List of videos stored in the db_video table. May be reused.
    • URL: from an external source
    • Attachment: available in the current record only

    For an attachment or video library file, select a video from the list or click New. For an external URL, enter the URL.

    Size Enter the Width and Height of the video in pixels.
  5. Click OK.

What to do next

By default, the HTML Sanitizer removes videos from HTML fields. To prevent the video from being removed:

  • Add an attribute to the text field on the form that the video is added to: html_sanitize=false. Adding the attribute stops this HTML field from being sanitized in the future.
  • Modify the white list in the script include HTMLSanitizerConfig to add the embed, object, and param attributes. The script include allows the attributes to be used in all HTML fields in the future. For example:
    HTML_WHITELIST :{ 
        globalAttributes:{ 
          attribute:[], 
          attributeValuePattern:{}
        }, 
        embed:{attribute:["src","type","allowfullscreen","allowscriptacces","plugnspage"]},
        object:{attribute:["classid","codebase"]},
        param:{attribute:["name","value"]}
      }
  • Universally override elements that the TinyMCE strips out by adding a list of elements to the glide.ui.html.editor.extended_valid_elements property. For example, add a[onclick|href|target|rel|media|hreflang|type|charset|name|rev|shape|coords|download|id|accesskey|class|dir|lang|style|tabindex|title] to the system property.