Log config when debug-level
This commit is contained in:
@@ -369,25 +369,25 @@ type StreamInfo struct {
|
||||
Path string
|
||||
}
|
||||
|
||||
func (s *RTMPServer) List() []*StreamInfo {
|
||||
func (rs *RTMPServer) List() []*StreamInfo {
|
||||
var results []*StreamInfo
|
||||
_, port, _ := net.SplitHostPort(s.ListenAddr)
|
||||
_, port, _ := net.SplitHostPort(rs.ListenAddr)
|
||||
|
||||
for _, stream := range s.streams {
|
||||
results = append(results, &StreamInfo{Name: stream.Name, Path: fmt.Sprintf("rtmp://%s:%s/view/%s", s.Hostname, port, stream.Name)})
|
||||
for _, stream := range rs.streams {
|
||||
results = append(results, &StreamInfo{Name: stream.Name, Path: fmt.Sprintf("rtmp://%s:%s/view/%s", rs.Hostname, port, stream.Name)})
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
func (s *RTMPServer) GetInfo(name string) (*StreamInfo, error) {
|
||||
stream, ok := s.streams[name]
|
||||
func (rs *RTMPServer) GetInfo(name string) (*StreamInfo, error) {
|
||||
stream, ok := rs.streams[name]
|
||||
if !ok {
|
||||
return nil, ErrNoSuchItem
|
||||
}
|
||||
_, port, _ := net.SplitHostPort(s.ListenAddr)
|
||||
_, port, _ := net.SplitHostPort(rs.ListenAddr)
|
||||
|
||||
return &StreamInfo{
|
||||
Name: stream.Name,
|
||||
Path: fmt.Sprintf("rtmp://%s:%s/view/%s", s.Hostname, port, stream.Name),
|
||||
Path: fmt.Sprintf("rtmp://%s:%s/view/%s", rs.Hostname, port, stream.Name),
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user