diff --git a/assets/css/components/posts/ui.css b/assets/css/components/posts/ui.css index 8362bf3d..cc0b0ad3 100644 --- a/assets/css/components/posts/ui.css +++ b/assets/css/components/posts/ui.css @@ -14,4 +14,9 @@ .post .post-image { width: 100%; +} + +.post .post-video { + max-width: 100%; + height: 300px; } \ No newline at end of file diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index bb706b4c..2ca5a7a0 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -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 { //Log error ComunicWeb.debug.logMessage("Not implemented kind of post: " + infos.kind);