martignoni / hugo-video

A Hugo theme component to embed videos using HTML video element
GNU General Public License v3.0
103 stars 27 forks source link

.MediaType.Suffixes returns empty array for m4v when site is deployed to GitLab #10

Open OlafHaag opened 4 years ago

OlafHaag commented 4 years ago

When I built my site locally, everything worked as expected. Now I pushed the site to gitlab pages and the build failed. I traced it down to .MediaType.Suffixes returning []. The file in question is a m4v video file.

https://github.com/martignoni/hugo-video/blob/ee4a22c693336314a8f1c74e7d238a466dde66ac/layouts/shortcodes/video.html#L31

The page resource is found though. It just can't determine the extension. I'll look for a solution.

OlafHaag commented 4 years ago

So it turns out this is connected to #8 . m4v is not in the built-in media types for MP4 videos.

One could override the MIME type in the theme's own configuration. I have a working example and will create a pull request.