From 04bedd237bf2ec1cd5538ee2da4c60c932a66ae0 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 20 Oct 2018 19:47:10 +0200 Subject: [PATCH] Attempt at fixing inline video player --- app/javascript/flavours/glitch/features/video/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 227f298e4c..4f95aea96b 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -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(); }