frankyghost / projekktor

The Free Web Video Player
194 stars 75 forks source link

Auto-detecting filetype by inspecting the video url breaks when a plugin specifies a mimetype that is not associated with a file extension #27

Open mike-tomko-codebaby opened 10 years ago

mike-tomko-codebaby commented 10 years ago

While using this library in Firefox for Ubuntu I noticed that filetype auto-detection by video url breaks because the Totem Player Firefox plugin (named VLC Multimedia Plugin (compatible Totem 3.0.1)), specifies one or more mimetypes with a blank suffix (aka file extension). This leads to an incorrect typeModel being loaded which ends with error number 11 Invalid streamType and/or streamServer settings for null.

One question I have is why is _getTypeFromFileExtension() ran if we already have the type? Up until the _getTypeFromFileExtension() function is ran, the file object has both a src (String) and a type (String) property. Why is this type ignored in favor of what _getTypeFromFileExtension() returns, and why is the returned type added to src by making it an object? What is the use of data.file.type if data.file.src.type is used for finding the correct typesModel? (for reference, the code block I'm talking about is located here)