muxinc / next-video

The easiest way to add video in your Nextjs app.
https://next-video.dev
MIT License
779 stars 28 forks source link

Undefined config causing many GETs to /undefined?url=[actual url] #290

Open Cheese-Echidna opened 3 weeks ago

Cheese-Echidna commented 3 weeks ago

I am building a content (mostly video) streaming app in NextJS (think plex but worse) and have been trying to use NextVideo for video playback.

When I try and play a video through the player, it stalls out and after a while the video stops playing.

Looking at the console, I see a lot (about 1 every 2s) of requests that are returning 404.

The requests are going to /undefined?url= followed by the actual url of the video content.

Checking out the source of the error, it seems to be coming from video-loader.js

let requestUrl = '${config2.path}?url=${encodeURIComponent('${src}')}';

I'm guessing config2 is undefined or null.

Is there anything I can do on my end to prevent this issue. I am literally just returning a div containing <NextVideo src={myVideo}/> where myVideo is a the path to a video.

Also, your bug report form 404s https://github.com/muxinc/next-video/blob/dabac8fd37f46c5508030248ac4f59b9253bfd41/.github/CONTRIBUTING.md#issues Sends you to: https://github.com/muxinc/next-video/blob/dabac8fd37f46c5508030248ac4f59b9253bfd41/issues/new/choose

Thanks

kinjal017 commented 3 weeks ago

I am also getting the same error and behavior, it would be nice to have the fix for these soon.

lh15 commented 2 weeks ago

Same here

Seems like some config is supposed to be set here

lh15 commented 2 weeks ago

Is this only supposed to work for mux?

https://github.com/muxinc/next-video/blob/dabac8fd37f46c5508030248ac4f59b9253bfd41/src/components/video-loader.ts#L31

luwes commented 4 days ago

thanks for reporting!

how does your next.config.(m)js look like?

is this setting set in tsconfig.json? "moduleResolution": "bundler",