[Glitch] Fix error when closing a playing audio or video modal
Port bfed7dd5f3
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
pull/1383/head
parent
1c6c40d17c
commit
f94cb94767
|
@ -283,6 +283,8 @@ class Audio extends React.PureComponent {
|
||||||
|
|
||||||
_renderCanvas () {
|
_renderCanvas () {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
|
if (!this.audio) return;
|
||||||
|
|
||||||
this.handleTimeUpdate();
|
this.handleTimeUpdate();
|
||||||
this._clear();
|
this._clear();
|
||||||
this._draw();
|
this._draw();
|
||||||
|
|
|
@ -195,6 +195,8 @@ class Video extends React.PureComponent {
|
||||||
|
|
||||||
_updateTime () {
|
_updateTime () {
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
|
if (!this.video) return;
|
||||||
|
|
||||||
this.handleTimeUpdate();
|
this.handleTimeUpdate();
|
||||||
|
|
||||||
if (!this.state.paused) {
|
if (!this.state.paused) {
|
||||||
|
|
Loading…
Reference in New Issue