|
|
|
@ -14,6 +14,8 @@ import type { TableListItem, TableListPagination } from './data';
|
|
|
|
|
import Tags from './components/Tags';
|
|
|
|
|
import type { DataItem } from '@antv/data-set/lib/transform/tag-cloud';
|
|
|
|
|
import { VideoJS } from './components/VideoJS';
|
|
|
|
|
import { getInfo } from 'react-mediainfo';
|
|
|
|
|
|
|
|
|
|
import { v4 as uuidv4 } from 'uuid';
|
|
|
|
|
|
|
|
|
|
const uuid = uuidv4();
|
|
|
|
@ -247,9 +249,16 @@ const CourseList: React.FC = () => {
|
|
|
|
|
hideInDescriptions: true,
|
|
|
|
|
renderFormItem: (item, { defaultRender, ...rest }, form) => (
|
|
|
|
|
<Upload
|
|
|
|
|
accept='.mp4'
|
|
|
|
|
action='/dsideal_yy/res/plupload/'
|
|
|
|
|
defaultFileList={item.initialValue ? [item.initialValue] : []}
|
|
|
|
|
beforeUpload={(file) => {
|
|
|
|
|
beforeUpload={async (file) => {
|
|
|
|
|
/** 获取视频文件信息 */
|
|
|
|
|
const {media: {track:[General, Video, Audio]}} = await getInfo(file)
|
|
|
|
|
if(Video.format !== 'AVC' || Audio.format !== 'AAC'){
|
|
|
|
|
message.error('视频编码格式不正确(视频采用AVC,音频采用AAC)')
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// console.log('file', file)
|
|
|
|
|
// 获取文件名
|
|
|
|
|
SetUploadFileName(file?.name);
|
|
|
|
|