Added YouTube posts

This commit is contained in:
Pierre 2018-01-03 11:11:24 +01:00
parent 2fc57b40ab
commit 0e18bdf154
2 changed files with 22 additions and 0 deletions

View File

@ -23,4 +23,9 @@
.post .post-pdf { .post .post-pdf {
text-align: center; text-align: center;
}
.post .post-youtube {
width: 100%;
height: 300px;
} }

View File

@ -124,6 +124,23 @@ ComunicWeb.components.posts.ui = {
} }
//In case of YouTube video
else if(infos.kind == "youtube"){
//Create iframe
var youtube_iframe = createElem2({
appendTo: postRoot,
type: "iframe",
class: "post-youtube",
src: "https://www.youtube-nocookie.com/embed/"+infos.file_path+"?rel=0"
});
youtube_iframe.setAttribute("frameborder", 0);
youtube_iframe.setAttribute("gesture", "media");
youtube_iframe.setAttribute("allow", "encrypted-media");
youtube_iframe.setAttribute("allowfullscreen", "");
}
//In case of PDF //In case of PDF
else if(infos.kind == "pdf"){ else if(infos.kind == "pdf"){