newVideoAsset applies what only holds for a video: a player has no alt attribute to fill, so the author cannot supply one, and the name that stands in keeps its extension because it goes where a filename would in a link.
(f asset, alt string)
| 102 | // attribute to fill, so the author cannot supply one, and the name that stands |
| 103 | // in keeps its extension because it goes where a filename would in a link. |
| 104 | func newVideoAsset(f asset, alt string) (UserAsset, error) { |
| 105 | a := &videoAsset{f} |
| 106 | if err := checkMaxSize(a.asset, maxVideoBytes, "videos"); err != nil { |
| 107 | return nil, err |
| 108 | } |
| 109 | |
| 110 | if alt != "" { |
| 111 | return nil, errors.New("cannot set alt text on video") |
| 112 | } |
| 113 | a.alt = filepath.Base(a.path) |
| 114 | |
| 115 | return a, nil |
| 116 | } |
| 117 | |
| 118 | func (*videoAsset) markdown(assetURL string) string { return assetURL } |
| 119 |
no test coverage detected