I am using VideoJS on my page to load a video and play it. Currently VideoJS on my page supports youtube, vimeo and mp4 video types.
Here is my code:
<video
id="myVideo"
ng-show="urlProvided"
class="video-js vjs-default-skin"
controls
width="600"
data-setup='{ "techOrder": ["html5", "flash", "youtube", "vimeo"]}'
>
</video>
JS: this function check type of video and passes the right "type" parameter
function playApropriateType(url) {
//check if video is from youtube
if(url.indexOf('youtube') != -1) {
scope.player.src({type: 'video/youtube', src: url});
scope.player.load();
}
//check if video is simple vimeo or mp4
else if(url.indexOf('mp4') == -1 && url.indexOf('vimeo') != -1){
scope.player.src({type: 'video/vimeo', src: url});
scope.player.load();
}
//check if link is vimeo from payed account
else if( ((url.indexOf('mp4') != -1) && (url.indexOf('vimeo') != -1)) || url.indexOf('mp4') != -1) {
scope.player.src({"type":"video/mp4", "src":url});
scope.player.load();
}
}
This part works fine.
Now I need to be able to add a kaltura video so I added another "if" statement, something like this:
//KALTURA NOT WORKING
else if(url.indexOf('kaltura') != -1) {
scope.player.src({"type":"video/webm", "src":url});
scope.player.load();
}
but it says that the format is not supported.
VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The media could not be loaded, either because the server or network failed or because the format is not supported.
NOW: I don't know, is it because VideoJS doesn't support Kaltura videos or it is just that I am missing something?