videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.81k stars 7.43k forks source link

In Nuxt, on page refresh it result to error #8816

Closed yagnikvamja closed 4 weeks ago

yagnikvamja commented 1 month ago

Description

I am using Nuxt v3.12.3 and have integrated Video.js into my project. While the integration works perfectly when navigating between routes using buttons, an issue arises upon refreshing the page or directly accessing the specific route. For instance, navigating to the /test route using button where Video.js is utilized works without any problems, but refreshing the page or accessing the /test route directly results in an error. I have attached a link below for further reference.

Could you please assist in resolving this issue?

Reduced test case

https://github.com/yagnikvamja/nuxt-videojs-test

Steps to reproduce

  1. Clone the repository.
  2. Open the project and run the command: pnpm install && pnpm run dev.
  3. Use the button to navigate to the /test route.
  4. Observe that the video functions correctly.
  5. Refresh the page.
  6. Notice that an error occurs.

Errors

The below error shows in vscode terminal. image

The below error shows in chrome image

What version of Video.js are you using?

v8.16.1

Video.js plugins used.

@videojs-player/vue

What browser(s) including version(s) does this occur with?

Chrome Version 126.0.6478.183 (Official Build) (arm64)

What OS(es) and version(s) does this occur with?

macOS Sonoma 14.5

welcome[bot] commented 1 month 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.

gkatsev commented 1 month ago

My initial thought is that it's related to SSR or something. Video.js cannot be loaded on the server side. Also, looking at the repo, it seems like you're using @videojs-player/vue, it might be a bug there: https://github.com/surmon-china/videojs-player

yagnikvamja commented 1 month ago

Hello @gkatsev ,

Thanks for the quick response. It seems like it's SSR related issue. I will report the same at @videojs-player/vue.

~Best regards,

mister-ben commented 4 weeks ago

Closing as this is a third party issue. It would be good to add a link to that issue here.