-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Bad behaviour when no type specified on source #4469
Comments
Your proposal would be relatively easy to implement, I think. I wonder if there's a historical reason why Video.js does not maintain such a mapping. Any thoughts from @videojs/core-committers? |
Having a full mime-type mapping will greatly increase the size of the player. If we trim it, how do we decide which to include and which to exclude? |
Hi @gkatsev thank you for the reply. I'm talking only about some popular types, not a full mime-type list. The samples I said (.opus, .mov, .aac) are quite popular and are not the only. Right now video.js is breaking them, we have to answer if this is a better situation than having some types in the code. All the scenarios you are describing are happening now, if you check the code you can see that it is using the extension when no type is provided, so it's not a problem related with the solution suggested. It's a proposal to make video.js better, not perfect. |
Yup, maybe it isn't that bad to have the just a few of known common ones. |
Probably should happen in here: video.js/src/js/utils/filter-source.js Lines 35 to 37 in 7145a9c
|
yeah, sure! |
Awesome. Let me know here or in a PR or on our slack if you have any questions or issues. |
File mimetype is filled when the file extension is known and type is not provided.
How about allowing the src to be an Object and we can pass in the {url,mimeType} ?? easy enough to check/implement. |
A source object can be passed in, and we handle it properly. This issue was about how to handle being given a string only. |
Description
Right now, when using a video with source tag but without a type attribute, video.js takes the extension of the file and checks if the browser is able to play it. You can see it here:
video.js/src/js/tech/html5.js
Line 1672 in b636663
There are some valid formats that are not working because of this, some samples:
.opus -> video/ogg
.mov -> video/mp4
.aac -> audio/mp4
...
Steps to reproduce
Results
Expected
Legit audio/video formats are accepted.
Actual
Some legit audio/video formats cause an error
Proposal
Maintain a hash with popular extensions and MIME types, check against this hash the extensions to get the MIME type.
The text was updated successfully, but these errors were encountered: