Embed Videos in Help Center Articles with Two Easy Steps (using video.js)



image avatar

ModeratorWes

Most Engaged Member of All Time - 2021

Posted Oct 11, 2013

Zendesk level:  Beginner
Knowledge:  HTML
Time Required:  10 minutes

Updated:  07/24/14 - Latest version of CDN 4.6

Updated:  11/20/15 - Latest version of CDN 5.2.1

Updated: 05/16/18 - Latest version of CDN 6.9.0

 
Note the following before you begin:
  • To embed videos in your articles, you must first enable unsafe HTML in pages.
  • The links below are examples of videos. You'll need to replace these links with your own content.
  • Use the method described in this tip if you are not using a public hosted video service, such as Wistia or YouTube.

This tutorial will show you how you can embed your company’s help videos into the Help Center.  We will accomplish this in two easy steps and without uploading any files into Help Center. 

In researching what video player to use I decided to use Video.js as it’s very simple to use, open source, 100% percent free to everyone, HTML5-works in all browsers, and they host their CSS & JavaScript files. 

Let’s Get Started

STEP 1

First let’s add the Video.js CSS and JavaScript code in your “Document Head” section of your site.

  1. In Guide, click the Customize design icon in the sidebar.
  2. Click the theme you want to edit to open it.
  3. Click Edit Code.
  4. In the Templates section, open the document_head.hbs template.
  5. Add the following code, replacing with links to own content:
    <link href="https://vjs.zencdn.net/6.9.0/video-js.css" rel="stylesheet">
    <script src="https://vjs.zencdn.net/6.9.0/video.js"></script>

 Screenshot below is an example of what it should look like.  Please note the older version being used.

STEP 2

  1. In the top menu bar, select  Articles > Add Article.
  2. Click the html button in the article toolbar.
  3. Copy and paste the following code:

    <video id="example_video_1" class="video-js vjs-default-skin"

      controls preload="auto" width="600" height="264"

      poster="https://video-js.zencoder.com/oceans-clip.png"

      data-setup='{"example_option":true}'>

     <source src="https://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />

     <source src="https://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />

     <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />

    </video>

  4. Click Add to publish your article and view the video.

You can edit the width and height. Remember that you will need to need to replace https://video-js.zencoder.com/oceans-clip.xxx with the link to your video.

That's it!

In just two easy steps you can embed your own help videos into the articles. If you want to get advanced you can customize the CSS and HTLM for the video player.  See the Video.js website for additional details on how to do this.

Enjoy.

  • HC-Video.png
  • HC-Video-DH.png
  • HC-Video-Article.png

0

112

112 comments

The option doesnt appear to be available for the Community section of the help section, any idea how customers an post their videos?

 

0


@Ryan - Did you link to one of your own videos as the links in my code were just an example which they may have moved.

0


@Wes Yes it is enabled.

0


@Ryan did you make sure to do the following:

Before you can embed videos in your articles, you must enable unsafe HTML in pages

0


I am having an issue where the video player is visible, but there is no sign of a playable video. The only two things I did was
copy and paste those two bits of code.

0


@Keiron - Glad to hear that you found some of my other tips and tricks useful.  My notification tip uses article labels and the API to display notifications so eventually I will get around to updating the icon tip so you could just put a label on the article and it would add the icon based on the label.  Just have alot on my plate right now but I will get to it at some point in time.  Best of luck customizing your Help Center as it sounds like you are on your way to great looking HC.

0


Initially I just wanted to add Youtube videos, and found your repeated instructions regarding the unsafe html option.  But, also, embed code must be entered via the <> source code!  Thanks for that!

But, I also used your code here - and WOW what a bonus!  I hadn't thought about doing this until reading through the thread here.

https://gist.github.com/moderatorwes/9f20dabd77e4257887a9

Now, adding the Font Awesome YouTube icon to all relevant lists, titles and search results :)  Makes for a very clean, eye-catching, short-hand for video resources on the site!


Thanks so much!

0


@Kieron - Its my pleasure to be able to help and assist in any way that I can.  :-)  If you ever need anything just let me know.

0


Thanks Wes for all your help here!

0


@ludovic - I would assume Google Drive should give you some embed code, just paste that code into your Help Center article using the "Source icon" which should be the last icon on the right hand side of the editor.

0


Post is closed for comments.

Didn't find what you're looking for?

New post