X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fvideo-add-components%2Fvideo-upload.component.ts;h=effb37077465c3d7b9c3b913b3c034c7255e4e41;hb=d29ced1a8582d99b776f664475a157adcf555d98;hp=cafb030b9930074467a1fed1ee228b254dd59352;hpb=f2eb23cd87cf32b8fe545178143b5f49e06a58da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index cafb030b9..effb37077 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -1,15 +1,15 @@ import { Subscription } from 'rxjs' import { HttpErrorResponse, HttpEventType, HttpResponse } from '@angular/common/http' -import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' +import { AfterViewInit, Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' import { Router } from '@angular/router' -import { AuthService, CanComponentDeactivate, Notifier, ServerService, UserService } from '@app/core' +import { AuthService, CanComponentDeactivate, HooksService, Notifier, ServerService, UserService } from '@app/core' import { scrollToTop, uploadErrorHandler } from '@app/helpers' import { FormValidatorService } from '@app/shared/shared-forms' import { BytesPipe, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' +import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' import { VideoPrivacy } from '@shared/models' import { VideoSend } from './video-send' -import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' @Component({ selector: 'my-video-upload', @@ -20,7 +20,7 @@ import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' './video-send.scss' ] }) -export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate { +export class VideoUploadComponent extends VideoSend implements OnInit, AfterViewInit, OnDestroy, CanComponentDeactivate { @Output() firstStepDone = new EventEmitter() @Output() firstStepError = new EventEmitter() @ViewChild('videofileInput') videofileInput: ElementRef @@ -44,7 +44,6 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy } formData: FormData - waitTranscodingEnabled = true previewfileUpload: File error: string @@ -61,7 +60,8 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy protected videoService: VideoService, protected videoCaptionService: VideoCaptionService, private userService: UserService, - private router: Router + private router: Router, + private hooks: HooksService ) { super() } @@ -80,6 +80,10 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy }) } + ngAfterViewInit () { + this.hooks.runAction('action:video-upload.init', 'video-edit') + } + ngOnDestroy () { if (this.videoUploadObservable) this.videoUploadObservable.unsubscribe() } @@ -163,11 +167,6 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy if (nameWithoutExtension.length < 3) name = videofile.name else name = nameWithoutExtension - // Force user to wait transcoding for unsupported video types in web browsers - if (!videofile.name.endsWith('.mp4') && !videofile.name.endsWith('.webm') && !videofile.name.endsWith('.ogv')) { - this.waitTranscodingEnabled = false - } - const nsfw = this.serverConfig.instance.isNSFW const waitTranscoding = true const commentsEnabled = true