Ant-Media-Server icon indicating copy to clipboard operation
Ant-Media-Server copied to clipboard

How do I use /v2/broadcasts/{id}/subtrack?

Open Tom-CrowdSurf opened this issue 3 years ago • 1 comments
trafficstars

Hi, I'm trying trying to broadcast multiple streams over a single connection, The rest api indicates I can add a subtrack to an existing track by using:

/v2/broadcasts/STREAM-A/subtrack I'm posting the payload:

{
"id":"STREAM-B"
}

But I get the error: java.lang.NullPointerException

Does anyone know what I'm doing wrong? Is it a different variable name I should be sending in my JSON payload? Thanks! Tom

Tom-CrowdSurf avatar Jul 12 '22 21:07 Tom-CrowdSurf

Hi @Tom-CrowdSurf Thanks for your question.

The use of this Rest API is to add different subtracks to the main track for multitrack publish & play. You can send one stream as a main track and using this API, different subtracks can be added to main track. Please check the multitrack documentation here

For example, below is the CURL sample to add audio streamId as a subtrack to group Id main with streamId video.

curl --location --request POST 'https://domain-name:5443/LiveApp/rest/v2/broadcasts/main/subtrack?id=audio' \
--header 'Content-Type: application/json'

I hope it helps.

yashtandon113 avatar Jul 13 '22 20:07 yashtandon113

Closing this issue. Please feel free to open if you have any questions.

yashtandon113 avatar Nov 24 '22 06:11 yashtandon113