release: 1.3.0

This commit is contained in:
acgnhik
2022-01-21 17:47:49 +08:00
parent e8d655ef2b
commit e36dedce74
57 changed files with 17428 additions and 9287 deletions

3
webapp/.gitignore vendored
View File

@@ -43,3 +43,6 @@ testem.log
# System Files
.DS_Store
Thumbs.db
# angular
.angular/

21355
webapp/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,33 +10,33 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.0",
"@angular/cdk": "~12.2.0",
"@angular/common": "~12.2.0",
"@angular/compiler": "^12.2.0",
"@angular/core": "^12.2.0",
"@angular/forms": "~12.2.0",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "^12.2.0",
"@angular/router": "^12.2.0",
"@angular/service-worker": "~12.2.0",
"@angular/animations": "^13.1.3",
"@angular/cdk": "~13.1.3",
"@angular/common": "~13.1.3",
"@angular/compiler": "^13.1.3",
"@angular/core": "^13.1.3",
"@angular/forms": "~13.1.3",
"@angular/platform-browser": "~13.1.3",
"@angular/platform-browser-dynamic": "^13.1.3",
"@angular/router": "^13.1.3",
"@angular/service-worker": "~13.1.3",
"filesize": "^6.4.0",
"lodash-es": "^4.17.21",
"ng-zorro-antd": "^12.0.1",
"ng-zorro-antd": "^13.0.1",
"ngx-logger": "^4.2.2",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^12.2.0",
"@angular-eslint/builder": "12.0.0",
"@angular-eslint/eslint-plugin": "12.0.0",
"@angular-eslint/eslint-plugin-template": "12.0.0",
"@angular-eslint/schematics": "12.0.0",
"@angular-eslint/template-parser": "12.0.0",
"@angular/cli": "^12.2.0",
"@angular/compiler-cli": "^12.2.0",
"@angular-devkit/build-angular": "^13.1.4",
"@angular-eslint/builder": "13.0.1",
"@angular-eslint/eslint-plugin": "13.0.1",
"@angular-eslint/eslint-plugin-template": "13.0.1",
"@angular-eslint/schematics": "13.0.1",
"@angular-eslint/template-parser": "13.0.1",
"@angular/cli": "^13.1.4",
"@angular/compiler-cli": "^13.1.3",
"@types/jasmine": "~3.6.0",
"@types/lodash-es": "^4.17.4",
"@types/node": "^12.20.19",
@@ -50,6 +50,6 @@
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.7.0",
"source-map-explorer": "^2.5.2",
"typescript": "~4.2.3"
"typescript": "~4.5.4"
}
}
}

View File

@@ -1,10 +1,30 @@
<form nz-form [formGroup]="settingsForm">
<nz-form-item class="setting-item" appSwitchActionable>
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="添加关键帧等元数据使定位播放和拖进度条不会卡顿"
>flv 添加元数据</nz-form-label
>
<nz-form-control
class="setting-control switch"
[nzWarningTip]="syncFailedWarningTip"
[nzValidateStatus]="
syncStatus.injectExtraMetadata ? injectExtraMetadataControl : 'warning'
"
>
<nz-switch
formControlName="injectExtraMetadata"
[nzDisabled]="remuxToMp4Control.value"
></nz-switch>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item" appSwitchActionable>
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="调用 ffmpeg 进行转换,需要安装 ffmpeg 。"
>FLV 转 MP4</nz-form-label
>flv 转封装为 mp4</nz-form-label
>
<nz-form-control
class="setting-control switch"

View File

@@ -39,11 +39,16 @@ export class PostProcessingSettingsComponent implements OnInit, OnChanges {
private settingsSyncService: SettingsSyncService
) {
this.settingsForm = formBuilder.group({
injectExtraMetadata: [''],
remuxToMp4: [''],
deleteSource: [''],
});
}
get injectExtraMetadataControl() {
return this.settingsForm.get('injectExtraMetadata') as FormControl;
}
get remuxToMp4Control() {
return this.settingsForm.get('remuxToMp4') as FormControl;
}

View File

