dev-v2
Joe 8 months ago
parent 25a02bae71
commit ff9f78feb4

@ -54,7 +54,6 @@
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@umijs/route-utils": "^2.2.2",
"aliyun-aliplayer": "^2.29.1",
"antd": "^5.2.2",
"antd-img-crop": "^4.23.0",
"braft-editor": "^2.3.9",

@ -1,7 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import { Button, Slider, Select, Space, Card } from 'antd';
import { PauseCircleOutlined, PlayCircleOutlined, ExpandOutlined } from '@ant-design/icons';
import 'aliyun-aliplayer/build/skins/default/aliplayer-min.css';
interface AliPlayerProps {
vid: string;
@ -25,8 +24,11 @@ const AliPlayer: React.FC<AliPlayerProps> = ({
// 初始化播放器
useEffect(() => {
const link = document.createElement('link');
const script = document.createElement('script');
script.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.25.1/aliplayer-min.js';
link.rel = "stylesheet"
link.href = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.29.1/skins/default/aliplayer-min.css'
script.src = 'https://g.alicdn.com/apsara-media-box/imp-web-player/2.29.1/aliplayer-min.js';
script.onload = () => {
if (containerRef.current) {
playerRef.current = new (window as any).Aliplayer({
@ -51,12 +53,14 @@ const AliPlayer: React.FC<AliPlayerProps> = ({
});
}
};
document.head.appendChild(link);
document.head.appendChild(script);
return () => {
if (playerRef.current) {
playerRef.current.dispose();
}
document.head.removeChild(link);
document.head.removeChild(script);
};
}, [vid, playAuth]);

@ -512,19 +512,23 @@ const Detail: React.FC<any> = () => {
onFinish={async (value: any) => {
if (params.id) {
let pbcVideoAddress = ""
let pbcVideoDuration = ""
if (value.pbcVideoAddress && value.pbcVideoAddress.length > 0) {
if (value.pbcVideoAddress[0].uid === '-1') {
pbcVideoAddress = value.pbcVideoAddress[0].url || '';
pbcVideoDuration = stepFormValues1.pbcVideoDuration || ''
}
if (
value.pbcVideoAddress[0].response &&
value.pbcVideoAddress[0].response.retcode
) {
pbcVideoAddress = fileType === '1' ? value.pbcVideoAddress[0].response.data.videoId : value.pbcVideoAddress[0].response.data;
pbcVideoDuration = fileType === '1' ? value.pbcVideoAddress[0].response.data.duration : '';
}
}
await addOrUpdateVideoUsingPost({
...stepFormValues1,
pbcVideoDuration,
pbcVideoName: value.pbcVideoName,
pbcFileType: value.pbcFileType,
pbcVideoAddress

Loading…
Cancel
Save