mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 11:02:25 -05:00
[feature] Enable basic video support (mp4 only) (#1274)
* [feature] basic video support * fix missing semicolon * replace text shadow with stacked icons Co-authored-by: f0x <f0x@cthu.lu>
This commit is contained in:
parent
0f38e7c9b0
commit
2bbc64be43
39 changed files with 6276 additions and 93 deletions
|
|
@ -37,6 +37,7 @@ func AllSupportedMIMETypes() []string {
|
|||
mimeImageGif,
|
||||
mimeImagePng,
|
||||
mimeImageWebp,
|
||||
mimeVideoMp4,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,16 +62,10 @@ func parseContentType(fileHeader []byte) (string, error) {
|
|||
return kind.MIME.Value, nil
|
||||
}
|
||||
|
||||
// supportedImage checks mime type of an image against a slice of accepted types,
|
||||
// and returns True if the mime type is accepted.
|
||||
func supportedImage(mimeType string) bool {
|
||||
acceptedImageTypes := []string{
|
||||
mimeImageJpeg,
|
||||
mimeImageGif,
|
||||
mimeImagePng,
|
||||
mimeImageWebp,
|
||||
}
|
||||
for _, accepted := range acceptedImageTypes {
|
||||
// supportedAttachment checks mime type of an attachment against a
|
||||
// slice of accepted types, and returns True if the mime type is accepted.
|
||||
func supportedAttachment(mimeType string) bool {
|
||||
for _, accepted := range AllSupportedMIMETypes() {
|
||||
if mimeType == accepted {
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue