|  |  | @ -10,6 +10,7 @@ import ClipboardJS from 'clipboard' | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import './video.css'; |  |  |  | import './video.css'; | 
			
		
	
		
		
			
				
					
					|  |  |  | import '../../user/usersInfo/video/InfosVideo.css' |  |  |  | import '../../user/usersInfo/video/InfosVideo.css' | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import axios from 'axios'; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
 |  |  |  | const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
 | 
			
		
	
		
		
			
				
					
					|  |  |  | const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
 |  |  |  | const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -17,7 +18,6 @@ const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400 | 
			
		
	
		
		
			
				
					
					|  |  |  | const videoEl = null; |  |  |  | const videoEl = null; | 
			
		
	
		
		
			
				
					
					|  |  |  | let _clipboard = null; |  |  |  | let _clipboard = null; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  | class Video extends Component{ |  |  |  | class Video extends Component{ | 
			
		
	
		
		
			
				
					
					|  |  |  |   constructor(props){ |  |  |  |   constructor(props){ | 
			
		
	
		
		
			
				
					
					|  |  |  |     super(props); |  |  |  |     super(props); | 
			
		
	
	
		
		
			
				
					|  |  | @ -69,9 +69,8 @@ class Video extends Component{ | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   // 编辑成功后回调的方法
 |  |  |  |   // 编辑成功后回调的方法
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   editSuccess=()=>{ |  |  |  |   editSuccess=()=>{ | 
			
		
	
		
		
			
				
					
					|  |  |  |     const { page } = this.state; |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |     this.props.showNotification("视频名称修改成功!"); |  |  |  |     this.props.showNotification("视频名称修改成功!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     const { listFunc } = this.props; |  |  |  |     const { listFunc , page } = this.props; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     listFunc && listFunc(page); |  |  |  |     listFunc && listFunc(page); | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -132,13 +131,42 @@ class Video extends Component{ | 
			
		
	
		
		
			
				
					
					|  |  |  |     return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>` |  |  |  |     return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>` | 
			
		
	
		
		
			
				
					
					|  |  |  |   } |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   // 删除事件
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   deleteVideo=(item)=>{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     this.props.confirm({ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       content: '该视频将被删除,不可恢复', | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       subContent:'是否确认删除?', | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       onOk: () => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         const CourseId=this.props.match.params.coursesId; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         const url = `/courses/${CourseId}/delete_course_video.json`; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         axios.delete(url,{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           params:{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             video_id:item.id | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }).then(result=>{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           if(result){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             this.props.showNotification(`删除成功!`); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             const { listFunc , page } = this.props; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             listFunc && listFunc(page); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }).catch(error=>{ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           console.log(error); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       onCancel() { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         console.log('Cancel'); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     }); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |   } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |   render(){ |  |  |  |   render(){ | 
			
		
	
		
		
			
				
					
					|  |  |  |     const { visible , videoVisible , videoId } = this.state; |  |  |  |     const { visible , videoVisible , videoId } = this.state; | 
			
		
	
		
		
			
				
					
					|  |  |  |     const CourseId=this.props.match.params.coursesId; |  |  |  |     const CourseId=this.props.match.params.coursesId; | 
			
		
	
		
		
			
				
					
					|  |  |  |     const login=this.props.user&&this.props.user.login; |  |  |  |     const login=this.props.user&&this.props.user.login; | 
			
		
	
		
		
			
				
					
					|  |  |  |     const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url); |  |  |  |     const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url); | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     const { admin , is_teacher ,business} = this.props.user; |  |  |  |     const { admin , is_teacher ,business , user_id} = this.props.user; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     const { videos , upload , uploadVideo , videoData , changePage ,pageSize ,page } = this.props; |  |  |  |     const { videos , upload , uploadVideo , videoData , changePage ,pageSize ,page } = this.props; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -195,6 +223,7 @@ class Video extends Component{ | 
			
		
	
		
		
			
				
					
					|  |  |  |                           onMaskClick={this.onMaskClick} |  |  |  |                           onMaskClick={this.onMaskClick} | 
			
		
	
		
		
			
				
					
					|  |  |  |                           getCopyText={this.getCopyText} |  |  |  |                           getCopyText={this.getCopyText} | 
			
		
	
		
		
			
				
					
					|  |  |  |                           operation={operation} |  |  |  |                           operation={operation} | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                           deleteVideo={(admin || item.user_id === user_id) ? this.deleteVideo : undefined} | 
			
		
	
		
		
			
				
					
					|  |  |  |                       > |  |  |  |                       > | 
			
		
	
		
		
			
				
					
					|  |  |  |                       </VideoInReviewItem> |  |  |  |                       </VideoInReviewItem> | 
			
		
	
		
		
			
				
					
					|  |  |  |                       ) |  |  |  |                       ) | 
			
		
	
	
		
		
			
				
					|  |  | 
 |