-
Notifications
You must be signed in to change notification settings - Fork 510
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
Using relative URLs to refer to audio/video/font files #5727
Comments
I think the same applies to .ttf, which is forcing us to use a GitHub Pages-hosted example for https://developer.mozilla.org/en-US/docs/web/css/@font-face#specifying_a_downloadable_font . I might be wrong here though. |
The magic for images ( Lines 462 to 463 in 68d8fa1
Lines 35 to 39 in 68d8fa1
The same approach should work for |
This comment was marked as outdated.
This comment was marked as outdated.
Yes. Also font files like woff and woff2. Can we get these supported too @caugner ? |
That will definitely be trickier, because you wouldn't be referencing those fonts in an HTML attribute, but rather inline in JavaScript or in a @hamishwillee Would those woff/woff2 files be used in multiple examples? |
@caugner Yes. For my case I'll be accessing them programmatically using FontFace - that means it's a fetch under the hood, which is why I need this same-site.
Yes. At least the FontFace and @font-face examples. There are some alternatives that might be used.
But having these locally is the most flexible solution, and means we won't have to hassle you again. |
In mdn/content#14183 I want to include a live sample using an
<audio>
element. With,<img>
elements I can download the source, keep it alongsideindex.md
, and reference it using a relative path, like this: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#alternative_text.I don't seem to be able to do the same with audio files (and maybe video too, haven't tried these). I need to refer to them using an absolute URL, like https://pr14183.content.dev.mdn.mozit.cloud/en-US/docs/Web/API/HTMLMediaElement/preservespitch#example . This doesn't seem ideal - it would be good to keep all the assets for a page together.
The text was updated successfully, but these errors were encountered: