mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-27 05:35:57 +08:00
feat: add custom admin home page
This commit is contained in:
@@ -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{
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user