mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Integraged VideoJS
This commit is contained in:
		@@ -15,3 +15,8 @@
 | 
			
		||||
.post .post-image {
 | 
			
		||||
	width: 100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.post .post-video {
 | 
			
		||||
	max-width: 100%;
 | 
			
		||||
	height: 300px;
 | 
			
		||||
}
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user