Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Add limit to video sizes

Chocobozzz81c263c86fe2
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index e81243d3e7..324f26983c 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -133,9 +133,15 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
}
uploadFirstStep () {
- const videofile = this.videofileInput.nativeElement.files[0]
+ const videofile = this.videofileInput.nativeElement.files[0] as File
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
if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) {
const bytePipes = new BytesPipe()