mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 04:04:20 +00:00 
			
		
		
		
	Added YouTube posts
This commit is contained in:
		@@ -24,3 +24,8 @@
 | 
			
		||||
.post .post-pdf {
 | 
			
		||||
	text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.post .post-youtube {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
	height: 300px;
 | 
			
		||||
}
 | 
			
		||||
@@ -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
 | 
			
		||||
		else if(infos.kind == "pdf"){
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user