This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Taken from http://stackoverflow.com/questions/5867534/how-to-save-canvas-data-to-file/5971674#5971674 | |
*/ | |
var fs = require('fs'); | |
// string generated by canvas.toDataURL() | |
var img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0" | |
+ "NAAAAKElEQVQ4jWNgYGD4Twzu6FhFFGYYNXDUwGFpIAk2E4dHDRw1cDgaCAASFOffhEIO" | |
+ "3gAAAABJRU5ErkJggg=="; | |
// strip off the data: url prefix to get just the base64-encoded bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.glass{ | |
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%); | |
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); | |
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); | |
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); | |
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); | |
background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0) 100%); | |
border: 2px solid #DDDBD7; | |
-webkit-box-shadow: 3px 3px 10px rgba(0,0,0,0.4), inset 0 0 10px rgba(255,255,255, 0.8); | |
-moz-box-shadow: 3px 3px 10px rgba(0,0,0,0.4), inset 0 0 10px rgba(255,255,255, 0.8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Filename: upload.component.ts | |
import { Component, OnInit } from '@angular/core'; | |
import { UploadService } from '../upload.service'; | |
import { map, expand } from 'rxjs/operators'; | |
import { EMPTY } from 'rxjs'; | |
export class uploadFiles { | |
constructor(public video: File, public path: string, public uploadURI: string) { | |
this.video = video; | |
this.path = path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { map, expand } from 'rxjs/operators'; | |
import { EMPTY } from 'rxjs'; | |
import { CompressorService } from './compressor.service'; | |
@Component({ | |
selector: 'app-root', | |
template: '<input type="file" (change)="process($event)" multiple/>', | |
styles: [''] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file: FileList; //populated on filechange | |
uploadURI: Array < String >; //populated after filechange | |
public Tus() { | |
if (this.file.length > 0 && this.uploadURI.length > 0) { | |
this.uploadService.tusUpload(this.file, this.uploadURI); | |
} | |
} else { | |
alert('file length error'); | |
} |