TypeScript Version: 3.8.0
Search Terms:
HTMLVideo, HTMLVideoElement, playsinline
Code
const el = document.createElement('video');
el.playsinline = true; // Property 'playsinline' does not exist on type 'HTMLVideoElement'.
Expected behavior:
There should not be a TS error. playsinline is a boolean attribute that exists on the <video> element per https://html.spec.whatwg.org/multipage/media.html#htmlvideoelement
Actual behavior:
There is a TS error: Property 'playsinline' does not exist on type 'HTMLVideoElement'.
Related Issues:
None.
While the attribute is called playsinline, it is exposed as playsInline (capitalized "i") in the DOM.
https://html.spec.whatwg.org/multipage/media.html#the-video-element
I had the same problem tooο½,playsInline is ok!
yeah, remember that typescript uses cammelCase
like: autoplay should be autoPlay
and playsinline should be playsInline
Any progress?
Most helpful comment
While the attribute is called playsinline, it is exposed as playsInline (capitalized "i") in the DOM.
https://html.spec.whatwg.org/multipage/media.html#the-video-element