Integraged VideoJS

This commit is contained in:
Pierre 2018-01-03 10:37:46 +01:00
parent 715871b5e1
commit 6f3bfaff1e
2 changed files with 29 additions and 0 deletions

View File

@ -14,4 +14,9 @@
.post .post-image { .post .post-image {
width: 100%; width: 100%;
}
.post .post-video {
max-width: 100%;
height: 300px;
} }

View File

@ -100,6 +100,30 @@ ComunicWeb.components.posts.ui = {
} }
} }
//In case of video
else if(infos.kind == "movie"){
//Create video element
var video = createElem2({
appendTo: postRoot,
type: "video",
class: "video-js vjs-default-skin post-video"
});
video.setAttribute("controls", "");
//Add source
var video_src = createElem2({
appendTo: video,
type: "source",
src: infos.video_infos.url
});
video_src.type = infos.video_infos.file_type;
//Enable videoJS
videojs(video);
}
else { else {
//Log error //Log error
ComunicWeb.debug.logMessage("Not implemented kind of post: " + infos.kind); ComunicWeb.debug.logMessage("Not implemented kind of post: " + infos.kind);