vidstack / player

UI components and hooks for building video/audio players on the web. Robust, customizable, and accessible. Modern alternative to JW Player and Video.js.
https://vidstack.io
MIT License
2.36k stars 137 forks source link

`useMediaState` hook throwing error #1432

Open underGhost opened 2 months ago

underGhost commented 2 months ago

Current Behavior:

Attempting to use the React vidStack (1.12.11) from the installation docs and running into an error:

zm20240919-2312-2 zm20240919-2313-2

Was able to pull this package down and trace it to these lines:

https://github.com/vidstack/player/blob/main/packages/react/src/hooks/use-media-state.ts#L37 and https://github.com/vidstack/player/blob/main/packages/react/src/hooks/use-media-state.ts#L57

Commenting them out seems to allow the video player to render.

Expected Behavior:

Video player should render

Steps To Reproduce:

Follow React -> Video -> Default Layout in the docs

Reproduction Link: How to create a repro?

Environment:

Anything Else?

mihar-22 commented 2 months ago

Can you show an example of how you're trying to use the hook?

underGhost commented 2 months ago

@mihar-22 I'm not using the hook at all. I'm just trying to render the component using react and it's failing with the above errors.

zm20240920-0002-2
mihar-22 commented 2 months ago

I'm not seeing any issues: repro.

underGhost commented 2 months ago

@mihar-22 Yea it's weird because I don't get it when using the plyr layout, or creating a custom layout, only when using the default layout.