Skip to content
Permalink
Browse files

media: Add common video media types

  • Loading branch information...
martignoni authored and bep committed Oct 16, 2019
1 parent 46cafdb commit 689f647baf96af078186f0cdc45199f7d0995d22
Showing with 15 additions and 1 deletion.
  1. +14 −0 media/mediaType.go
  2. +1 −1 media/mediaType_test.go
@@ -145,6 +145,14 @@ var (
TIFFType = Type{MainType: "image", SubType: "tiff", Suffixes: []string{"tif", "tiff"}, 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"}
)

@@ -167,6 +175,12 @@ var DefaultTypes = Types{
TOMLType,
PNGType,
JPGType,
AVIType,
MPEGType,
MP4Type,
OGGType,
WEBMType,
GPPType,
}

func init() {
@@ -58,7 +58,7 @@ func TestDefaultTypes(t *testing.T) {

}

c.Assert(len(DefaultTypes), qt.Equals, 17)
c.Assert(len(DefaultTypes), qt.Equals, 23)

}

0 comments on commit 689f647

Please sign in to comment.
You can’t perform that action at this time.