|
|
@ -1,5 +1,5 @@
|
|
|
|
import React, { useState, useEffect, useContext, memo } from 'react';
|
|
|
|
import React, { useState, useEffect, useContext, memo } from 'react';
|
|
|
|
import { Progress, Input, Tooltip } from 'antd'
|
|
|
|
import { Progress, Input, Tooltip , Spin } from 'antd'
|
|
|
|
import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder'
|
|
|
|
import { getUrl2, isDev, CBreadcrumb, ActionBtn, ThemeContext } from 'educoder'
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
|
import moment from 'moment'
|
|
|
|
import moment from 'moment'
|
|
|
@ -20,7 +20,7 @@ let _clipboard = null;
|
|
|
|
const clipboardMap = {}
|
|
|
|
const clipboardMap = {}
|
|
|
|
function VideoInReviewItem (props) {
|
|
|
|
function VideoInReviewItem (props) {
|
|
|
|
const theme = useContext(ThemeContext);
|
|
|
|
const theme = useContext(ThemeContext);
|
|
|
|
const { history, file_url, cover_url, title, created_at, published_at, isReview, id
|
|
|
|
const { history, file_url , play_url , cover_url , transcoded , title, created_at, published_at, isReview, id
|
|
|
|
, onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo , moveVideo ,link} = props;
|
|
|
|
, onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo , moveVideo ,link} = props;
|
|
|
|
useEffect(()=> {
|
|
|
|
useEffect(()=> {
|
|
|
|
if (!isReview) {
|
|
|
|
if (!isReview) {
|
|
|
@ -44,10 +44,11 @@ function VideoInReviewItem (props) {
|
|
|
|
function toUpload() {
|
|
|
|
function toUpload() {
|
|
|
|
history.push(`/users/${username}/videos/upload`)
|
|
|
|
history.push(`/users/${username}/videos/upload`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const imgUrl = (!transcoded && !link) ? defaultImg : (cover_url || defaultImg);
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={`${isReview ? 'videoInReviewItem' : 'nItem'} videoItem`}>
|
|
|
|
<div className={`${isReview ? 'videoInReviewItem' : 'nItem'} videoItem`}>
|
|
|
|
|
|
|
|
<Spin tip="正在转码,请稍等..." spinning={!transcoded && !link}>
|
|
|
|
<img className="cover" src={cover_url || defaultImg} alt=""></img>
|
|
|
|
<img className="cover" src={imgUrl} alt=""></img>
|
|
|
|
{ link ?
|
|
|
|
{ link ?
|
|
|
|
<a href={link} target='_blank' className="otherLinkPanel">
|
|
|
|
<a href={link} target='_blank' className="otherLinkPanel">
|
|
|
|
<span className="otherLink">外链</span>
|
|
|
|
<span className="otherLink">外链</span>
|
|
|
@ -56,12 +57,13 @@ function VideoInReviewItem (props) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{!isReview && <div className="mask" onClick={() => onMaskClick(props)}></div>}
|
|
|
|
{!isReview && <div className="mask" onClick={() => onMaskClick(props)}></div>}
|
|
|
|
{!isReview && !link &&
|
|
|
|
{!isReview && !link && transcoded &&
|
|
|
|
<div className="playWrap" onClick={() => onMaskClick(props)}>
|
|
|
|
<div className="playWrap" onClick={() => onMaskClick(props)}>
|
|
|
|
<img className="play mp23" src={playIcon}></img>
|
|
|
|
<img className="play mp23" src={playIcon}></img>
|
|
|
|
{play_duration===0?"":<div className={"play_duration"}>累计学习时长:{play_duration} h</div>}
|
|
|
|
{play_duration===0?"":<div className={"play_duration"}>累计学习时长:{play_duration} h</div>}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</Spin>
|
|
|
|
<div className="square-main">
|
|
|
|
<div className="square-main">
|
|
|
|
<div className="title overflowHidden1"
|
|
|
|
<div className="title overflowHidden1"
|
|
|
|
title={title && title.length > 20 ? title : ''}
|
|
|
|
title={title && title.length > 20 ? title : ''}
|
|
|
@ -106,7 +108,7 @@ function VideoInReviewItem (props) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!link ?
|
|
|
|
!link ?
|
|
|
|
<Tooltip title="复制视频地址" placement="bottom">
|
|
|
|
<Tooltip title="复制视频地址" placement="bottom">
|
|
|
|
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText(file_url, cover_url)}></i>
|
|
|
|
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i>
|
|
|
|
</Tooltip>:""
|
|
|
|
</Tooltip>:""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|