初始提交:短剧库源码(含转码优化 ultrafast)

This commit is contained in:
yvan
2026-09-17 19:09:08 +08:00
commit 07dc0f1059
247 changed files with 43242 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
package app
import (
"context"
"net/http"
)
func fixtureViewer(app *UIApp) *viewerRecords {
manager := app.browserViewers()
if manager.err != nil {
panic(manager.err)
}
viewer := manager.acquire(viewerID("local-synthetic-viewer"))
viewer.release()
return viewer
}
func viewerFixtureRequest(app *UIApp, request *http.Request) *http.Request {
return request.WithContext(viewerFixtureContext(app, request.Context()))
}
func viewerFixtureContext(app *UIApp, parent context.Context) context.Context {
return context.WithValue(parent, viewerContextKey{}, fixtureViewer(app))
}
func viewerFixtureHandler(app *UIApp, next http.Handler) http.Handler {
return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) {
next.ServeHTTP(writer, viewerFixtureRequest(app, request))
})
}