Commit f08e1d3c authored by mgabdev's avatar mgabdev

TESTS for gifs

parent f7037644
...@@ -175,6 +175,9 @@ class Item extends React.PureComponent { ...@@ -175,6 +175,9 @@ class Item extends React.PureComponent {
} else if (attachment.get('type') === 'gifv') { } else if (attachment.get('type') === 'gifv') {
const autoPlay = !isIOS() && autoPlayGif; const autoPlay = !isIOS() && autoPlayGif;
const attachUrl = attachment.get('url');
const gifsrc = attachUrl.indexOf('?') > -1 ? attachUrl.split("?")[0] : attachUrl;
thumbnail = ( thumbnail = (
<div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}> <div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}>
<video <video
...@@ -182,11 +185,12 @@ class Item extends React.PureComponent { ...@@ -182,11 +185,12 @@ class Item extends React.PureComponent {
aria-label={attachment.get('description')} aria-label={attachment.get('description')}
title={attachment.get('description')} title={attachment.get('description')}
role='application' role='application'
src={attachment.get('url')} src={gifsrc}
onClick={this.handleClick} onClick={this.handleClick}
onMouseEnter={this.handleMouseEnter} onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave} onMouseLeave={this.handleMouseLeave}
autoPlay={autoPlay} autoPlay={autoPlay}
preload='auto'
loop loop
muted muted
playsInline playsInline
......
...@@ -7,6 +7,7 @@ import { autoPlayGif, displayMedia } from 'gabsocial/initial_state'; ...@@ -7,6 +7,7 @@ import { autoPlayGif, displayMedia } from 'gabsocial/initial_state';
import classNames from 'classnames'; import classNames from 'classnames';
import { decode } from 'blurhash'; import { decode } from 'blurhash';
import { isIOS } from 'gabsocial/is_mobile'; import { isIOS } from 'gabsocial/is_mobile';
import conversations_list_container from '../../direct_timeline/containers/conversations_list_container';
export default class MediaItem extends ImmutablePureComponent { export default class MediaItem extends ImmutablePureComponent {
...@@ -125,6 +126,7 @@ export default class MediaItem extends ImmutablePureComponent { ...@@ -125,6 +126,7 @@ export default class MediaItem extends ImmutablePureComponent {
onMouseEnter={this.handleMouseEnter} onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave} onMouseLeave={this.handleMouseLeave}
autoPlay={autoPlay} autoPlay={autoPlay}
preload='auto'
loop loop
muted muted
playsInline playsInline
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment