fix: Video node attributes (#16)

Fixes https://github.com/noodlapp/noodl/issues/39
This commit is contained in:
Eric Tuvesson
2024-05-09 16:49:09 +02:00
committed by Richard Osborne
parent 62d545d4f9
commit c514c760e4

View File

@@ -34,16 +34,14 @@ export interface CachedVideoProps {
class CachedVideo extends React.PureComponent<CachedVideoProps> {
video: HTMLVideoElement;
shouldComponentUpdate(nextProps: CachedVideoProps) {
componentDidUpdate() {
if (this.video) {
this.video.muted = nextProps.muted;
this.video.loop = nextProps.loop;
this.video.volume = nextProps.volume;
this.video.autoplay = nextProps.autoplay;
this.video.controls = nextProps.controls;
this.video.muted = this.props.muted;
this.video.loop = this.props.loop;
this.video.volume = this.props.volume;
this.video.autoplay = this.props.autoplay;
this.video.controls = this.props.controls;
}
return true;
}
render() {