static propTypes = {
src: PropTypes.string.isRequired,
+ width: PropTypes.number,
+ height: PropTypes.number,
time: PropTypes.number,
controls: PropTypes.bool.isRequired,
muted: PropTypes.bool.isRequired,
render () {
return (
- <div className='extended-video-player'>
+ <div className='extended-video-player' style={{ width: this.props.width, height: this.props.height }}>
<video
ref={this.setRef}
src={this.props.src}
const { media, intl, onClose } = this.props;
const index = this.getIndex();
- const attachment = media.get(index);
- const url = attachment.get('url');
let leftNav, rightNav, content;
rightNav = <div role='button' tabIndex='0' className='modal-container__nav modal-container__nav--right' onClick={this.handleNextClick}><i className='fa fa-fw fa-chevron-right' /></div>;
}
- if (attachment.get('type') === 'image') {
- content = media.map((image) => {
- const width = image.getIn(['meta', 'original', 'width']) || null;
- const height = image.getIn(['meta', 'original', 'height']) || null;
+ content = media.map((image) => {
+ const width = image.getIn(['meta', 'original', 'width']) || null;
+ const height = image.getIn(['meta', 'original', 'height']) || null;
+ if (image.get('type') === 'image') {
return <ImageLoader previewSrc={image.get('preview_url')} src={image.get('url')} width={width} height={height} key={image.get('preview_url')} />;
- }).toArray();
- } else if (attachment.get('type') === 'gifv') {
- content = <ExtendedVideoPlayer src={url} muted controls={false} />;
- }
+ } else if (image.get('type') === 'gifv') {
+ return <ExtendedVideoPlayer src={image.get('url')} muted controls={false} width={width} height={height} key={image.get('preview_url')} />;
+ }
+
+ return null;
+ }).toArray();
return (
<div className='modal-root__modal media-modal'>