Lightbox: Ensure that click of video pauses it
This commit is contained in:
parent
23b720a982
commit
43ac8ce37e
2 changed files with 2 additions and 5 deletions
|
@ -71,6 +71,7 @@ const styles = {
|
|||
maxWidth: '100%',
|
||||
maxHeight: '100%',
|
||||
objectFit: 'contain',
|
||||
outline: 'none',
|
||||
} as React.CSSProperties,
|
||||
caption: {
|
||||
position: 'absolute',
|
||||
|
@ -171,13 +172,10 @@ const Icon = ({
|
|||
export class Lightbox extends React.Component<Props> {
|
||||
private readonly containerRef: React.RefObject<HTMLDivElement>;
|
||||
private readonly videoRef: React.RefObject<HTMLVideoElement>;
|
||||
private readonly playVideoBound: () => void;
|
||||
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.playVideoBound = this.playVideo.bind(this);
|
||||
|
||||
this.videoRef = React.createRef();
|
||||
this.containerRef = React.createRef();
|
||||
}
|
||||
|
@ -292,7 +290,6 @@ export class Lightbox extends React.Component<Props> {
|
|||
<video
|
||||
role="button"
|
||||
ref={this.videoRef}
|
||||
onClick={this.playVideoBound}
|
||||
controls={true}
|
||||
style={styles.object}
|
||||
key={objectURL}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue