|
|
@@ -1,17 +1,43 @@
|
|
|
import {
|
|
|
PageContainer,
|
|
|
} from '@ant-design/pro-components';
|
|
|
-import React, { useState } from 'react';
|
|
|
+import React, { useEffect, useState } from 'react';
|
|
|
import './style/index.less';
|
|
|
import { Button, Card, Flex } from 'antd';
|
|
|
import { ArrowLeftOutlined } from '@ant-design/icons';
|
|
|
import dayjs from 'dayjs';
|
|
|
import './style/index.less'
|
|
|
import VideoPlayer from '@/pages/Play/components/Player';
|
|
|
-// import ReactPlayer from 'react-player'
|
|
|
+import { useLocation } from '@@/exports';
|
|
|
+import { getCourseVideos } from '@/services/play/PlayController';
|
|
|
|
|
|
const TableList: React.FC<unknown> = () => {
|
|
|
const [selected, setSelected] = useState<string>('sync');
|
|
|
+ const location = useLocation();
|
|
|
+ const [fullClassRoom, setFullClassRoom] = useState<string>('');
|
|
|
+ const [closeUpTeacher, setCloseUpTeacher] = useState<string>('');
|
|
|
+ const [blackWriting, setBlackWriting] = useState<string>('');
|
|
|
+ const [audioClass, setAudioClass] = useState<string>('');
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ if(location.search) {
|
|
|
+ const searchParams = new URLSearchParams(location.search);
|
|
|
+ const onData = async () => {
|
|
|
+ const data: API.PlayRes = await getCourseVideos({
|
|
|
+ isPreview: false,
|
|
|
+ teacherCourseId: searchParams.get('courseId') as string,
|
|
|
+ })
|
|
|
+ if (data.code === 200) {
|
|
|
+ setFullClassRoom(data.data.find(item => item.fileType === 1)?.fileUrl as string);
|
|
|
+ setCloseUpTeacher(data.data?.find(item => item.fileType === 2)?.fileUrl as string);
|
|
|
+ setBlackWriting(data.data.find(item => item.fileType === 3)?.fileUrl as string);
|
|
|
+ setAudioClass(data.data.find(item => item.fileType === 4)?.fileUrl as string);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ onData()
|
|
|
+ }
|
|
|
+ }, [location.search]);
|
|
|
+
|
|
|
return (
|
|
|
<PageContainer className="play-page-box">
|
|
|
<Card style={{ marginInline: 20, marginTop: 10 }}>
|
|
|
@@ -57,10 +83,10 @@ const TableList: React.FC<unknown> = () => {
|
|
|
<div style={{ flex: 1 }}>
|
|
|
<VideoPlayer
|
|
|
syncPlay={selected === 'sync'}
|
|
|
- topVideoSrc={'http://player.alicdn.com/video/aliyunmedia.mp4'}
|
|
|
- leftVideoSrc={'http://player.alicdn.com/video/aliyunmedia.mp4'}
|
|
|
- rightVideoSrc={'http://player.alicdn.com/video/aliyunmedia.mp4'}
|
|
|
- audioSrc={''}
|
|
|
+ topVideoSrc={fullClassRoom}
|
|
|
+ leftVideoSrc={closeUpTeacher}
|
|
|
+ rightVideoSrc={blackWriting}
|
|
|
+ audioSrc={audioClass}
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|