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

[Bug] Getting warning when using CldVideoPlayer #187

Closed
miticm opened this issue Apr 27, 2023 · 4 comments
Closed

[Bug] Getting warning when using CldVideoPlayer #187

miticm opened this issue Apr 27, 2023 · 4 comments

Comments

@miticm
Copy link

miticm commented Apr 27, 2023

Bug Report

Describe the bug

I am getting this warning when using CldVideoPlayer, can we improve this?
Do not add stylesheets using next/head (see tag with href="https://unpkg.com/[email protected]/dist/cld-video-player.min.css"). Use Document instead.
See more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component

Is this a regression?

no

Steps To Reproduce the error

  1. import CldVideoPlayer and use it
  2. go to browser panel to see this warning

Expected behaviour

No warning and use the recommended way

CodeSandbox or Live Example of Bug

Screenshot or Video Recording

Your environment

  • OS:
  • Node version:
  • Npm version:
  • Browser name and version: Chorme

Additional context

@miticm miticm changed the title [Bug] [Bug] Getting warning when using CldVideoPlayer Apr 27, 2023
@colbyfayock
Copy link
Collaborator

colbyfayock commented Apr 27, 2023

hey @miticm - yeah, its currently the solution i have to add the required stylesheet to the component

ive been trying to find other ways to handle this. importing from the node module doesnt work for instance, as thats explicitly not allowed by nextjs

i'm not quite sure on how to fix this without requiring the user to include it themselves

in this PR i've actually added an option to exclude the stylesheet: https://github.com/colbyfayock/next-cloudinary/pull/181/files#diff-a55bcf836522ca3b2611e1c71bf0dd0ac5ea8a13832d57f433ac9bd75f487515R15

not particularly because of this reason, but in Next.js 13 App directory, Head component doesnt work

any thoughts or ideas on this?

@miticm
Copy link
Author

miticm commented Apr 28, 2023

Wow, thanks for the quick response, yeah as you mentioned, there is no good way to handle this right now, I would include it myself and use the option to exclude the stylesheet.

@miticm miticm closed this as completed Apr 28, 2023
@miticm
Copy link
Author

miticm commented Jan 17, 2024

Hi there @colbyfayock, I have users based in China, and the unpkg.com is blocked there, is there an option to add cld-video-player.min.js and cld-video-player.min.css manually so that I can make the video player load?

@colbyfayock
Copy link
Collaborator

hey @miticm thats a good question, haven't ran into this issue before

i dont believe there would be a way for me to manually provide a way to include the .js file, though there is already a CSS file available to be imported, but doesnt help without the JS

there are a few options that immediately come to mind:

The issue with this though is that the web.dev/measure metrics take a little bit of a hit due to the amount of JS getting loaded. I think this is still probably the "right" option for me to continue exploring this and figure it out in a way that provides a better mechanism for interfacing with the video player code while avoiding issues like this

this obviously isn't ideal, but its an escape hatch if we can't figure out a different solution

again, not ideal, but another solution until the first option is resolved


in the meantime i've flagged this internally, but given i haven't hit this before, im not sure if this is just "how it is" with CDN's and China or not but if I get anymore information regarding that, I'll share here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants