TESTS for gifs

This commit is contained in:
mgabdev 2020-01-17 12:49:07 -05:00
parent f7037644f0
commit f08e1d3c21
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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