Skip to content

Commit c85886e

Browse files
Merge pull request #194 from cloudinary/fix-video-types-react
fix: VideoProps to extend video tag attributes
2 parents d1568eb + 8c68f59 commit c85886e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react/src/AdvancedVideo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component, createRef, EventHandler, MutableRefObject, SyntheticEvent } from 'react';
1+
import React, { Component, createRef, EventHandler, HTMLAttributes, MutableRefObject, SyntheticEvent } from 'react';
22
import { CloudinaryVideo } from '@cloudinary/url-gen';
33

44
import {
@@ -10,7 +10,7 @@ import {
1010

1111
type ReactEventHandler<T = Element> = EventHandler<SyntheticEvent<T>>;
1212

13-
interface VideoProps {
13+
interface VideoProps extends HTMLAttributes<HTMLVideoElement>{
1414
cldVid: CloudinaryVideo,
1515
plugins?: Plugins,
1616
sources?: VideoSources,
@@ -143,10 +143,10 @@ class AdvancedVideo extends Component <VideoProps> {
143143
plugins,
144144
sources,
145145
innerRef,
146-
...videoEvents // Assume any other props are for the base element
146+
...videoAttrs // Assume any other props are for the base element
147147
} = this.props;
148148

149-
return <video {...videoEvents} ref={this.attachRef} />
149+
return <video {...videoAttrs} ref={this.attachRef} />
150150
}
151151
}
152152

0 commit comments

Comments
 (0)