-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add a way to sniff for HLS playlist files (m3u8) #125
base: main
Are you sure you want to change the base?
Conversation
Awesome! Can you become a member of https://github.com/mozilla-standards/, or publicize your membership? As for tests, historically we don't have many/any for the MIME sniffing algorithms, but I think it'd be worth adding some if it's not impossible. Web platform tests definitely supports the appropriate server infrastructure; you can set arbitrary headers. |
Yes, thanks, Anne had invited me but my membership was private.
This is tracked by https://bugzilla.mozilla.org/show_bug.cgi?id=1656495. We have tests for most of this in Gecko, I need to see if it would be possible to convert to wpt (it's using internal gecko things to hook into the sniffers themselves, but the test vectors are nice). |
@padenot Are you sure that Chromium is sniffing this? I'm not seeing it in their sniffing code: Though, as you well know, Firefox is: (As I mentioned in #150, support for a format does not necessarily imply that sniffing is also being done.) |
Looks like Chrome and Safari (at least desktop) don't sniff it indeed [0], curiously. It's however mandatory to implement [0]: I tested serving a HLS playlist file with |
I'm not seeing anything in Media elements that indicates that sniffing is mandatory, though I am seeing lots of conflicting and underspecified things. I'm guessing the connections between HTML and mimesniff need to be made more robust. In the meantime, can you point to where you're interpreting as indicating sniffing is mandatory? |
Yeah, I think Chrome and Safari do require a MIME type for this. See whatwg/html#6468 for the corresponding HTML issue. I guess that means we should adjust Firefox and close this PR? |
I have confirmed that Chrome identifies this as |
This seems to be mostly mobile-only, because m3u8 are only played on mobile. Chrome, Firefox and Safari can play those files on mobile. Chrome and Safari don't require a particular
Content-Type
.Firefox requires the right mime type to be sent because it didn't have a way to sniff for those files, but this is changing, and it's best to normalize how to sniff.
Safari can additionally play those files on desktop, regardless of the
Content-Type
sent by the server.HTMLMediaElement
. I suppose we can try to load the resource with a web server that forcesapplication/octet-stream
or the like, but that requires a server-side component.Content-Type
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff