diff --git a/admin/src/pages/course/option/index.tsx b/admin/src/pages/course/option/index.tsx index e591844..af0137b 100644 --- a/admin/src/pages/course/option/index.tsx +++ b/admin/src/pages/course/option/index.tsx @@ -496,7 +496,7 @@ const CourseList: React.FC = () => { sources: [ { src: '/dsideal_yy/html/' + currentRow?.attachment_json?.url, // 测试地址后续请删除 - type: 'application/x-mpegURL' + //type: 'application/x-mpegURL' } ], poster: currentRow?.attachment_json?.img || '', // 你的封面地址 diff --git a/admin/src/pages/demo/index.tsx b/admin/src/pages/demo/index.tsx index 02b6048..dfb51bb 100644 --- a/admin/src/pages/demo/index.tsx +++ b/admin/src/pages/demo/index.tsx @@ -12,327 +12,35 @@ // import { TableListItem } from '../ListTableList2'; // import { v4 as uuidv4 } from 'uuid'; // import { queryCourseList } from '../course/option/service'; -// import { useRequest } from 'umi'; - -// const { Step } = Steps; - -// // 秒数转化为时分秒 -// const formatSeconds= (value)=>{ -// // 秒 -// let second = parseInt(value) -// // 分 -// let minute = 0 -// // 小时 -// let hour = 0 -// // 天 -// // let day = 0 -// // 如果秒数大于60,将秒数转换成整数 -// if (second > 60) { -// // 获取分钟,除以60取整数,得到整数分钟 -// minute = parseInt(second / 60) -// // 获取秒数,秒数取佘,得到整数秒数 -// second = parseInt(second % 60) -// // 如果分钟大于60,将分钟转换成小时 -// if (minute > 60) { -// // 获取小时,获取分钟除以60,得到整数小时 -// hour = parseInt(minute / 60) -// // 获取小时后取佘的分,获取分钟除以60取佘的分 -// minute = parseInt(minute % 60) -// // 如果小时大于24,将小时转换成天 -// // if (hour > 23) { -// // // 获取天数,获取小时除以24,得到整天数 -// // day = parseInt(hour / 24) -// // // 获取天数后取余的小时,获取小时除以24取余的小时 -// // hour = parseInt(hour % 24) -// // } -// } -// } - -// let result = '' + parseInt(second) + ' 秒 ' -// if (minute > 0) { -// result = '' + parseInt(minute) + ' 分 ' + result -// } -// if (hour > 0) { -// result = '' + parseInt(hour) + ' 小时 ' + result -// } -// // if (day > 0) { -// // result = '' + parseInt(day) + '天' + result -// // } -// //console.log('result:', result) -// return result -// } -// export default () => { -// const uuid = uuidv4() -// //console.log('uuid', uuidv4()); -// const data = [ -// { -// year: "1991", -// value: 3, -// count: 10 -// }, -// { -// year: "1992", -// value: 4, -// count: 4 -// }, -// { -// year: "1993", -// value: 3.5, -// count: 5 -// }, -// { -// year: "1994", -// value: 5, -// count: 5 -// }, -// { -// year: "1995", -// value: 4.9, -// count: 4.9 -// }, -// { -// year: "1996", -// value: 6, -// count: 35 -// }, -// { -// year: "1997", -// value: 7, -// count: 7 -// }, -// { -// year: "1998", -// value: 9, -// count: 1 -// }, -// { -// year: "1999", -// value: 13, -// count: 20 -// } -// ]; -// const data2 = [ -// { -// year: "1991", -// value: 30, -// count: 100 -// }, -// { -// year: "1992", -// value: 40, -// count: 40 -// }, -// { -// year: "1993", -// value: 3.5, -// count: 50 -// }, -// { -// year: "1994", -// value: 5, -// count: 50 -// }, -// { -// year: "1995", -// value: 40.9, -// count: 24.9 -// }, -// { -// year: "1996", -// value: 6, -// count: 395 -// }, -// { -// year: "1997", -// value: 7, -// count: 79 -// }, -// { -// year: "1998", -// value: 99, -// count: 1 -// }, -// { -// year: "1999", -// value: 193, -// count: 20 -// } -// ]; - - -// const [modalVisible, handleModalVisible] = useState(false); -// const saveInputRef = useRef(); -// const radioRef = useRef(); - -// //const currentRow = {course_name:'课程0001'}; -// const currentRow = {course_name1:'课程0001'}; -// const columns = [ -// {title: "序号", key: "index", valueType: "indexBorder", width: 48}, -// //{title: "课程名称", dataIndex: "course_name", valueType: "text", hideInTable: false, hideInDescriptions: false}, -// {dataIndex: "course_name", hideInDescriptions: false, hideInForm: false,hideInSearch: true,hideInTable: false, title: "课程名称1", valueType: "text"}, -// {} -// ]; -// const [chartData, setChartData] = useState([data, data]); - -// const [selectedCourse, setSelectedCourse] = useState(0); -// const [menu, setMenu] = useState(); - -// const [timeData, setTimeData] = useState(0); - -// useEffect(() => { -// let secondValue = 3000; // 秒 截至时间 - 服务器当前时间 -// setTimeData(secondValue) -// const timer = setInterval(() => { // -// setTimeData((secondValue > 1) ? secondValue-- : 0); -// }, 1000); -// return ()=>{ -// clearInterval(timer) // 清理计算器 -// } -// },[]) - -// /** 获取课程数据 */ -// const { data: listData } = useRequest(() => { -// return queryCourseList(); -// }); -// useEffect(() => { -// //console.log('listData', listData) -// /* -// setInterval(() => { -// setChartData(Math.random() > 0.5 ? [data, data] : [data2, data2]); -// }, 1000);*/ +import { VideoJS } from "../course/option/components/VideoJS"; - -// /** 生成菜单 */ -// const menuItems = []; - -// if(listData?.length > 0){ -// //console.log('push'); -// listData.list.forEach((item: {code: number, name: string})=>{ -// menuItems.push({item?.course_name}) -// }) -// } -// setMenu( -// { -// console.log('menu11', value); -// console.log('menu11', value.key); -// //setMenu({ name: listData[Number(value?.key)]?.name, value: Number(value?.key)}); -// }} -// > -// {menuItems} -// -// ); -// }, [listData, selectedCourse]); - -// const config = { -// data: chartData, -// xField: "year", -// yField: ["value", "count"] -// }; - -// return( -// <> -// {menu} -// -// { -// saveInputRef.current.focus({}) -// //console.log('ref', saveInputRef.current) -// }}>焦点 -// {handleModalVisible(true)}}>课程 -//

uuid: {uuidv4()}

-// { -// // val === 转化出来的html -// }} -// /> -//

-//

hello'}} /> -//

-//

-// /dsideal_yy/html/down/Syzx/{uuid?.substr(0,2)}/{uuid}.jpg -// /dsideal_yy/html/down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A2.jpg -// 获取文件详情(下载url,播放url) /dsideal_yy/wkds/getwkdsInfo -//

-// { -// const {media: {track:[General, Video, Audio]}} = await getInfo(file) -// console.log('General:', General) -// console.log('Video:', Video) -// console.log('Video:', Video.format) // AVC -// console.log('Audio:', Audio.format) // AAC -// /* -// console.log('info:', media) -// console.log('track[0]:', media.track[0]) -// console.log('track[1]:', media.track[1]) -// console.log('track[2]:', media.track[2])*/ -// }} -// data={ -// { -// name: '4.jpg', -// chunk: 0, -// chunks: 1, -// key: 'down/Material/BC/BCFFEA09-9660-9D40-8D11-EF7D7110F7A2.jpg' -// } -// } -// > -//
-// -//
-//
- -// { -// // setCurrentRow(undefined); // 设置当前行 -// handleModalVisible(false); -// }} -// footer={null} -// centered -// > - -// -// column={2} -// /* title={currentRow?.name} */ -// dataSource={currentRow} -// /* -// request={async () => ({ -// data: currentRow || {}, -// })}*/ -// params={{ -// id: currentRow?.id, -// }} -// columns={ -// columns.slice(0, columns.length - 1) as ProDescriptionsItemProps[] -// } -// /> - -// -// -// Delete -// -// {/* -// -// */} -// { -// }}> -// A -// B -// C -// D -// -// {}}>rrrrr - - -//
{formatSeconds(timeData)}
-// -// ) -// }; +// import { useRequest } from 'umi'; +export default () => { +return<> + //down/Syzx/2c/2cff8e39-754d-4b85-90b0-74745f102f17.mp4 + //http://10.10.24.121:8000/dsideal_yy/html/down/Syzx/2c/2cff8e39-754d-4b85-90b0-74745f102f17.mp4 + {/**/} + 加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持) + language: 'zh-CN', + aspectRatio: '4:3', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3") + fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。 + sources: [ + { + src: '/dsideal_yy/html/down/Syzx/2c/2cff8e39-754d-4b85-90b0-74745f102f17.mp4', // 测试地址后续请删除 + //type: 'application/x-mpegURL' + } + ], + }} + /> + +};