Commit 4ca5d838 authored by liujiaxin's avatar liujiaxin

feat: add audio record

parent ed92b4d3
import {Component, EventEmitter, Input, OnDestroy, OnInit, Output, NgZone, OnChanges} from '@angular/core';
import {ApplicationRef, ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output, NgZone, OnChanges} from '@angular/core';
import {NzMessageService, NzNotificationService, UploadFile} from 'ng-zorro-antd';
import {HttpClient, HttpEvent, HttpEventType, HttpRequest} from '@angular/common/http';
import {environment} from '../../../environments/environment';
......@@ -57,6 +57,8 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
constructor( private nzMessageService: NzMessageService,
private zone: NgZone,
private nzNotificationService: NzNotificationService,
private appRef: ApplicationRef,
private changeDetectorRef: ChangeDetectorRef,
private httpClient: HttpClient) {
this.uploadUrl = (<any> window).courseware.uploadUrl();
this.uploadData = (<any> window).courseware.uploadData();
......@@ -214,6 +216,14 @@ export class AudioRecorderComponent implements OnInit, OnChanges, OnDestroy {
} else {
this.type = Type.RECORD;
}
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
}
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
onBtnClearAudio() {
this.audioUrl = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment