mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 23:24:21 +00:00
feat(transcode): add HLS live streaming support (#436)
* feat(transcode): add HLS live streaming support * fix(hls): resolve version stacks for public HLS and add workflow E2E test
This commit is contained in:
@@ -123,6 +123,25 @@ export const assetInfoSchema = z.object({
|
||||
.optional(),
|
||||
videoPreview: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
||||
pdfTranscode: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
||||
isHls: z.boolean().optional(),
|
||||
hls: z
|
||||
.object({
|
||||
key: z.string(),
|
||||
url: z.string().optional(),
|
||||
resolutions: z
|
||||
.array(
|
||||
z.object({
|
||||
width: z.number(),
|
||||
height: z.number(),
|
||||
resolution: z.string().optional(),
|
||||
hdr: z.boolean().optional(),
|
||||
key: z.string().optional(),
|
||||
url: z.string().optional(),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
})
|
||||
.optional(),
|
||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||
metadata: mediaMetadataSchema.optional(),
|
||||
})
|
||||
|
||||
@@ -80,6 +80,17 @@ export const HardwareAcceleration = {
|
||||
} as const
|
||||
export type HardwareAcceleration = (typeof HardwareAcceleration)[keyof typeof HardwareAcceleration]
|
||||
|
||||
export const HlsResolutionLadder = {
|
||||
r480p: '480p',
|
||||
r720p: '720p',
|
||||
r1080p: '1080p',
|
||||
r1440p: '1440p',
|
||||
r2160p: '2160p',
|
||||
} as const
|
||||
export type HlsResolutionLadder = (typeof HlsResolutionLadder)[keyof typeof HlsResolutionLadder]
|
||||
|
||||
export const DEFAULT_HLS_RESOLUTIONS: HlsResolutionLadder[] = ['480p', '720p', '1080p']
|
||||
|
||||
export const updateTeamSettingsRequestSchema = z.union([
|
||||
z.object({
|
||||
key: z.literal('transcode.videoStrategy'),
|
||||
@@ -93,6 +104,14 @@ export const updateTeamSettingsRequestSchema = z.union([
|
||||
key: z.literal('transcode.threads'),
|
||||
value: z.number().int().min(0).max(32),
|
||||
}),
|
||||
z.object({
|
||||
key: z.literal('transcode.hlsEnabled'),
|
||||
value: z.boolean(),
|
||||
}),
|
||||
z.object({
|
||||
key: z.literal('transcode.hlsResolutions'),
|
||||
value: z.array(z.nativeEnum(HlsResolutionLadder)),
|
||||
}),
|
||||
z.object({
|
||||
key: z.literal('appearance.hideAgent'),
|
||||
value: z.boolean(),
|
||||
@@ -109,6 +128,8 @@ export interface TeamSettingsResponse {
|
||||
videoStrategy?: VideoTranscodeStrategy
|
||||
hardwareAcceleration?: HardwareAcceleration
|
||||
threads?: number
|
||||
hlsEnabled?: boolean
|
||||
hlsResolutions?: HlsResolutionLadder[]
|
||||
}
|
||||
appearance?: TeamAppearanceSettings
|
||||
semanticSearchEnabled?: boolean
|
||||
|
||||
Reference in New Issue
Block a user