@@ -17,6 +17,21 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item" appSwitchActionable>
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="录播文件完成时保存当前直播间的封面"
>保存封面</nz-form-label
>
<nz-form-control
class="setting-control switch"
[nzWarningTip]="syncFailedWarningTip"
[nzValidateStatus]="syncStatus.saveCover ? saveCoverControl : 'warning'"
>
<nz-switch formControlName="saveCover"></nz-switch>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
@@ -39,6 +54,29 @@
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="断网超过等待时间就结束录制,如果网络恢复后仍未下播会自动重新开始录制。"
>断网等待时间</nz-form-label
>
<nz-form-control
class="setting-control select"
[nzWarningTip]="syncFailedWarningTip"
[nzValidateStatus]="
syncStatus.disconnectionTimeout
? disconnectionTimeoutControl
: 'warning'
"
>
<nz-select
formControlName="disconnectionTimeout"
[nzOptions]="disconnectionTimeoutOptions"
>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"

View File

@@ -16,8 +16,9 @@ import type { Mutable } from '../../shared/utility-types';
import {
BUFFER_OPTIONS,
QUALITY_OPTIONS,
SYNC_FAILED_WARNING_TIP,
TIMEOUT_OPTIONS,
DISCONNECTION_TIMEOUT_OPTIONS,
SYNC_FAILED_WARNING_TIP,
} from '../shared/constants/form';
import { RecorderSettings } from '../shared/setting.model';
import {
@@ -44,6 +45,9 @@ export class RecorderSettingsComponent implements OnInit, OnChanges {
readonly timeoutOptions = cloneDeep(TIMEOUT_OPTIONS) as Mutable<
typeof TIMEOUT_OPTIONS
>;
readonly disconnectionTimeoutOptions = cloneDeep(
DISCONNECTION_TIMEOUT_OPTIONS
) as Mutable<typeof DISCONNECTION_TIMEOUT_OPTIONS>;
readonly bufferOptions = cloneDeep(BUFFER_OPTIONS) as Mutable<
typeof BUFFER_OPTIONS
>;
@@ -56,7 +60,9 @@ export class RecorderSettingsComponent implements OnInit, OnChanges {
this.settingsForm = formBuilder.group({
qualityNumber: [''],
readTimeout: [''],
disconnectionTimeout: [''],
bufferSize: [''],
saveCover: [''],
});
}
@@ -68,10 +74,18 @@ export class RecorderSettingsComponent implements OnInit, OnChanges {
return this.settingsForm.get('readTimeout') as FormControl;
}
get disconnectionTimeoutControl() {
return this.settingsForm.get('disconnectionTimeout') as FormControl;
}
get bufferSizeControl() {
return this.settingsForm.get('bufferSize') as FormControl;
}
get saveCoverControl() {
return this.settingsForm.get('saveCover') as FormControl;
}
ngOnChanges(): void {
this.syncStatus = mapValues(this.settings, () => true);
this.settingsForm.setValue(this.settings);

View File

@@ -72,6 +72,15 @@ export const TIMEOUT_OPTIONS = [
{ label: '10 分钟', value: 600 },
] as const;
export const DISCONNECTION_TIMEOUT_OPTIONS = [
{ label: '3 分钟', value: 3 * 60 },
{ label: '5 分钟', value: 5 * 60 },
{ label: '10 分钟', value: 10 * 60 },
{ label: '15 分钟', value: 15 * 60 },
{ label: '20 分钟', value: 20 * 60 },
{ label: '30 分钟', value: 30 * 60 },
] as const;
export const BUFFER_OPTIONS = [
{ label: '4 KB', value: 1024 * 4 },
{ label: '8 KB', value: 1024 * 8 },

View File

@@ -29,7 +29,9 @@ export type QualityNumber =
export interface RecorderSettings {
qualityNumber: QualityNumber;
readTimeout: number;
disconnectionTimeout: number;
bufferSize: number;
saveCover: boolean;
}
export type RecorderOptions = Nullable<RecorderSettings>;
@@ -40,6 +42,7 @@ export enum DeleteStrategy {
}
export interface PostprocessingSettings {
injectExtraMetadata: boolean;
remuxToMp4: boolean;
deleteSource: DeleteStrategy;
}

View File

@@ -56,7 +56,7 @@
<p
class="status-bar injecting"
nz-tooltip
nzTooltipTitle="正在更新 FLV 元数据:{{
nzTooltipTitle="正在添加元数据:{{
status.postprocessing_path ?? '' | filename
}}"
nzTooltipPlacement="top"
@@ -80,7 +80,7 @@
<p
class="status-bar remuxing"
nz-tooltip
nzTooltipTitle="正在转换 FLV 为 MP4{{
nzTooltipTitle="正在转封装{{
status.postprocessing_path ?? '' | filename
}}"
nzTooltipPlacement="top"

