ng-video-upload
v0.0.1
Published
Angular2+ asynchronous video uploader with preview
Downloads
12
Maintainers
Readme
VideoUploaderModule Video Uploader
Angular2 component that uploads selected or dropped video asynchronously with preview.
Demo
See demo here: demo
Install
npm install ng-video-upload --save
Usage
Add video uploader module to your module's imports
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app';
import { VideoUploaderModule } from 'ng-video-upload';
@NgModule({
imports: [BrowserModule, VideoUploaderModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
Use it in your component
import { Component } from '@angular/core';
import { VideoUploaderModuleVideoUploaderOptions, UploadedFile } from 'ng-video-upload';
@Component({
selector: 'example-app',
template: '<video-uploader [options]="options" (onUpload)="onUpload($event)"></video-uploader>'
})
export class AppComponent {
options: VideoUploaderModuleVideoUploaderOptions = {
thumbnailHeight: 150,
thumbnailWidth: 150,
uploadUrl: 'http://some-server.com/upload',
allowedVideoTypes: ['video/mp4'],
maxVideoSize: 3
};
onUpload(file: UploadedFile) {
console.log(file.response);
}
}