giuseppe madonna Posted May 31, 2021 Share Posted May 31, 2021 Hi, i am trying to start and stop a recording of a stream at will, but i am new and i don't really understand how to modify the code to do it. Someone have an example of how to do it? Thank in advance Link to comment Share on other sites More sharing options...
0 Selim Emre Posted May 31, 2021 Share Posted May 31, 2021 Hi, Welcome to our community! You can Enable/Disable mp4/webm recording on Ant Media Server Dashboard. I have attached an example image. No need to use REST APIs or codes. I hope, I could help you. Best Regards, Selim Link to comment Share on other sites More sharing options...
0 giuseppe madonna Posted June 1, 2021 Author Share Posted June 1, 2021 Thank you, but i am not trying to enable recording but to start/stop it at will, i have understand that i need to use the https://antmedia.io/rest/#/BroadcastRestService/enableRecording API to do that, but i don't know how can i call it from back-end. Can u give me some example? I think i might use node.js but every example is userfull Link to comment Share on other sites More sharing options...
0 Selim Emre Posted June 1, 2021 Share Posted June 1, 2021 Hi, Have a good day. Can u give me some example? Sure, I'm glad to help with your issue. Yes, you need to use https://antmedia.io/rest/#/BroadcastRestService/enableRecording REST API for recording status. Here is the sample Javascript XHR request: var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function() { if(this.readyState === 4) { console.log(this.responseText); } }); xhr.open("PUT", "http://localhost:5080/LiveApp/rest/v2/broadcasts/308588021341642039818703/recording/true?recordType=mp4"); xhr.setRequestHeader("Content-Type", "application/json"); xhr.send(); PS: Please make sure you are already added your IP Address to application REST IP filter settings. Also please check below guides: https://github.com/ant-media/Ant-Media-Server/wiki/REST-API-Security-Documentation https://github.com/ant-media/Ant-Media-Server/wiki/REST-Guide https://github.com/ant-media/Ant-Media-Server/wiki/REST-API-cURL-Samples I hope, I could help you. Best Regards, Selim Link to comment Share on other sites More sharing options...
Question
giuseppe madonna
Hi,
i am trying to start and stop a recording of a stream at will,
but i am new and i don't really understand how to modify the code to do it.
Someone have an example of how to do it?
Thank in advance
Link to comment
Share on other sites
Top Posters For This Question
2
2
Popular Days
May 31
2
Jun 1
2
Top Posters For This Question
Selim Emre 2 posts
giuseppe madonna 2 posts
Popular Days
May 31 2021
2 posts
Jun 1 2021
2 posts
Posted Images
3 answers to this question
Recommended Posts