|
|
|
@ -13,6 +13,7 @@ import VideoPanel from './video-play'
|
|
|
|
|
import './video.css';
|
|
|
|
|
import '../../user/usersInfo/video/InfosVideo.css'
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import { logWatchHistory } from "../../../services/video-service";
|
|
|
|
|
|
|
|
|
|
const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
|
|
|
|
|
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
|
|
|
|
@ -31,8 +32,8 @@ class Video extends Component {
|
|
|
|
|
videoVisible: false,
|
|
|
|
|
visible: false,
|
|
|
|
|
|
|
|
|
|
moveVisible:false,
|
|
|
|
|
moveVideoId:undefined
|
|
|
|
|
moveVisible: false,
|
|
|
|
|
moveVideoId: undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -70,7 +71,6 @@ class Video extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑成功后回调的方法
|
|
|
|
|
editSuccess = () => {
|
|
|
|
|
this.props.showNotification("视频信息修改成功!");
|
|
|
|
@ -82,7 +82,7 @@ class Video extends Component {
|
|
|
|
|
let videoId = {
|
|
|
|
|
videoId: item.id,
|
|
|
|
|
title: item.title,
|
|
|
|
|
link:item.link
|
|
|
|
|
link: item.link
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
videoId,
|
|
|
|
@ -118,8 +118,6 @@ class Video extends Component {
|
|
|
|
|
_clipboard = null;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// videoEl.current && videoEl.current.play()
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
if (!_clipboard) {
|
|
|
|
|
_clipboard = new ClipboardJS('.copybtn');
|
|
|
|
@ -148,7 +146,7 @@ class Video extends Component {
|
|
|
|
|
axios.delete(url, {
|
|
|
|
|
params: {
|
|
|
|
|
video_id: item.id,
|
|
|
|
|
is_link:item.link ? true : undefined
|
|
|
|
|
is_link: item.link ? true : undefined
|
|
|
|
|
}
|
|
|
|
|
}).then(result => {
|
|
|
|
|
if (result) {
|
|
|
|
@ -168,30 +166,30 @@ class Video extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 移动到
|
|
|
|
|
moveVideo=(id,flag)=>{
|
|
|
|
|
if(!flag){
|
|
|
|
|
moveVideo = (id, flag) => {
|
|
|
|
|
if (!flag) {
|
|
|
|
|
this.setState({
|
|
|
|
|
moveVisible:true,
|
|
|
|
|
moveVideoId:id
|
|
|
|
|
moveVisible: true,
|
|
|
|
|
moveVideoId: id
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.props.define({
|
|
|
|
|
title:'提示',
|
|
|
|
|
content:"您不是课堂管理员或者视频发布者,暂不能移动视频。",
|
|
|
|
|
title: '提示',
|
|
|
|
|
content: "您不是课堂管理员或者视频发布者,暂不能移动视频。",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
setMoveVisible=(flag)=>{
|
|
|
|
|
setMoveVisible = (flag) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
moveVisible:flag,
|
|
|
|
|
moveVideoId:undefined
|
|
|
|
|
moveVisible: flag,
|
|
|
|
|
moveVideoId: undefined
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { visible, videoVisible, videoId , moveVisible , moveVideoId } = this.state;
|
|
|
|
|
const { visible, videoVisible, videoId, moveVisible, moveVideoId } = this.state;
|
|
|
|
|
const CourseId = this.props.match.params.coursesId;
|
|
|
|
|
const VID=this.props.match.params.videoId;
|
|
|
|
|
const VID = this.props.match.params.videoId;
|
|
|
|
|
|
|
|
|
|
const login = this.props.user && this.props.user.login;
|
|
|
|
|
const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url);
|
|
|
|
@ -201,7 +199,7 @@ class Video extends Component {
|
|
|
|
|
const { videos, upload, uploadVideo, videoData, changePage, pageSize, page } = this.props;
|
|
|
|
|
|
|
|
|
|
const operation = admin || business;
|
|
|
|
|
const {course_identity} = this.props.coursedata;
|
|
|
|
|
const { course_identity } = this.props.coursedata;
|
|
|
|
|
const flagMove = parseInt(course_identity) < 5;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
@ -214,8 +212,8 @@ class Video extends Component {
|
|
|
|
|
{...this.props}
|
|
|
|
|
visible={moveVisible}
|
|
|
|
|
mainId={videoData && videoData.course_module_id}
|
|
|
|
|
setMoveVisible={(flag)=>this.setMoveVisible(flag)}
|
|
|
|
|
successFunc={()=>uploadVideo()}
|
|
|
|
|
setMoveVisible={(flag) => this.setMoveVisible(flag)}
|
|
|
|
|
successFunc={() => uploadVideo()}
|
|
|
|
|
id={moveVideoId}
|
|
|
|
|
></MoveBox>
|
|
|
|
|
<HeadlessModal
|
|
|
|
@ -224,7 +222,7 @@ class Video extends Component {
|
|
|
|
|
className="showVideoModal"
|
|
|
|
|
width={800 - 1}
|
|
|
|
|
>
|
|
|
|
|
{videoId && <VideoPanel src={videoId.file_url} />}
|
|
|
|
|
{videoId && <VideoPanel src={videoId.file_url} videoId={videoId.videoId} courseId={CourseId} logWatchHistory={logWatchHistory} />}
|
|
|
|
|
|
|
|
|
|
<div className="df copyLine">
|
|
|
|
|
<Input value={_inputValue}
|
|
|
|
@ -242,7 +240,7 @@ class Video extends Component {
|
|
|
|
|
{
|
|
|
|
|
videos && videos.length > 0 ?
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p className="font-grey-9 mt20 mb20 pl5">共 <span className="color-orange">{videoData && videoData.count}</span> 个视频</p>
|
|
|
|
|
<div className="videoContent">
|
|
|
|
|
{
|
|
|
|
@ -259,7 +257,7 @@ class Video extends Component {
|
|
|
|
|
getCopyText={this.getCopyText}
|
|
|
|
|
operation={operation || item.user_id === user_id}
|
|
|
|
|
deleteVideo={(admin || item.user_id === user_id) ? this.deleteVideo : undefined}
|
|
|
|
|
moveVideo={videoData && videoData.has_category && flagMove ? ()=>this.moveVideo(item.id,(course_identity > 2 && item.user_id !== user_id)):undefined}
|
|
|
|
|
moveVideo={videoData && videoData.has_category && flagMove ? () => this.moveVideo(item.id, (course_identity > 2 && item.user_id !== user_id)) : undefined}
|
|
|
|
|
>
|
|
|
|
|
</VideoInReviewItem>
|
|
|
|
|
)
|
|
|
|
|