Add support for webm video from SaveWEBM node (#3132)

This commit is contained in:
Chenlei Hu
2025-03-18 17:46:18 -04:00
committed by GitHub
parent ef74d7cb01
commit 91a8591249
3 changed files with 67 additions and 11 deletions

View File

@@ -89,23 +89,23 @@ export class ResultItemImpl {
}
get htmlVideoType(): string | undefined {
const defaultType = undefined
if (!this.isVhsFormat) {
return defaultType
}
if (this.format?.endsWith('webm')) {
if (this.isWebm) {
return 'video/webm'
}
if (this.format?.endsWith('mp4')) {
return 'video/mp4'
if (this.isVhsFormat) {
if (this.format?.endsWith('webm')) {
return 'video/webm'
}
if (this.format?.endsWith('mp4')) {
return 'video/mp4'
}
}
return defaultType
return
}
get isVideo(): boolean {
return !this.isImage && !!this.format?.startsWith('video/')
return this.mediaType === 'video' || !!this.format?.startsWith('video/')
}
get isGif(): boolean {
@@ -116,6 +116,10 @@ export class ResultItemImpl {
return this.filename.endsWith('.webp')
}
get isWebm(): boolean {
return this.filename.endsWith('.webm')
}
get isImage(): boolean {
return this.mediaType === 'images' || this.isGif || this.isWebp
}