Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6314

React-Native : is it possible to cast a Video element into HTMLMediaElement?

$
0
0

Inside my React-Native code, I recover a Video element from reactxp-video package but then I need to give this element to a JS script but this script needs an HTMLMediaElement. I tried to cast my Video element into HTMLMediaElement but Typescript refused to cast a Video element into HTMLMediaElement.

I understand why it won't do it because : Type 'Video' is missing the following properties from type 'HTMLMediaElement': autoplay, buffered, controls, crossOrigin, and 276 more

Do you think it's possible to cast a Video element into HTMLMediaElement anyway with an another trick? (I was thinking about creating a VideoComponent which could extend React.Component and HTMLMediaElement but multiple inheritance is not allowed in Typescript).

Thank you,


Viewing all articles
Browse latest Browse all 6314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>