Created
December 11, 2020 00:52
-
-
Save icywind/0b883081c0466ab757e08e219f9b3ab2 to your computer and use it in GitHub Desktop.
Query the cloud recording session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once("config.php"); | |
$curl = curl_init(); | |
// Receive ResourceID and sid from client | |
$ResourceID = $_POST["resourceId"]; | |
$Channel = $_POST["sid"]; | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "https://api.agora.io/v1/apps/$AppID/cloud_recording/resourceid/$ResourceID/sid/$sid/mode/mix/query", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | |
CURLOPT_CUSTOMREQUEST => "GET", | |
CURLOPT_HTTPHEADER => array( | |
"Content-Type: application/json", | |
"Authorization: Basic $AuthSecret" | |
), | |
)); | |
$response = curl_exec($curl); | |
curl_close($curl); | |
echo $response; | |
/** | |
* Returns json {"resourceId":"xxxx", "sid":"yyy", "serverResponse":{"status":5,"fileList":"zzzz.m3u8","fileListMode":"string","sliceStartTime":1606357122528}} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment