Open Rafaelmf opened 5 months ago
š Thanks for opening your first issue here! š
If you're reporting a š bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
Same question.. Why no options types in d.ts..(
Also videojs
function accepts any
as options now
declare function videojs(id: string | Element, options?: any, ready?: ReadyCallback): Player;
So version 8 exports its own types but they are way more incomplete than the community-made DefinitelyTyped ones for v7? Why not copy/paste the DefinitelyTyped ones and work from there??
@marcosATr did you try it? It is any
As a work around:
import videojs from 'video.js'
type VideoJsPlayerOptions = Parameters<typeof videojs>[1]
@iliawx I don't understand, are you kidding?
@victordidenko , I'm sorry I provided the wrong import. I deleted the previous comment to avoid further confusion. Here's how you can get the proper type for video.js options parameter:
import videojs from "video.js/dist/video.min";
type PlayerOptions = typeof videojs.options;
type AlsoPlayerOptions = Parameters<typeof videojs>["1"];
@marcosATr I understand now, but this is hardly proper type. In your sandbox types are defined in @types/video.js@7.3.58
package, which might be incompatible with version 8. And more, it might break a runtime build, if video.js package will change internal structure. They can do it any time, even in patch release, because it is not a breaking change in terms of semantic versioning.
Description
Hello!
I had the video.js version 7.19.2 running on a react project and I was getting the VideoJsPlayerOptions type as:
import { VideoJsPlayerOptions } from "video.js"
After updating to the new version 8.10.0 this is not exported anymore. And I couldn't find it anywhere. Can someone help me with that? I get the error:
Module '"video.js"' has no exported member 'VideoJsPlayerOptions'. Did you mean to use 'import VideoJsPlayerOptions from "video.js"' instead?
Below is the type on previous versions:
Reduced test case
https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0
Steps to reproduce
Errors
No response
What version of Video.js are you using?
8.10.0
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
Chrome
What OS(es) and version(s) does this occur with?
Macos