From 1a6afcdd2b46c868c8480f8eee71015673630729 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Tue, 21 Jan 2020 17:06:33 -0500 Subject: [PATCH] Gifs working on mobile, maybe --- .../gabsocial/components/media_gallery.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/javascript/gabsocial/components/media_gallery.js b/app/javascript/gabsocial/components/media_gallery.js index fc2d6b88..524e4598 100644 --- a/app/javascript/gabsocial/components/media_gallery.js +++ b/app/javascript/gabsocial/components/media_gallery.js @@ -50,18 +50,10 @@ class Item extends React.PureComponent { } } - handleLoadedData = (e) => { - console.log("handleLoadedData:", e, this.hoverToPlay()); - // if (!this.hoverToPlay()) { - // e.target.play(); - // } - } - handleLoadedMetaData = (e) => { - console.log("handleLoadedMetaData:", e, this.hoverToPlay()); - // if (!this.hoverToPlay()) { - // e.target.play(); - // } + if (!this.hoverToPlay()) { + e.target.play(); + } } hoverToPlay () { @@ -200,7 +192,6 @@ class Item extends React.PureComponent { onClick={this.handleClick} onMouseEnter={this.handleMouseEnter} onMouseLeave={this.handleMouseLeave} - onLoadedData={this.handleLoadedData} onLoadedMetadata={this.handleLoadedMetaData} autoPlay={autoPlay} type='video/mp4'