diff --git a/app/javascript/gabsocial/components/media_gallery.js b/app/javascript/gabsocial/components/media_gallery.js index 25dc228c..81ff0158 100644 --- a/app/javascript/gabsocial/components/media_gallery.js +++ b/app/javascript/gabsocial/components/media_gallery.js @@ -50,6 +50,13 @@ class Item extends React.PureComponent { } } + handleLoadedData = (e) => { + if (!this.hoverToPlay()) { + e.target.play(); + } + } + + hoverToPlay () { const { attachment } = this.props; return !autoPlayGif && attachment.get('type') === 'gifv'; @@ -70,13 +77,6 @@ class Item extends React.PureComponent { e.stopPropagation(); } - onLoadedData = (e) => { - console.log("onLoadedData:", e); - if (!this.hoverToPlay()) { - e.target.play(); - } - }; - componentDidMount () { if (this.props.attachment.get('blurhash')) { this._decode(); @@ -104,10 +104,6 @@ class Item extends React.PureComponent { setCanvasRef = c => { this.canvas = c; } - - setVideoRef = v => { - this.videoRef = v; - } handleImageLoad = () => { this.setState({ loaded: true }); @@ -186,23 +182,20 @@ class Item extends React.PureComponent { } else if (attachment.get('type') === 'gifv') { const autoPlay = !isIOS() && autoPlayGif; - const attachUrl = attachment.get('url'); - // const gifsrc = attachUrl.indexOf('?') > -1 ? attachUrl.split("?")[0] : attachUrl; - const gifsrc = 'https://video.twimg.com/tweet_video/EOOQ7zfWkAENTFm.mp4'; - thumbnail = (
); }