aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/+video-edit/shared/video-image.component.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/videos/+video-edit/shared/video-image.component.ts b/client/src/app/videos/+video-edit/shared/video-image.component.ts
index df6565857..25955baaa 100644
--- a/client/src/app/videos/+video-edit/shared/video-image.component.ts
+++ b/client/src/app/videos/+video-edit/shared/video-image.component.ts
@@ -2,6 +2,8 @@ import { Component, forwardRef, Input } from '@angular/core'
2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms' 2import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
3import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser' 3import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'
4import { ServerService } from '@app/core' 4import { ServerService } from '@app/core'
5import { NotificationsService } from 'angular2-notifications'
6import { I18n } from '@ngx-translate/i18n-polyfill'
5 7
6@Component({ 8@Component({
7 selector: 'my-video-image', 9 selector: 'my-video-image',
@@ -27,7 +29,9 @@ export class VideoImageComponent implements ControlValueAccessor {
27 29
28 constructor ( 30 constructor (
29 private sanitizer: DomSanitizer, 31 private sanitizer: DomSanitizer,
30 private serverService: ServerService 32 private serverService: ServerService,
33 private notificationsService: NotificationsService,
34 private i18n: I18n
31 ) {} 35 ) {}
32 36
33 get videoImageExtensions () { 37 get videoImageExtensions () {
@@ -42,6 +46,11 @@ export class VideoImageComponent implements ControlValueAccessor {
42 if (event.target.files && event.target.files.length) { 46 if (event.target.files && event.target.files.length) {
43 const [ file ] = event.target.files 47 const [ file ] = event.target.files
44 48
49 if (file.size > this.maxVideoImageSize) {
50 this.notificationsService.error(this.i18n('Error'), this.i18n('This image is too large.'))
51 return
52 }
53
45 this.file = file 54 this.file = file
46 this.propagateChange(this.file) 55 this.propagateChange(this.file)
47 this.updatePreview() 56 this.updatePreview()