Skip to content

Commit

Permalink
🐛 #148
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZhang73 committed Mar 12, 2022
1 parent 322c037 commit 6be5e15
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/store/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,23 @@ export const useAnnotationStore = defineStore('annotation', () => {
/// video
if (!state.video.src && video.src.startsWith('blob')) {
throw 'The src of video is blob (local), please load video first!'
} else {
} else if (!state.video.src && !video.src.startsWith('blob')) {
state.video = video
mainStore.videoFormat = video.src.split('.').at(-1).toLowerCase()
} else {
if (state.video.duration && video.duration && state.video.duration !== video.duration) {
throw `The duration of annotation and the video does not match (duration ${state.video.duration} != ${video.duration}).`
}
if (state.video.width && video.width && state.video.width !== video.width) {
utils.notify(
`The width of annotation and the video does not match (width ${state.video.width} != ${video.width}).`,
'warning')
}
if (state.video.height && video.height && state.video.height !== video.height) {
utils.notify(
`The height of annotation and the video does not match (width ${state.video.height} != ${video.height}).`,
'warning')
}
}
/// keyframeList
state.keyframeList = keyframeList
Expand Down

0 comments on commit 6be5e15

Please sign in to comment.