mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-10-22 22:09:26 +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
|
t.Value.IDR = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(ctx.CodecData.Record) == 0 {
|
||||||
|
return ErrSkip
|
||||||
|
}
|
||||||
if t.Value.IDR && !hasSPSPPS {
|
if t.Value.IDR && !hasSPSPPS {
|
||||||
spsRTP := &rtp.Packet{
|
spsRTP := &rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
@@ -210,6 +213,9 @@ func (r *Video) Parse(t *AVTrack) (err error) {
|
|||||||
t.Value.IDR = true
|
t.Value.IDR = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(ctx.CodecData.Record) == 0 {
|
||||||
|
return ErrSkip
|
||||||
|
}
|
||||||
if t.Value.IDR && !hasVPSSPSPPS {
|
if t.Value.IDR && !hasVPSSPSPPS {
|
||||||
vpsRTP := &rtp.Packet{
|
vpsRTP := &rtp.Packet{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
|
@@ -642,6 +642,12 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if s.Admin.zipReader != nil {
|
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"))
|
http.ServeFileFS(w, r, s.Admin.zipReader, strings.TrimPrefix(r.URL.Path, "/admin"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user