Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
9164531a
Commit
9164531a
authored
Apr 08, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码优化 11018】 perf: 获取视频原信息 和 上传视频 并行操作一起等待
parent
ca4ffa88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
index.vue
src/components/common/UploadVideo/index.vue
+5
-6
No files found.
src/components/common/UploadVideo/index.vue
View file @
9164531a
...
@@ -157,18 +157,17 @@ const startUpload = async () => {
...
@@ -157,18 +157,17 @@ const startUpload = async () => {
uploadError
.
value
=
''
uploadError
.
value
=
''
uploadProgress
.
value
=
0
uploadProgress
.
value
=
0
// 调用你的上传方法
// 先提案获取视频的原信息 用本地blob
const
blob
=
URL
.
createObjectURL
(
currentFile
.
value
)
const
metadataPromise
=
getVideoMetadata
(
blob
)
const
{
promise
,
cancel
}
=
uploadFileApi
(
currentFile
.
value
,
{
const
{
promise
,
cancel
}
=
uploadFileApi
(
currentFile
.
value
,
{
onProgress
:
(
progress
)
=>
{
onProgress
:
(
progress
)
=>
{
uploadProgress
.
value
=
progress
uploadProgress
.
value
=
progress
},
},
})
})
cancelUploadController
=
cancel
cancelUploadController
=
cancel
const
data
=
await
promise
// 并行等待
const
[
data
,
metadata
]
=
await
Promise
.
all
([
promise
,
metadataPromise
])
// 获取视频元数据
const
metadata
=
await
getVideoMetadata
(
data
.
filePath
)
// 根据你的 API 返回结构调整
// 根据你的 API 返回结构调整
const
videoData
:
VideoInfo
=
{
const
videoData
:
VideoInfo
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment