Resolve "press+hold audio recording is broken"
This commit is contained in:
parent
4bc4a8d8e5
commit
758201e2eb
4 changed files with 27 additions and 7 deletions
|
|
@ -34,8 +34,12 @@ export default {
|
|||
info: this.install(),
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.event.on("Event.localEventIdReplaced", this.onLocalEventIdReplaced);
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$audioPlayer.removeListener(this._uid);
|
||||
this.event.off("Event.localEventIdReplaced", this.onLocalEventIdReplaced);
|
||||
},
|
||||
computed: {
|
||||
currentTime() {
|
||||
|
|
@ -62,6 +66,12 @@ export default {
|
|||
},
|
||||
seeked(percent) {
|
||||
this.$audioPlayer.seek(this.event, percent);
|
||||
},
|
||||
onLocalEventIdReplaced() {
|
||||
// This happens when we are the sending party and the message has been sent and the local echo has been updated with the new real id.
|
||||
// Since we use the event id to register with the audio player, we need to update.
|
||||
this.$audioPlayer.removeListener(this._uid);
|
||||
this.info = this.$audioPlayer.addListener(this._uid, this.event);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue