Attempt at fixing inline video player

This commit is contained in:
Thibaut Girka 2018-10-20 19:47:10 +02:00 committed by ThibG
parent dfa5b0576f
commit 04bedd237b

View file

@ -220,6 +220,11 @@ export default class Video extends React.PureComponent {
}
componentDidUpdate (prevProps) {
if (this.player && this.player.offsetWidth && !this.state.fullscreen) {
this.setState({
containerWidth: this.player.offsetWidth,
});
}
if (this.video && this.state.revealed && this.props.preventPlayback && !prevProps.preventPlayback) {
this.video.pause();
}