mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 13:34:33 +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:
@@ -371,6 +371,8 @@ describe('TeamService', () => {
|
||||
videoStrategy: 'best_match',
|
||||
hardwareAcceleration: 'off',
|
||||
threads: 0,
|
||||
hlsEnabled: false,
|
||||
hlsResolutions: ['480p', '720p', '1080p'],
|
||||
},
|
||||
appearance: { hideAgent: false },
|
||||
})
|
||||
@@ -385,6 +387,8 @@ describe('TeamService', () => {
|
||||
videoStrategy: 'best_match',
|
||||
hardwareAcceleration: 'off',
|
||||
threads: 0,
|
||||
hlsEnabled: false,
|
||||
hlsResolutions: ['480p', '720p', '1080p'],
|
||||
},
|
||||
appearance: { hideAgent: false },
|
||||
})
|
||||
@@ -392,6 +396,12 @@ describe('TeamService', () => {
|
||||
await teamService.updateSettings(team.id, 'transcode.videoStrategy', 'all')
|
||||
await teamService.updateSettings(team.id, 'transcode.hardwareAcceleration', 'auto')
|
||||
await teamService.updateSettings(team.id, 'transcode.threads', 4)
|
||||
await teamService.updateSettings(team.id, 'transcode.hlsEnabled', true)
|
||||
await teamService.updateSettings(team.id, 'transcode.hlsResolutions', [
|
||||
'720p',
|
||||
'1080p',
|
||||
'2160p',
|
||||
])
|
||||
await teamService.updateSettings(team.id, 'appearance.hideAgent', true)
|
||||
|
||||
const finalSettings = await teamService.getSettings(team.id)
|
||||
@@ -401,6 +411,8 @@ describe('TeamService', () => {
|
||||
videoStrategy: 'all',
|
||||
hardwareAcceleration: 'auto',
|
||||
threads: 4,
|
||||
hlsEnabled: true,
|
||||
hlsResolutions: ['720p', '1080p', '2160p'],
|
||||
},
|
||||
appearance: { hideAgent: true },
|
||||
semanticSearchEnabled: false,
|
||||
|
||||
@@ -314,6 +314,15 @@ export class TeamService {
|
||||
videoStrategy: 'best_match',
|
||||
hardwareAcceleration: 'off',
|
||||
threads: 0,
|
||||
hlsEnabled: false,
|
||||
hlsResolutions: ['480p', '720p', '1080p'],
|
||||
}
|
||||
} else {
|
||||
if (settings.transcode.hlsEnabled === undefined) {
|
||||
settings.transcode.hlsEnabled = false
|
||||
}
|
||||
if (!settings.transcode.hlsResolutions) {
|
||||
settings.transcode.hlsResolutions = ['480p', '720p', '1080p']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,6 +363,20 @@ export class TeamService {
|
||||
}
|
||||
settings.transcode.threads = Number(value)
|
||||
delete settings['transcode.threads']
|
||||
} else if (key === 'transcode.hlsEnabled') {
|
||||
if (!settings.transcode) {
|
||||
settings.transcode = {}
|
||||
}
|
||||
settings.transcode.hlsEnabled = Boolean(value)
|
||||
delete settings['transcode.hlsEnabled']
|
||||
} else if (key === 'transcode.hlsResolutions') {
|
||||
if (!settings.transcode) {
|
||||
settings.transcode = {}
|
||||
}
|
||||
settings.transcode.hlsResolutions = value as NonNullable<
|
||||
TeamSettingsResponse['transcode']
|
||||
>['hlsResolutions']
|
||||
delete settings['transcode.hlsResolutions']
|
||||
} else if (key === 'appearance.hideAgent') {
|
||||
if (!settings.appearance) {
|
||||
settings.appearance = {}
|
||||
|
||||
Reference in New Issue
Block a user