|
|
@@ -331,6 +331,7 @@ import { |
|
|
|
videoUpload, |
|
|
|
saveImgApi, |
|
|
|
uploadProgressApi, |
|
|
|
saveAudioApi, |
|
|
|
voiceTotalApi, |
|
|
|
chooseTypeApi, |
|
|
|
} from "@/apis/createVideo"; |
|
|
@@ -356,6 +357,7 @@ function getAiFaceList(pageNum, pageSize, sendType) { |
|
|
|
// 选择显示的face列表 |
|
|
|
const showFace = ref("0"); |
|
|
|
function ChangeShowFaceList(index) { |
|
|
|
AiFaceList.value = null; |
|
|
|
if (index == 0) { |
|
|
|
getAiFaceList(1, 100, 1); |
|
|
|
} |
|
|
@@ -488,6 +490,7 @@ const recorder = new Recorder(parameter); |
|
|
|
const isRecording = ref(true); |
|
|
|
const audioUrl = ref(null); |
|
|
|
const audioData = ref(""); |
|
|
|
const videoId = ref(null); //上传mp3的videoId,创建视频会用到 |
|
|
|
|
|
|
|
const startRecording = async () => { |
|
|
|
try { |
|
|
@@ -516,12 +519,14 @@ const playRecording = () => { |
|
|
|
audio.play(); |
|
|
|
} |
|
|
|
}; |
|
|
|
// 上传音频 |
|
|
|
async function uploadAudio(params) { |
|
|
|
let formData = new FormData(); |
|
|
|
const timestamp = Date.now(); |
|
|
|
formData.append("file", audioData.value, timestamp + ".mp3"); |
|
|
|
try { |
|
|
|
const res = await videoUpload(formData); |
|
|
|
videoId.value = res.data.videoId; |
|
|
|
ElMessage.success("上传成功!"); |
|
|
|
} catch (error) { |
|
|
|
ElMessage.error(error); |
|
|
@@ -566,11 +571,17 @@ async function uploadProgress(videoId) { |
|
|
|
const res = await uploadProgressApi(videoId); |
|
|
|
if (res.data == "complete") { |
|
|
|
clearInterval(intervalId); |
|
|
|
const res2 = await saveAudioApi(videoId); |
|
|
|
} |
|
|
|
} |
|
|
|
//#endregion -------------------------------------- |
|
|
|
|
|
|
|
//#region 获取语言列表 |
|
|
|
//#region 生成视频 |
|
|
|
// 上传音频后,得到videoId |
|
|
|
|
|
|
|
//#endregion ---------------------------- |
|
|
|
|
|
|
|
//#region |
|
|
|
|
|
|
|
//#endregion ---------------------------- |
|
|
|
|
|
|
@@ -769,7 +780,7 @@ onMounted(() => { |
|
|
|
text-align: center; |
|
|
|
border-radius: 50%; |
|
|
|
background-color: #fbf8f8; |
|
|
|
border: 2px solid #fff; |
|
|
|
// border: 2px solid #fff; |
|
|
|
box-shadow: rgba(0, 0, 0, 0.3) 0px 0px 5px 5px; |
|
|
|
// overflow: hidden; |
|
|
|
.imgBox { |
|
|
@@ -786,6 +797,10 @@ onMounted(() => { |
|
|
|
background-color: #fbf8f8; |
|
|
|
overflow: hidden; |
|
|
|
img { |
|
|
|
position: absolute; |
|
|
|
top: 50%; |
|
|
|
left: 50%; |
|
|
|
transform: translate(-50%, -50%); |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
@@ -802,10 +817,14 @@ onMounted(() => { |
|
|
|
&::before { |
|
|
|
content: ""; |
|
|
|
position: absolute; |
|
|
|
// top: -3px; |
|
|
|
// right: -7px; |
|
|
|
// left: -3px; |
|
|
|
// bottom: -7px; |
|
|
|
top: -3px; |
|
|
|
right: -7px; |
|
|
|
right: -3px; |
|
|
|
left: -3px; |
|
|
|
bottom: -7px; |
|
|
|
bottom: -3px; |
|
|
|
z-index: 2; |
|
|
|
border-radius: 50%; |
|
|
|
background: linear-gradient( |
|
|
|