Commit f08e1d3c authored by mgabdev's avatar mgabdev

TESTS for gifs

parent f7037644
......@@ -175,6 +175,9 @@ 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;
thumbnail = (
<div className={classNames('media-gallery__gifv', { autoplay: autoPlay })}>
<video
......@@ -182,11 +185,12 @@ class Item extends React.PureComponent {
aria-label={attachment.get('description')}
title={attachment.get('description')}
role='application'
src={attachment.get('url')}
src={gifsrc}
onClick={this.handleClick}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
autoPlay={autoPlay}
preload='auto'
loop
muted
playsInline
......
......@@ -7,6 +7,7 @@ import { autoPlayGif, displayMedia } from 'gabsocial/initial_state';
import classNames from 'classnames';
import { decode } from 'blurhash';
import { isIOS } from 'gabsocial/is_mobile';
import conversations_list_container from '../../direct_timeline/containers/conversations_list_container';
export default class MediaItem extends ImmutablePureComponent {
......@@ -125,6 +126,7 @@ export default class MediaItem extends ImmutablePureComponent {
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
autoPlay={autoPlay}
preload='auto'
loop
muted
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