1
0
Fork 0

Hide wait transcoding for lives

Replays are always transcoded
This commit is contained in:
Chocobozzz 2022-10-11 14:16:15 +02:00
parent e5fc6b5983
commit 080f14025e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
7 changed files with 13 additions and 21 deletions

View file

@ -141,7 +141,7 @@
</ng-template> </ng-template>
</my-peertube-checkbox> </my-peertube-checkbox>
<my-peertube-checkbox *ngIf="waitTranscodingEnabled" inputName="waitTranscoding" formControlName="waitTranscoding" helpPlacement="bottom-right"> <my-peertube-checkbox *ngIf="!hideWaitTranscoding" inputName="waitTranscoding" formControlName="waitTranscoding" helpPlacement="bottom-right">
<ng-template ptTemplate="label"> <ng-template ptTemplate="label">
<ng-container i18n>Publish after transcoding</ng-container> <ng-container i18n>Publish after transcoding</ng-container>
</ng-template> </ng-template>

View file

@ -22,6 +22,8 @@ import {
import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms' import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms'
import { InstanceService } from '@app/shared/shared-instance' import { InstanceService } from '@app/shared/shared-instance'
import { VideoCaptionEdit, VideoCaptionWithPathEdit, VideoEdit, VideoService } from '@app/shared/shared-main' import { VideoCaptionEdit, VideoCaptionWithPathEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { logger } from '@root-helpers/logger'
import { PluginInfo } from '@root-helpers/plugins-manager' import { PluginInfo } from '@root-helpers/plugins-manager'
import { import {
HTMLServerConfig, HTMLServerConfig,
@ -33,13 +35,11 @@ import {
VideoDetails, VideoDetails,
VideoPrivacy VideoPrivacy
} from '@shared/models' } from '@shared/models'
import { VideoSource } from '@shared/models/videos/video-source'
import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
import { VideoCaptionEditModalContentComponent } from './video-caption-edit-modal-content/video-caption-edit-modal-content.component' import { VideoCaptionEditModalContentComponent } from './video-caption-edit-modal-content/video-caption-edit-modal-content.component'
import { VideoEditType } from './video-edit.type' import { VideoEditType } from './video-edit.type'
import { VideoSource } from '@shared/models/videos/video-source'
import { logger } from '@root-helpers/logger'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
type VideoLanguages = VideoConstant<string> & { group?: string } type VideoLanguages = VideoConstant<string> & { group?: string }
type PluginField = { type PluginField = {
@ -66,7 +66,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
@Input() videoCaptions: VideoCaptionWithPathEdit[] = [] @Input() videoCaptions: VideoCaptionWithPathEdit[] = []
@Input() videoSource: VideoSource @Input() videoSource: VideoSource
@Input() waitTranscodingEnabled = true @Input() hideWaitTranscoding = false
@Input() type: VideoEditType @Input() type: VideoEditType
@Input() liveVideo: LiveVideo @Input() liveVideo: LiveVideo
@ -140,7 +141,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
nsfw: 'false', nsfw: 'false',
commentsEnabled: this.serverConfig.defaults.publish.commentsEnabled, commentsEnabled: this.serverConfig.defaults.publish.commentsEnabled,
downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled, downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
waitTranscoding: 'true', waitTranscoding: true,
licence: this.serverConfig.defaults.publish.licence, licence: this.serverConfig.defaults.publish.licence,
tags: [] tags: []
} }

View file

@ -53,7 +53,7 @@
<form [hidden]="!isInUpdateForm" novalidate [formGroup]="form"> <form [hidden]="!isInUpdateForm" novalidate [formGroup]="form">
<my-video-edit <my-video-edit
[form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
[forbidScheduledPublication]="true" [waitTranscodingEnabled]="isWaitTranscodingEnabled()" [forbidScheduledPublication]="true" [hideWaitTranscoding]="true"
[validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo" [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [liveVideo]="liveVideo"
type="go-live" type="go-live"
></my-video-edit> ></my-video-edit>

View file

@ -160,10 +160,6 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
return this.serverConfig.live.maxDuration / 1000 return this.serverConfig.live.maxDuration / 1000
} }
isWaitTranscodingEnabled () {
return this.form.value['saveReplay'] === true
}
getNormalLiveDescription () { getNormalLiveDescription () {
if (this.isReplayAllowed()) { if (this.isReplayAllowed()) {
return $localize`Stream only once, replay will replace your live` return $localize`Stream only once, replay will replace your live`

View file

@ -96,7 +96,7 @@
<my-video-edit <my-video-edit
[form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions" [form]="form" [formErrors]="formErrors" [videoCaptions]="videoCaptions"
[validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
[waitTranscodingEnabled]="true" [forbidScheduledPublication]="false" [forbidScheduledPublication]="false"
type="upload" type="upload"
></my-video-edit> ></my-video-edit>

View file

@ -9,7 +9,7 @@
<my-video-edit <my-video-edit
[form]="form" [formErrors]="formErrors" [forbidScheduledPublication]="forbidScheduledPublication" [form]="form" [formErrors]="formErrors" [forbidScheduledPublication]="forbidScheduledPublication"
[validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels" [validationMessages]="validationMessages" [userVideoChannels]="userVideoChannels"
[videoCaptions]="videoCaptions" [waitTranscodingEnabled]="isWaitTranscodingEnabled()" [videoCaptions]="videoCaptions" [hideWaitTranscoding]="isWaitTranscodingHidden()"
type="update" (pluginFieldsAdded)="hydratePluginFieldsFromVideo()" type="update" (pluginFieldsAdded)="hydratePluginFieldsFromVideo()"
[liveVideo]="liveVideo" [videoToUpdate]="videoDetails" [liveVideo]="liveVideo" [videoToUpdate]="videoDetails"
[videoSource]="videoSource" [videoSource]="videoSource"

View file

@ -28,7 +28,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
isUpdatingVideo = false isUpdatingVideo = false
forbidScheduledPublication = false forbidScheduledPublication = false
waitTranscodingEnabled = true
private updateDone = false private updateDone = false
@ -96,18 +95,14 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
return { canDeactivate: this.formChanged === false, text } return { canDeactivate: this.formChanged === false, text }
} }
isWaitTranscodingEnabled () { isWaitTranscodingHidden () {
if (this.videoDetails.getFiles().length > 1) { // Already transcoded if (this.videoDetails.getFiles().length > 1) { // Already transcoded
return false
}
if (this.liveVideo && this.form.value['saveReplay'] !== true) {
return false
}
return true return true
} }
return false
}
async update () { async update () {
await this.waitPendingCheck() await this.waitPendingCheck()
this.forceCheck() this.forceCheck()