Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript for "VideoJsPlayerOptions" on version 8.10.0 #8646

Open
Rafaelmf opened this issue Mar 19, 2024 · 4 comments
Open

Typescript for "VideoJsPlayerOptions" on version 8.10.0 #8646

Rafaelmf opened this issue Mar 19, 2024 · 4 comments
Labels
needs: triage This issue needs to be reviewed ts TypeScript

Comments

@Rafaelmf
Copy link

Rafaelmf commented Mar 19, 2024

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:

export interface VideoJsPlayerOptions extends videojs.ComponentOptions {
    aspectRatio?: string | undefined;
    autoplay?: videojs.Autoplay | undefined;
    bigPlayButton?: boolean | undefined;
    controlBar?: videojs.ControlBarOptions | false | undefined;
    textTrackSettings?: videojs.TextTrackSettingsOptions | undefined;
    controls?: boolean | undefined;
    defaultVolume?: number | undefined;
    fill?: boolean | undefined;
    fluid?: boolean | undefined;
    height?: number | undefined;
    html5?: any;
    inactivityTimeout?: number | undefined;
    language?: string | undefined;
    languages?: { [code: string]: videojs.LanguageTranslations } | undefined;
    liveui?: boolean | undefined;
    loop?: boolean | undefined;
    muted?: boolean | undefined;
    nativeControlsForTouch?: boolean | undefined;
    notSupportedMessage?: string | undefined;
    playbackRates?: number[] | undefined;
    playsinline?: boolean | undefined;
    noUITitleAttributes?: boolean | undefined;
    plugins?: Partial<VideoJsPlayerPluginOptions> | undefined;
    poster?: string | undefined;
    preload?: videojs.Preload | undefined;
    responsive?: boolean | undefined;
    sourceOrder?: boolean | undefined;
    sources?: videojs.Tech.SourceObject[] | undefined;
    src?: string | undefined;
    techOrder?: string[] | undefined;
    tracks?: videojs.TextTrackOptions[] | undefined;
    userActions?: videojs.UserActions | undefined;
    width?: number | undefined;

    audioOnlyMode?: boolean | undefined;
    audioPosterMode?: boolean | undefined;
    autoSetup?: boolean | undefined;
    breakpoints?: Partial<videojs.Breakpoint> | undefined;
    fullscreen?: { options: { navigationUI: "hide" } } | undefined;
    id?: string | undefined;
    liveTracker?: {
        trackingThreshold?: number | undefined;
        liveTolerance?: number | undefined;
    } | undefined;
    normalizeAutoplay?: boolean | undefined;
    preferFullWindow?: boolean | undefined;
    restoreEl?: boolean | Element | undefined;
    suppressNotSupportedError?: boolean | undefined;
    techCanOverridePoster?: boolean | undefined;
    "vtt.js"?: string | undefined;
    disablePictureInPicture?: boolean | undefined;
    enableSourceset?: boolean | undefined;
    retryOnError?: boolean | undefined;
}

Reduced test case

https://codepen.io/gkatsev/pen/GwZegv?editors=1000#0

Steps to reproduce

  1. Just minimal setup with react
  2. Get typings for options argument

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

@Rafaelmf Rafaelmf added the needs: triage This issue needs to be reviewed label Mar 19, 2024
Copy link

welcome bot commented Mar 19, 2024

👋 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.

@try2beth3b3st
Copy link
Contributor

Same question.. Why no options types in d.ts..(

@mister-ben mister-ben added the ts TypeScript label Apr 2, 2024
@victordidenko
Copy link

Also videojs function accepts any as options now

declare function videojs(id: string | Element, options?: any, ready?: ReadyCallback): Player;

@dparker2
Copy link

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??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage This issue needs to be reviewed ts TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants