diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js
index 2a31850f68..ff5a44e016 100644
--- a/src/components/structures/MatrixChat.js
+++ b/src/components/structures/MatrixChat.js
@@ -66,10 +66,20 @@ module.exports = React.createClass({
defaultDeviceDisplayName: React.PropTypes.string,
},
+ childContextTypes: {
+ appConfig: React.PropTypes.object,
+ },
+
AuxPanel: {
RoomSettings: "room_settings",
},
+ getChildContext: function() {
+ return {
+ appConfig: this.props.config,
+ }
+ },
+
getInitialState: function() {
var s = {
loading: true,
diff --git a/src/components/views/messages/MAudioBody.js b/src/components/views/messages/MAudioBody.js
index 393bf549ae..7e338e8466 100644
--- a/src/components/views/messages/MAudioBody.js
+++ b/src/components/views/messages/MAudioBody.js
@@ -21,7 +21,7 @@ import MFileBody from './MFileBody';
import MatrixClientPeg from '../../../MatrixClientPeg';
import sdk from '../../../index';
-import { decryptFile } from '../../../utils/DecryptFile';
+import { decryptFile, readBlobAsDataUri } from '../../../utils/DecryptFile';
export default class MAudioBody extends React.Component {
constructor(props) {
@@ -29,6 +29,7 @@ export default class MAudioBody extends React.Component {
this.state = {
playing: false,
decryptedUrl: null,
+ decryptedBlob: null,
error: null,
}
}
@@ -50,9 +51,14 @@ export default class MAudioBody extends React.Component {
componentDidMount() {
var content = this.props.mxEvent.getContent();
if (content.file !== undefined && this.state.decryptedUrl === null) {
- decryptFile(content.file).done((url) => {
+ var decryptedBlob;
+ decryptFile(content.file).then(function(blob) {
+ decryptedBlob = blob;
+ return readBlobAsDataUri(decryptedBlob);
+ }).done((url) => {
this.setState({
decryptedUrl: url,
+ decryptedBlob: decryptedBlob,
});
}, (err) => {
console.warn("Unable to decrypt attachment: ", err);
@@ -93,7 +99,7 @@ export default class MAudioBody extends React.Component {
return (
-