From 6ab0c8fff13a8c994ed844283658f841580a1c58 Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 4 Jan 2018 17:16:27 +0100 Subject: [PATCH] Improved video rendering --- assets/css/components/posts/ui.css | 4 ++++ assets/js/components/posts/ui.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/assets/css/components/posts/ui.css b/assets/css/components/posts/ui.css index 23c9c036..f8fcf51e 100644 --- a/assets/css/components/posts/ui.css +++ b/assets/css/components/posts/ui.css @@ -17,6 +17,10 @@ } .post .post-video { + text-align: center; +} + +.post .post-video video { max-width: 100%; height: 300px; } diff --git a/assets/js/components/posts/ui.js b/assets/js/components/posts/ui.js index 6c482ca0..17eb5cfc 100644 --- a/assets/js/components/posts/ui.js +++ b/assets/js/components/posts/ui.js @@ -107,11 +107,17 @@ ComunicWeb.components.posts.ui = { //In case of video else if(infos.kind == "movie"){ + var videoContener = createElem2({ + appendTo: postRoot, + type: "div", + class: "post-video" + }); + //Create video element var video = createElem2({ - appendTo: postRoot, + appendTo: videoContener, type: "video", - class: "video-js vjs-default-skin post-video" + class: "video-js vjs-default-skin" }); video.setAttribute("controls", "");