[Glitch] Fix error when closing a playing audio or video modal

Port bfed7dd5f3 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
master
ThibG 4 years ago committed by Thibaut Girka
parent 1c6c40d17c
commit f94cb94767
  1. 2
      app/javascript/flavours/glitch/features/audio/index.js
  2. 2
      app/javascript/flavours/glitch/features/video/index.js

@ -283,6 +283,8 @@ class Audio extends React.PureComponent {
_renderCanvas () {
requestAnimationFrame(() => {
if (!this.audio) return;
this.handleTimeUpdate();
this._clear();
this._draw();

@ -195,6 +195,8 @@ class Video extends React.PureComponent {
_updateTime () {
requestAnimationFrame(() => {
if (!this.video) return;
this.handleTimeUpdate();
if (!this.state.paused) {

Loading…
Cancel
Save