Fix expand video on public page (#15469)
This commit is contained in:
@ -32,6 +32,9 @@ class MediaModal extends ImmutablePureComponent {
|
||||
onClose: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
onChangeBackgroundColor: PropTypes.func.isRequired,
|
||||
currentTime: PropTypes.number,
|
||||
autoPlay: PropTypes.bool,
|
||||
volume: PropTypes.number,
|
||||
};
|
||||
|
||||
static contextTypes = {
|
||||
@ -183,7 +186,7 @@ class MediaModal extends ImmutablePureComponent {
|
||||
/>
|
||||
);
|
||||
} else if (image.get('type') === 'video') {
|
||||
const { time } = this.props;
|
||||
const { currentTime, autoPlay, volume } = this.props;
|
||||
|
||||
return (
|
||||
<Video
|
||||
@ -192,7 +195,10 @@ class MediaModal extends ImmutablePureComponent {
|
||||
src={image.get('url')}
|
||||
width={image.get('width')}
|
||||
height={image.get('height')}
|
||||
currentTime={time || 0}
|
||||
frameRate={image.getIn(['meta', 'original', 'frame_rate'])}
|
||||
currentTime={currentTime || 0}
|
||||
autoPlay={autoPlay || false}
|
||||
volume={volume || 1}
|
||||
onCloseVideo={onClose}
|
||||
detailed
|
||||
alt={image.get('description')}
|
||||
|
@ -121,6 +121,7 @@ class Video extends React.PureComponent {
|
||||
autoPlay: PropTypes.bool,
|
||||
volume: PropTypes.number,
|
||||
muted: PropTypes.bool,
|
||||
componetIndex: PropTypes.number,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@ -501,6 +502,7 @@ class Video extends React.PureComponent {
|
||||
startTime: this.video.currentTime,
|
||||
autoPlay: !this.state.paused,
|
||||
defaultVolume: this.state.volume,
|
||||
componetIndex: this.props.componetIndex,
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user