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

Port ddd69f3ae9 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
lolsob-rspec
ThibG 2020-07-15 21:07:53 +02:00 committed by Thibaut Girka
parent 67657d8361
commit 98223df18c
2 changed files with 4 additions and 0 deletions

View File

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

View File

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