Don't select a frame from a live
This commit is contained in:
parent
b02f1aec30
commit
6425223b2a
|
@ -27,7 +27,7 @@
|
|||
[buttonTooltip]="getReactiveFileButtonTooltip()">
|
||||
</my-reactive-file>
|
||||
|
||||
@if (video) {
|
||||
@if (canSelectFromVideo()) {
|
||||
<button i18n type="button" class="peertube-button grey-button ms-2" (click)="selectFromVideo()">Select from video</button>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
import { ReactiveFileComponent } from '@app/shared/shared-forms/reactive-file.component'
|
||||
import { BytesPipe } from '@app/shared/shared-main/angular/bytes.pipe'
|
||||
import { EmbedComponent, EmbedVideoInput } from '@app/shared/shared-main/video/embed.component'
|
||||
import { HTMLServerConfig } from '@peertube/peertube-models'
|
||||
import { HTMLServerConfig, Video, VideoState } from '@peertube/peertube-models'
|
||||
import { imageToDataURL } from '@root-helpers/images'
|
||||
import { PeerTubePlayer } from '../../../../../standalone/embed-player-api/player'
|
||||
|
||||
|
@ -34,7 +34,7 @@ import { PeerTubePlayer } from '../../../../../standalone/embed-player-api/playe
|
|||
export class ThumbnailManagerComponent implements OnInit, ControlValueAccessor {
|
||||
@ViewChild('embed') embed: EmbedComponent
|
||||
|
||||
@Input() video: EmbedVideoInput
|
||||
@Input() video: EmbedVideoInput & Pick<Video, 'isLive' | 'state'>
|
||||
|
||||
imageSrc: string
|
||||
allowedExtensionsMessage = ''
|
||||
|
@ -71,6 +71,10 @@ export class ThumbnailManagerComponent implements OnInit, ControlValueAccessor {
|
|||
return this.bytesPipe.transform(this.maxVideoImageSize)
|
||||
}
|
||||
|
||||
canSelectFromVideo () {
|
||||
return this.video && !this.video.isLive && this.video.state.id === VideoState.PUBLISHED
|
||||
}
|
||||
|
||||
getReactiveFileButtonTooltip () {
|
||||
return $localize`(extensions: ${this.videoImageExtensions}, ${this.maxSizeText}\: ${this.maxVideoImageSizeInBytes})`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue