感谢这个post,我可以使用带有角度的MediaRecorder。但我的绑定存在问题。
变量:
public test: string = "Step1";
MediaRecorder:
start(){
this.test = "Step2"
this.mediaRecorder = new MediaRecorder(stream, options);
this.mediaRecorder.onstop = (e) => {
console.log("look i'm the console");
this.test = "Step4";
}
this.mediaRecorder.start();
}
stop(){
this.test = "Step3"
this.mediaRecorder.stop();
}
HTML: 进展:{{test}}
<button (click)="start()">Start</button>
<button (click)="stop()">Stop</button>
我删除了大部分代码,例如,这样会更容易理解。
如何在我的代码中正确地使绑定工作?
答案 0 :(得分:0)
这是解决方案:
this.mediaRecorder.addEventListener('stop', event => {
console.log("look i'm the console");
this.test = "Step4";
});