Ant-Media-Server
Ant-Media-Server copied to clipboard
How do I use /v2/broadcasts/{id}/subtrack?
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
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.
Closing this issue. Please feel free to open if you have any questions.