From 6f3bfaff1e2dc6094b4b21acbac9f1d7431db6e6 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 3 Jan 2018 10:37:46 +0100 Subject: [PATCH] Integraged VideoJS --- assets/css/components/posts/ui.css | 5 +++++ assets/js/components/posts/ui.js | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) 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);