View File

@@ -137,6 +137,31 @@
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="录播文件完成时保存当前直播间的封面"
>保存封面</nz-form-label
>
<nz-form-control class="setting-control switch">
<nz-switch
name="saveCover"
[(ngModel)]="model.recorder.saveCover"
[disabled]="options.recorder.saveCover === null"
></nz-switch>
</nz-form-control>
<label
nz-checkbox
[nzChecked]="options.recorder.saveCover !== null"
(nzCheckedChange)="
options.recorder.saveCover = $event
? globalSettings.recorder.saveCover
: null
"
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
@@ -169,6 +194,34 @@
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="断网超过等待时间就结束录制,如果网络恢复后仍未下播会自动重新开始录制。"
>断网等待时间</nz-form-label
>
<nz-form-control class="setting-control select">
<nz-select
name="disconnectionTimeout"
[(ngModel)]="model.recorder.disconnectionTimeout"
[disabled]="options.recorder.disconnectionTimeout === null"
[nzOptions]="disconnectionTimeoutOptions"
[nzOptionOverflowSize]="6"
>
</nz-select>
</nz-form-control>
<label
nz-checkbox
[nzChecked]="options.recorder.bufferSize !== null"
(nzCheckedChange)="
options.recorder.bufferSize = $event
? globalSettings.recorder.bufferSize
: null
"
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
@@ -344,8 +397,36 @@
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="需要安装 FFmpeg"
>FLV 转 MP4</nz-form-label
nzTooltipTitle="添加关键帧等元数据使定位播放和拖进度条不会卡顿"
>flv 添加元数据</nz-form-label
>
<nz-form-control class="setting-control switch">
<nz-switch
name="injectExtraMetadata"
[(ngModel)]="model.postprocessing.injectExtraMetadata"
[disabled]="
options.postprocessing.injectExtraMetadata === null ||
!!options.postprocessing.remuxToMp4
"
></nz-switch>
</nz-form-control>
<label
nz-checkbox
[nzChecked]="options.postprocessing.injectExtraMetadata !== null"
(nzCheckedChange)="
options.postprocessing.injectExtraMetadata = $event
? globalSettings.postprocessing.injectExtraMetadata
: null
"
>覆盖全局设置</label
>
</nz-form-item>
<nz-form-item class="setting-item">
<nz-form-label
class="setting-label"
nzNoColon
nzTooltipTitle="调用 ffmpeg 进行转换,需要安装 ffmpeg 。"
>flv 转封装为 mp4</nz-form-label
>
<nz-form-control class="setting-control switch">
<nz-switch
@@ -382,7 +463,10 @@
<nz-select
name="deleteSource"
[(ngModel)]="model.postprocessing.deleteSource"
[disabled]="options.postprocessing.deleteSource === null"
[disabled]="
options.postprocessing.deleteSource === null ||
!options.postprocessing.remuxToMp4
"
[nzOptions]="deleteStrategies"
></nz-select>
</nz-form-control>

View File

@@ -25,6 +25,7 @@ import {
DURATION_LIMIT_OPTIONS,
QUALITY_OPTIONS,
TIMEOUT_OPTIONS,
DISCONNECTION_TIMEOUT_OPTIONS,
BUFFER_OPTIONS,
DELETE_STRATEGIES,
SPLIT_FILE_TIP,
@@ -68,6 +69,9 @@ export class TaskSettingsDialogComponent implements OnChanges {
readonly timeoutOptions = cloneDeep(TIMEOUT_OPTIONS) as Mutable<
typeof TIMEOUT_OPTIONS
>;
readonly disconnectionTimeoutOptions = cloneDeep(
DISCONNECTION_TIMEOUT_OPTIONS
) as Mutable<typeof DISCONNECTION_TIMEOUT_OPTIONS>;
readonly bufferOptions = cloneDeep(BUFFER_OPTIONS) as Mutable<
typeof BUFFER_OPTIONS
>;