I was developing an application that can get the URL of a file and has to do different things depending on the type of file (audio, video, image). Therefore, I get the file content type like this:
URLConnection connection = url.openConnection(); connection.connect(); String contentType = connection.getContentType();
I tried with some jpg and mp3 files, and the type of content is expected, but I have a problem with the video on this network (I just used it by accident) http://www.yo-yo.org/mp4/ I tried this with TestFour video ( http://www.yo-yo.org/mp4/yu5.mp4 ) and I Receive the following content type:
text/plain; charset=UTF-8
I expected to get "video / mp4".
Can someone explain why I get this type of content?
Thanks.
UPDATE
I also tried with another video in http://people.sc.fsu.edu/~jburkardt/data/mp4/claw_pix_example01_movie.mp4 and this happens the same thing.
Same thing with http://www.easydnnsolutions.com/Portals/0/EasyGalleryImages/1/18/Alice_in_Wonderland_Teaser_1.mp4
In all of them, I get the same type of content.
The MIME server configuration is probably incorrect and is the source of the problem.
Source: https://habr.com/ru/post/1340791/More articles:Will the video play in firefox but not in the html5 tag? - html5Type Qualifiers for a device class in CUDA - c ++https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1340788/javajaxb-unmarshall-xml-elements-with-same-name-but-different-attribute-values-to-different-class-members&usg=ALkJrhhjk8p_hXf5Rp7aN2-UMBh5_m8ijwHow to display image using extjs? - javascriptSum lines in php and rank - phpImportError: not a single module named win32api, python, even if the win32api location is added to the path - pythonHow to use the "Exit" option from a target in MSBuild - msbuildNSDateFormatter String - iphonehow to align UL inside a div - htmlIterating Libraries and Performing a Task in Ant - DirectoryAll Articles