I’m not sure why, but I’ve always wanted to embed a video in one of my Qlikview applications. The problem was I could never find a good reason to do so, until a week a ago.
I’ve created some training videos for my clients so they know how to use the reports in a easy way without having to read long boring manuals.
The first thing I did, was to get an extension object. I found a video player created by Alexander Karlsson.
This extension is very useful, but unfortunately I faced different problems:
1) I didn’t want to add an external URL in the extension but instead call the videos which are stored in my server.
2) Whenever I jumped between tabs, the video wouldn’t load again.
Browse videos stored in your server
There are a few things to take into account here. One of them is that the extension object says it only supports .mp4, .webm and ogg. This was bad news for me as my videos were .MOV and I was not planning to convert them to any other extension. Instead, I wanted to make the extension work my way.
After I had my videos ready, I had to find the right location to store them and be able to call them from Qlikview. If you place them anywhere in your server, they won’t display while accessing your application from outside it.
In a standard Qlikview Server installation, we can place the videos under C:\Program Files\QlikView\Web. We will also need to know the name associate it to that path in the server so we can call it externally with our URL. Wow, does that make any sense? I’ll show you.
Open QMC, go to “System”-> on the left menu click “Qlikview Web Server” and then go to “Web” tab. In the Root Folder section you’ll see C:\Program Files\QlikView\Web. and a name associated to it. Make note of that. (in my example I’ll call it WEB)
Now we are ready to include our video in the extension. Open a QV document, change to Web View and add the Video Player extension object.
Remember to first add the extension object files under:
We then go to the object properties and we add the following URL httt://<server>/WEB/myVideo.MOV
Remember to replace /WEB/ with whatever name you found in the Web tab under Qlikview Web Server.
Video not replaying
The second problem was my video not replaying if I change tabs and went back to the tab where my video extension object was. However, it did work again if I pressed F5. So I thought I should find a way to force it to play.
I decided to take a look at the extension files. If we open the Script.js file, we’ll see a few lines with HTML code. The one I was looking for looks like this:
html += ‘<video id=”example_video_1″ width=”‘ + _this.GetWidth() + ‘” height=”‘ + _this.GetHeight() + ‘” controls=”controls” preload=”auto”>’;
This extension is HTML5 compliant so the tag it uses is <Video>. In previous versions, we had to use <Object> if we wanted to achieve the same thing.
I then checked the <video> tag properties and added autoplay=”none”. This will make the video auto play whenever the extension object is active.
After these changes, I was able to reproduce my videos without the need of storing them outside my server.
NOTE: you’ll need to also add a mime type to view your videos. I’ll explain this in my next post