Legacy Knowledge Base
Published Jul. 2, 2025

Unable to embed videos in Knowledge Base articles with the

Written By

Alfonso Crisci

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

Issue

  • After publishing a new Knowledge Base article including a video embedded with the <video> HTML5 tag:
    <video controls="" height="240" width="320"><source src="/documents/20142/0/file_example_MP4_480_1_5MG.mp4/b32bbabe-2df3-5229-7ca8-39e5dfd98fa5" type="video/mp4" /></video>
    the article will not show anything and the tag will be completely removed.

Environment

  • Liferay DXP 7.0+

Resolution

  • Whitelist the com.liferay.knowledge.base.model.KBArticle class in order to prevent sanitizing <video> HTML5 tags in the Knowledge Base portlet:

    1) Go to Control Panel > Configuration > System Settings > Security Tools > AntiSamy Sanitizer and add one "Whitelist" entry for com.liferay.knowledge.base.model.KBArticle
    2) Once done, restart the Liferay server
    3) After restart, edit the previously published article and fix the source (or create a brand new article):
    <video controls="" height="240" width="320"><source src="/documents/20142/0/file_example_MP4_480_1_5MG.mp4/b32bbabe-2df3-5229-7ca8-39e5dfd98fa5" type="video/mp4" /></video>
    4) Re-publish the video: it should now be visible

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base