Use onMetaData instead of setDataFrame to try to parse out RTMP

metadata. Closes #419
This commit is contained in:
Gabe Kangas 2020-12-05 18:33:17 -08:00
parent 40e63546cb
commit 2abea78e3c

View file

@ -13,8 +13,8 @@ import (
func getInboundDetailsFromMetadata(metadata []interface{}) (models.RTMPStreamMetadata, error) {
metadataComponentsString := fmt.Sprintf("%+v", metadata)
if !strings.Contains(metadataComponentsString, "@setDataFrame") {
return models.RTMPStreamMetadata{}, errors.New("Not a setDataFrame message")
if !strings.Contains(metadataComponentsString, "onMetaData") {
return models.RTMPStreamMetadata{}, errors.New("Not a onMetaData message")
}
re := regexp.MustCompile(`\{(.*?)\}`)
submatchall := re.FindAllString(metadataComponentsString, 1)