File size: 510 Bytes
8919651
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { defaultExportFormat, SupportedExportFormat } from "@aitube/client"

export function parseSupportedExportFormat(
    input?: any,
    defaultFormat: SupportedExportFormat = defaultExportFormat
  ): SupportedExportFormat {

  let format: SupportedExportFormat = defaultFormat
  try {
    format = decodeURIComponent(`${input || ""}` || defaultFormat).trim() as SupportedExportFormat
    if (format !== "mp4" && format !== "webm") {
      format = defaultFormat
    }
  } catch (err) {}
  return format
}