21

We have an MP4 video file in a Github Pages repository. The file is being served with a MIME type of application/octet-stream, which means Internet Explorer doesn't like it. It should be served as type video/mp4. Is there a way to configure Github Pages to use the proper MIME type, or should we find an alternate hosting solution for the video? This topic isn't addressed in the help pages.

pjmorse
  • 9,204
  • 9
  • 54
  • 124

3 Answers3

13

The topic is addressed here: https://help.github.com/articles/mime-types-on-github-pages/

GitHub Pages supports more than 750 MIME types across 1,000s of file extensions. The list of supported MIME types is generated from the mime-db project, which aggregates MIME types from the Apache and Nginx projects as well as the official IANA list of internet content types.

MIME types are additional headers that servers send to provide browsers with information about the types of files being requested and how to handle the file once downloaded.

To add or modify MIME types for use on GitHub Pages, see the mime-db Contributing instructions.

The mime-db project is currently reporting mp4 as video/mp4:

"video/mp4": {
  "source": "apache",
  "compressible": false,
  "extensions": ["mp4","mp4v","mpg4"]
},

Source: https://github.com/jshttp/mime-db/blob/46a40f0524a01fb3075a7ecde92e8e04fc93d599/db.json#L6233

If Github pages is still reporting mp4 files as application/octet-stream you should contact Github support.

13rac1
  • 1,057
  • 11
  • 14
7

The answer is no.

However, Ian's earlier answer is not strictly true. You can use github to host webpages. There are plenty of developer blogs up there.

For video I use Amazon s3 as it costs next to nothing for storing and serving video content and you can set the mimetypes as you require.

I store about 60GB of video and served 8GB last month for the cost of 9USD so it's worth it.

Community
  • 1
  • 1
timstermatic
  • 1,710
  • 14
  • 32
-25

You're not supposed to use Github as a webserver, because it is a code hosting site. They manage your code repositories and are only concerned about showing code.

  • So your answer to the actual question is, "No, the MIME types cannot be configured"? – pjmorse May 07 '13 at 10:55
  • 15
    @pjmorse asked about GitHub Pages, which is specifically designed to be used as a webserver, not the GitHub repository browser. – MrPotes Jul 31 '13 at 15:51