|
|
|
@ -314,10 +314,8 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
|
|
|
downloadFile() {
|
|
|
|
|
const filename = this.playlist[0].title;
|
|
|
|
|
const ext = (this.playlist[0].type === 'audio/mp3') ? '.mp3' : '.mp4';
|
|
|
|
|
const type = this.playlist[0].type;
|
|
|
|
|
const url = this.playlist[0].url;
|
|
|
|
|
this.downloading = true;
|
|
|
|
|
this.postsService.downloadFileFromServer(this.uid, this.uuid, this.sub_id, url, type as FileType).subscribe(res => {
|
|
|
|
|
this.postsService.downloadFileFromServer(this.uid, this.uuid).subscribe(res => {
|
|
|
|
|
this.downloading = false;
|
|
|
|
|
const blob: Blob = res;
|
|
|
|
|
saveAs(blob, filename + ext);
|
|
|
|
|