import { Component } from '@angular/core';
import { NgxDropzonePreviewComponent } from '../ngx-dropzone-preview.component';
import { DomSanitizer } from '@angular/platform-browser';
import * as i0 from "@angular/core";
import * as i1 from "@angular/platform-browser";
import * as i2 from "../ngx-dropzone-remove-badge/ngx-dropzone-remove-badge.component";
import * as i3 from "@angular/common";
export class NgxDropzoneVideoPreviewComponent extends NgxDropzonePreviewComponent {
constructor(sanitizer) {
super(sanitizer);
}
ngOnInit() {
if (!this.file) {
console.error('No file to read. Please provide a file using the [file] Input property.');
return;
}
/**
* We sanitize the URL here to enable the preview.
* Please note that this could cause security issues!
**/
this.videoSrc = URL.createObjectURL(this.file);
this.sanitizedVideoSrc = this.sanitizer.bypassSecurityTrustUrl(this.videoSrc);
}
ngOnDestroy() {
URL.revokeObjectURL(this.videoSrc);
}
}
NgxDropzoneVideoPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NgxDropzoneVideoPreviewComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
NgxDropzoneVideoPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: NgxDropzoneVideoPreviewComponent, selector: "ngx-dropzone-video-preview", providers: [
{
provide: NgxDropzonePreviewComponent,
useExisting: NgxDropzoneVideoPreviewComponent
}
], usesInheritance: true, ngImport: i0, template: `
`, isInline: true, styles: [":host{min-width:unset!important;max-width:unset!important;padding:0!important}:host:hover video,:host:focus video{opacity:.7}:host:hover ngx-dropzone-remove-badge,:host:focus ngx-dropzone-remove-badge{opacity:1}:host ngx-dropzone-remove-badge{opacity:0}:host video{max-height:100%;border-radius:5px}:host ::ng-deep ngx-dropzone-label{position:absolute;overflow-wrap:break-word}\n"], components: [{ type: i2.NgxDropzoneRemoveBadgeComponent, selector: "ngx-dropzone-remove-badge" }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: NgxDropzoneVideoPreviewComponent, decorators: [{
type: Component,
args: [{ selector: 'ngx-dropzone-video-preview', template: `
`, providers: [
{
provide: NgxDropzonePreviewComponent,
useExisting: NgxDropzoneVideoPreviewComponent
}
], styles: [":host{min-width:unset!important;max-width:unset!important;padding:0!important}:host:hover video,:host:focus video{opacity:.7}:host:hover ngx-dropzone-remove-badge,:host:focus ngx-dropzone-remove-badge{opacity:1}:host ngx-dropzone-remove-badge{opacity:0}:host video{max-height:100%;border-radius:5px}:host ::ng-deep ngx-dropzone-label{position:absolute;overflow-wrap:break-word}\n"] }]
}], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWRyb3B6b25lLXZpZGVvLXByZXZpZXcuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LWRyb3B6b25lL3NyYy9saWIvbmd4LWRyb3B6b25lLXByZXZpZXcvbmd4LWRyb3B6b25lLXZpZGVvLXByZXZpZXcvbmd4LWRyb3B6b25lLXZpZGVvLXByZXZpZXcuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQXFCLE1BQU0sZUFBZSxDQUFDO0FBQzdELE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ2hGLE9BQU8sRUFBRSxZQUFZLEVBQVcsTUFBTSwyQkFBMkIsQ0FBQzs7Ozs7QUFvQmxFLE1BQU0sT0FBTyxnQ0FBaUMsU0FBUSwyQkFBMkI7SUFFL0UsWUFDRSxTQUF1QjtRQUV2QixLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7SUFDbk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