The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Embedding video into knowledge articles

saj4
Kilo Expert

Hi, I'm trying to embed a video (shockwave flash) into a knowledge article.

I have imported the video into ServiceNow (System UI > Videos) and it plays fine.

The knowledge articles allow videos to be embedded via 'insert/edit' video option. I am able to select and embed the video (its shows as a grey image) but upon saving the article and then trying to view the article or re-edit it, the video is nowhere to be seen or found.

Am using latest Fuji release and tried both firefix and chrome browsers.

Has anyone been able to successfully embed videos into knowledge arcticles or advise if I need to do anything additional? Thx.

1 ACCEPTED SOLUTION

Video not working in the HTML field on Knowledge is almost certainly down to HTML Sanitize being on on that field. I had the same issue. Video worked, saved the record and then it just isn't there.



The HTML Sanitizer property can be disabled either globally or on a a field by field basis. By default it's enabled and causes the issue you are seeing.



see:



HTML Sanitizer - ServiceNow Wiki



Hope that fixes your issue.


View solution in original post

16 REPLIES 16

dhoffman
Tera Contributor

We're experiencing this issue as well.   We're on Fuji Patch 8 and using Knowledge Management v3.   Copying the YouTube "embed" code...



<iframe width="560" height="315" src="https://www.youtube.com/embed/7JrLzURzsBA" frameborder="0" allowfullscreen></iframe>



...gets completely stripped out when saving the article.   Maybe there's some security setting related to iframes?



Edit:   Yep.   The iframe tag gets sanitized by the HTML Sanitizer.   This thread discusses editing the script include to whitelist the iframe tag.   This Wiki article also discusses it:   HTML Sanitizer - ServiceNow Wiki


You can create a separate Knowledge article which is an HTML page with an automatic redirect to the video.


If you check "Attachment link" the HTML ( and video ) will launch when people access the article.



Then in your article where you want to embed the video, embed a link to that HTML article with the redirector page.


The text for a redirect page to your video would look like this:



<html><head>


<meta http-equiv="refresh" content="0; url=https://www.youtube.com/embed/7JrLzURzsBA" />


</head>


<body>


If you can read this, click the following link to see the video.


<a href="https://www.youtube.com/embed/7JrLzURzsBA">Watch Video</a>


</body>


</html>


In my previous reply, I tried to provide the raw HTML for the redirector page.


Somehow it was interpreted and the the display version is what resulted.



I'm trying it again here:



<html><head>


<meta http-equiv="refresh" content="0; url=https://www.youtube.com/embed/7JrLzURzsBA" />


</head>


<body>


If you can read this click the following link to see the video.


<a href="https://www.youtube.com/embed/7JrLzURzsBA">Watch Video</a>


</body>


</html>



This is what the article should look like


html_code.gif


Here it is with the leading '<' stripped.



html><head>


meta http-equiv="refresh" content="0; url=https://www.youtube.com/embed/7JrLzURzsBA" />


/head>


body>


If you can read this click the following link to see the video.


a href="https://www.youtube.com/embed/7JrLzURzsBA">Watch Video   &lt;/a>


/body>


/html>


I give up!