Audio attachments
And touch events for mobile quick reactions.
This commit is contained in:
parent
3ad4083312
commit
a19082e2ea
10 changed files with 1324 additions and 1172 deletions
27
src/components/messages/attachmentMixin.js
Normal file
27
src/components/messages/attachmentMixin.js
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import util from "../../plugins/utils";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
src: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log("Mounted with event:", JSON.stringify(this.event.getContent()))
|
||||
util
|
||||
.getAttachment(this.$matrix.matrixClient, this.event)
|
||||
.then((url) => {
|
||||
this.src = url;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("Failed to fetch attachment: ", err);
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.src) {
|
||||
const objectUrl = this.src;
|
||||
this.src = null;
|
||||
URL.revokeObjectURL(objectUrl);
|
||||
}
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue