feat: add custom admin home page

This commit is contained in:
langhuihui
2025-07-21 19:00:13 +08:00
parent ad32f6f96e
commit 15d830f1eb
2 changed files with 12 additions and 0 deletions

View File

@@ -113,6 +113,9 @@ func (r *Video) Parse(t *AVTrack) (err error) {
t.Value.IDR = true
}
}
if len(ctx.CodecData.Record) == 0 {
return ErrSkip
}
if t.Value.IDR && !hasSPSPPS {
spsRTP := &rtp.Packet{
Header: rtp.Header{
@@ -210,6 +213,9 @@ func (r *Video) Parse(t *AVTrack) (err error) {
t.Value.IDR = true
}
}
if len(ctx.CodecData.Record) == 0 {
return ErrSkip
}
if t.Value.IDR && !hasVPSSPSPPS {
vpsRTP := &rtp.Packet{
Header: rtp.Header{

View File

@@ -642,6 +642,12 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if s.Admin.zipReader != nil {
// Handle root path redirect to HomePage
if r.URL.Path == "/" {
http.Redirect(w, r, "/admin/#/"+s.Admin.HomePage, http.StatusFound)
return
}
http.ServeFileFS(w, r, s.Admin.zipReader, strings.TrimPrefix(r.URL.Path, "/admin"))
return
}