media: Add common video media types

- See https://discourse.gohugo.io/t/resources-bytype-for-video-files/21285
This commit is contained in:
Nicolas Martignoni 2019-10-16 15:10:32 +02:00 committed by Bjørn Erik Pedersen
parent 46cafdbaca
commit 689f647baf
2 changed files with 15 additions and 1 deletions

View file

@ -145,6 +145,14 @@ var (
TIFFType = Type{MainType: "image", SubType: "tiff", Suffixes: []string{"tif", "tiff"}, Delimiter: defaultDelimiter} TIFFType = Type{MainType: "image", SubType: "tiff", Suffixes: []string{"tif", "tiff"}, Delimiter: defaultDelimiter}
BMPType = Type{MainType: "image", SubType: "bmp", Suffixes: []string{"bmp"}, Delimiter: defaultDelimiter} BMPType = Type{MainType: "image", SubType: "bmp", Suffixes: []string{"bmp"}, Delimiter: defaultDelimiter}
// Common video types
AVIType = Type{MainType: "video", SubType: "x-msvideo", Suffixes: []string{"avi"}, Delimiter: defaultDelimiter}
MPEGType = Type{MainType: "video", SubType: "mpeg", Suffixes: []string{"mpg", "mpeg"}, Delimiter: defaultDelimiter}
MP4Type = Type{MainType: "video", SubType: "mp4", Suffixes: []string{"mp4"}, Delimiter: defaultDelimiter}
OGGType = Type{MainType: "video", SubType: "ogg", Suffixes: []string{"ogv"}, Delimiter: defaultDelimiter}
WEBMType = Type{MainType: "video", SubType: "webm", Suffixes: []string{"webm"}, Delimiter: defaultDelimiter}
GPPType = Type{MainType: "video", SubType: "3gpp", Suffixes: []string{"3gpp", "3gp"}, Delimiter: defaultDelimiter}
OctetType = Type{MainType: "application", SubType: "octet-stream"} OctetType = Type{MainType: "application", SubType: "octet-stream"}
) )
@ -167,6 +175,12 @@ var DefaultTypes = Types{
TOMLType, TOMLType,
PNGType, PNGType,
JPGType, JPGType,
AVIType,
MPEGType,
MP4Type,
OGGType,
WEBMType,
GPPType,
} }
func init() { func init() {

View file

@ -58,7 +58,7 @@ func TestDefaultTypes(t *testing.T) {
} }
c.Assert(len(DefaultTypes), qt.Equals, 17) c.Assert(len(DefaultTypes), qt.Equals, 23)
} }