Fix RTMP handler not calling for audio, video

This commit is contained in:
GyoungSu
2024-09-07 21:29:46 +09:00
parent d7e4b71ec1
commit 37e16c1573

View File

@@ -139,7 +139,7 @@ func (h *Handler) OnSetDataFrame(timestamp uint32, data *rtmpmsg.NetStreamSetDat
return nil return nil
} }
func (h *Handler) onAudio(timestamp uint32, payload io.Reader) error { func (h *Handler) OnAudio(timestamp uint32, payload io.Reader) error {
ctx := context.Background() ctx := context.Background()
var buf bytes.Buffer var buf bytes.Buffer
_, err := io.Copy(&buf, payload) _, err := io.Copy(&buf, payload)
@@ -189,7 +189,7 @@ func (h *Handler) onAudio(timestamp uint32, payload io.Reader) error {
return nil return nil
} }
func (h *Handler) onVideo(timestamp uint32, payload io.Reader) error { func (h *Handler) OnVideo(timestamp uint32, payload io.Reader) error {
ctx := context.Background() ctx := context.Background()
// Read the payload data into a buffer // Read the payload data into a buffer