Add video picker and Discord video attachments.
CI / test (pull_request) Successful in 6m29s

The picker accepts one MP4 or WebM, the thread lightbox zooms photos, and Discord gets the video as a file on a follow-up message so photo embeds still render.
This commit is contained in:
2026-08-31 02:00:56 -07:00
parent 84dea8ea5d
commit f96df3222d
22 changed files with 1018 additions and 144 deletions
+13
View File
@@ -295,6 +295,19 @@ func TestPostVideoMultipartLifecycle(t *testing.T) {
t.Fatalf("streamed video upload = %+v", streamed)
}
rec = httptest.NewRecorder()
req := httptest.NewRequest(http.MethodGet, "/questions/"+root.ID, nil)
for _, cookie := range cookies {
req.AddCookie(cookie)
}
handler.ServeHTTP(rec, req)
page := rec.Body.String()
if rec.Code != http.StatusOK ||
!strings.Contains(page, `<video src="`+root.Images[1].PublicURL) ||
!strings.Contains(page, `data-existing-video`) {
t.Fatalf("question page missing video player: %d %s", rec.Code, page)
}
rec = multipartPost(t, handler, "/posts/"+root.ID+"/edit", map[string][]string{
"_csrf": {csrf},
"body": {"Keep the clip."},