Skip to content

Support localhost URLs for poster #106

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

Closed
MattIPv4 opened this issue Mar 8, 2025 · 8 comments
Closed

Support localhost URLs for poster #106

MattIPv4 opened this issue Mar 8, 2025 · 8 comments

Comments

@MattIPv4
Copy link

MattIPv4 commented Mar 8, 2025

👋 It would be rather useful when developing sites locally if localhost URLs were to be supported for the poster prop. I understand that relative URLs won't work due to the poster being rendered in the iframe (though in #105 I did throw out the suggestion of the React component handling the poster itself, in which case they would), but full URLs making use of localhost should be doable?

@third774
Copy link
Contributor

Planning on looking into this soon! 🙏🏻

@MattIPv4
Copy link
Author

MattIPv4 commented Mar 18, 2025

👀 So it looks like something has changed in the underlying player and localhost URLs are now accepted, but... when using this with Next.js locally, Next.js doesn't accept /_next/image requests in development that are no-cors requests.

So I think the ask at this point would be making sure that the poster image is loaded with crossorigin anonymous? Not sure how exactly that'd be achieved as a CSS image can't be marked as crossorigin though...

@third774
Copy link
Contributor

Hrm — yeah, we'd need to update the poster here to use an tag. Should be doable I think?

@third774
Copy link
Contributor

Thinking about this a little more, and I think if we were going to do this we'd need to add a public API for setting what the crossorigin value should be, because I'm not sure we can just change this value for everyone without posters breaking for some users. 🤔

@MattIPv4
Copy link
Author

MattIPv4 commented Mar 18, 2025

Yah, that's true, I think blindly setting it to cross-origin always would be pretty breaking -- I suppose a second param for poster-crossorigin might be the best path? (Or hoping that Next.js provide a way to not need crossorigin for images in local dev)

@MattIPv4
Copy link
Author

Fwiw, if #105 is a lighter lift, that also solves for our specific migration -- though, of course, both of these I suspect would be beneficial for others too.

@MattIPv4
Copy link
Author

Closing the loop somewhat here, Next.js reverted the change that required images to be marked as cross-origin in dev, so this is no longer needed for what we're doing -- we can use localhost images just fine. As to whether this is a worthwhile thing to add support for anyway, I leave that with you (I suspect not).

@third774
Copy link
Contributor

Sweet — thanks for letting me know! Sorry for not actioning this sooner, but I'm relieved that it's resolved in a way that didn't require expanding our API (just for long term maintenance reasons!).

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