Merge pull request #5368 from matrix-org/hs/fix-video-bug

Fix videos not playing in non-encrypted rooms
This commit is contained in:
Will Hunt 2020-10-30 11:59:59 +00:00 committed by GitHub
commit 428a2de930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,9 +143,8 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
} }
async _videoOnPlay() { async _videoOnPlay() {
const autoplay = SettingsStore.getValue("autoplayGifsAndVideos") as boolean; if (this._getContentUrl() || this.state.fetchingData || this.state.error) {
if (autoplay || this.state.decryptedUrl || this.state.fetchingData || this.state.error) { // We have the file, we are fetching the file, or there is an error.
// The video has or will have the data.
return; return;
} }
this.setState({ this.setState({
@ -164,6 +163,7 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
this.setState({ this.setState({
decryptedUrl: contentUrl, decryptedUrl: contentUrl,
decryptedBlob: decryptedBlob, decryptedBlob: decryptedBlob,
fetchingData: false,
}); });
this.props.onHeightChanged(); this.props.onHeightChanged();
} }