Add limit to video sizes
This commit is contained in:
parent
a9ca764e7e
commit
81c263c86f
|
@ -133,9 +133,15 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadFirstStep () {
|
uploadFirstStep () {
|
||||||
const videofile = this.videofileInput.nativeElement.files[0]
|
const videofile = this.videofileInput.nativeElement.files[0] as File
|
||||||
if (!videofile) return
|
if (!videofile) return
|
||||||
|
|
||||||
|
// Cannot upload videos > 4GB for now
|
||||||
|
if (videofile.size > 4 * 1024 * 1024 * 1024) {
|
||||||
|
this.notificationsService.error('Error', 'We are sorry but PeerTube cannot handle videos > 4GB')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const videoQuota = this.authService.getUser().videoQuota
|
const videoQuota = this.authService.getUser().videoQuota
|
||||||
if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) {
|
if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) {
|
||||||
const bytePipes = new BytesPipe()
|
const bytePipes = new BytesPipe()
|
||||||
|
|
Loading…
Reference in New Issue