* Add blurhash * Use fallback color for spoiler when blurhash missing * Federate the blurhash and accept it as long as it's at most 5x5 * Display unknown media attachments as blurhash placeholders * Improve style of embed actions and spoiler button * Change blurhash resolution from 3x3 to 4x4 * Improve dependency definitions * Fix code style issues
		
			
				
	
	
		
			35 lines
		
	
	
	
		
			907 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
	
		
			907 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import React from 'react';
 | 
						|
import ImmutablePropTypes from 'react-immutable-proptypes';
 | 
						|
import PropTypes from 'prop-types';
 | 
						|
import Video from '../../video';
 | 
						|
import ImmutablePureComponent from 'react-immutable-pure-component';
 | 
						|
 | 
						|
export default class VideoModal extends ImmutablePureComponent {
 | 
						|
 | 
						|
  static propTypes = {
 | 
						|
    media: ImmutablePropTypes.map.isRequired,
 | 
						|
    time: PropTypes.number,
 | 
						|
    onClose: PropTypes.func.isRequired,
 | 
						|
  };
 | 
						|
 | 
						|
  render () {
 | 
						|
    const { media, time, onClose } = this.props;
 | 
						|
 | 
						|
    return (
 | 
						|
      <div className='modal-root__modal video-modal'>
 | 
						|
        <div>
 | 
						|
          <Video
 | 
						|
            preview={media.get('preview_url')}
 | 
						|
            blurhash={media.get('blurhash')}
 | 
						|
            src={media.get('url')}
 | 
						|
            startTime={time}
 | 
						|
            onCloseVideo={onClose}
 | 
						|
            detailed
 | 
						|
            alt={media.get('description')}
 | 
						|
          />
 | 
						|
        </div>
 | 
						|
      </div>
 | 
						|
    );
 | 
						|
  }
 | 
						|
 | 
						|
}
 |