Embed a video in a knowledge article

frank_magnin
Kilo Contributor

Hi,

I have uploaded a video (.mp4) via System UI>Videos. This video is playing viewing in the list view of active videos.

find_real_file.png

When I want to insert this video to a new or existing knowledge article using the find_real_file.png option:

find_real_file.png

the video is added to the article.

find_real_file.png

After Update the video is gone...

Any idea what I am doing wrong here?

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Hi Frank,



Link Help with videos in Knowledge Articles   should help.


fosborne
ServiceNow Employee
ServiceNow Employee

Hi Frank,

You need to disable the HTML Sanitizer.

I just posted a document I put together where I was doing this.

How to embed Documents in KB Articles

 

  1. Enter sys_properties.list in your filter navigator. Set the value of  glide.html.sanitize_all_fields to falsefind_real_file.png
  2. Disable the HTML Sanitizer text field in the kb_knowledge table. (use the advanced view so you easily add to Attributes of the dictionary entry. Add html_sanitizer=false to the list of attributesfind_real_file.png

lasse3
Mega Guru

Disabling the HTML Sanitizer has a lot of negative impact as you then risk to pollute your knowledge articles with all kinds of more or less valid HTML code and also poses a security risk.

Instead I would recommend to modify the HTMLSanitizerConfig script include to whitelist videos.

Go to: System definition -> Script includes

Find: HTMLSanitizerConfig

Mine looks like this:

var HTMLSanitizerConfig = Class.create();
HTMLSanitizerConfig.prototype = {
	initialize: function() {
	},
	
	HTML_WHITELIST : {
		globalAttributes: {
			attribute:[],
			attributeValuePattern:{}
		},
		embed:{attribute:["src","type","allowfullscreen","allowscriptacces","plugnspage","width","height"]},
		object:{attribute:["classid","codebase","width","height"]},
		param:{attribute:["name","value"]}
	},
	
	HTML_BLACKLIST : {
		globalAttributes: {},
	},
	
	getWhiteList : function() {
		return this.HTML_WHITELIST;
	},
	
	getBlackList : function() {
		return this.HTML_BLACKLIST;
	},
	
	type: 'HTMLSanitizerConfig'
};

I hope this helps!

/Lasse

 

Thank You, this works perfectly!