Try to detect iOS and *not* autoplay any videos

Technically the check for iOS from components is a side effect, because it's
neither in state nor props, but the user agent does not change, so I think
that's okay.
This commit is contained in:
Eugen Rochko
2017-03-07 09:54:57 +01:00
parent 1fb3e8988b
commit 47bf592db7
3 changed files with 10 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import IconButton from './icon_button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { isIOS } from '../is_mobile';
const messages = defineMessages({
toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' }
@ -161,7 +162,7 @@ const Item = React.createClass({
<video
src={attachment.get('url')}
onClick={this.handleClick}
autoPlay={true}
autoPlay={!isIOS()}
loop={true}
muted={true}
style={gifvThumbStyle}