-import { FfprobeFormat, FfprobeStream } from 'fluent-ffmpeg'
import { mapValues, pick } from 'lodash-es'
-import { BytesPipe } from 'ngx-pipes'
import { Component, ElementRef, ViewChild } from '@angular/core'
import { AuthService, Notifier } from '@app/core'
import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { VideoCaption, VideoFile, VideoPrivacy } from '@shared/models'
-import { NumberFormatterPipe, VideoDetails, VideoService } from '../shared-main'
+import { BytesPipe, NumberFormatterPipe, VideoDetails, VideoService } from '../shared-main'
type DownloadType = 'video' | 'subtitles'
type FileMetadata = { [key: string]: { label: string, value: string }}
this.type = type
}
- getMetadataFormat (format: FfprobeFormat) {
+ getMetadataFormat (format: any) {
const keyToTranslateFunction = {
'encoder': (value: string) => ({ label: this.i18n('Encoder'), value }),
'format_long_name': (value: string) => ({ label: this.i18n('Format name'), value }),
)
}
- getMetadataStream (streams: FfprobeStream[], type: 'video' | 'audio') {
+ getMetadataStream (streams: any[], type: 'video' | 'audio') {
const stream = streams.find(s => s.codec_type === type)
if (!stream) return undefined
private hydrateMetadataFromMetadataUrl (file: VideoFile) {
const observable = this.videoService.getVideoFileMetadata(file.metadataUrl)
observable.subscribe(res => file.metadata = res)
+
return observable.toPromise()
}
}