Skip to content

Media elements from other sites do not load #125

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
dummdidumm opened this issue Dec 13, 2022 · 7 comments
Closed

Media elements from other sites do not load #125

dummdidumm opened this issue Dec 13, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@dummdidumm
Copy link
Member

Media elements from third party sites are not loaded. This happens in (non-exhaustive list)

Not sure why - I'm guessing because the web container behaves as if it's a localhost instance running without https, and the sites then refuse to answer.

@dummdidumm dummdidumm added the bug Something isn't working label Dec 13, 2022
@Rich-Harris
Copy link
Member

We should be able to make this work by spinning up a server that proxies content from https://sveltejs.github.io/assets but adds COEP/COOP/CORP/whatever headers. Not 100% sure if it'll work for range requests (i.e. the video), but it'd work for images, and should be simple to implement using edge functions

Rich-Harris added a commit that referenced this issue Dec 13, 2022
Rich-Harris added a commit that referenced this issue Dec 13, 2022
@Rich-Harris
Copy link
Member

https://learn.svelte.dev/tutorial/sharing-code now works! Will try the video example next. Not sure what to do about the other two examples (and the https://httpstatusdogs.com example I wanted to add for error pages) since proxying other people's stuff is a bit cheeky

@dummdidumm
Copy link
Member Author

Proxying everything sounds risky, but if we scope that to to a whitelist of what we have in the tutorial (the video link, status dogs, the link to those image placeholders), it would be ok?

@Rich-Harris
Copy link
Member

it'd be scoped, yeah. i'm not too concerned about risks, i'm more concerned about ethics/legality. hotlinking is one thing, but proxying is another

@Rich-Harris
Copy link
Member

Man, I can't figure out how to get range requests to work. https://learn-svelte-dev-git-range-requests-svelte.vercel.app/assets/media/caminandes-llamigos.jpg works fine, https://learn-svelte-dev-git-range-requests-svelte.vercel.app/assets/media/caminandes-llamigos.mp4 barfs (though if I remove the range and if-range headers, it works fine, you just have to buffer the entire thing before you can watch any of it)

@Rich-Harris
Copy link
Member

Going to leave it for now, there are more pressing matters to deal with

dummdidumm added a commit that referenced this issue Dec 16, 2022
@Rich-Harris
Copy link
Member

closing this as audio elements work fine, and we're no longer using video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants