I am trying to make a live video event on bright cove site through my application made using PHP now according to their docs I have POSTED my request to their server using cURL and getting the success response. I have used the following the cURL command to send my request.
function createLiveEvent() {
$api = $_POST['api_key'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.bcovlive.io/v1/jobs");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{"
. "\n \"live_stream\": true,"
. "\n \"region\": \"us-west-2\","
. "\n \"reconnect_time\": 1800,"
. "\n \"live_sliding_window_duration\": 57600,"
. "\n \"outputs\": ["
. "\n {"
. "\n \"label\": \"hls720p\","
. "\n \"live_stream\": true,"
. "\n \"width\": 1280,"
. "\n \"height\": 720,"
. "\n \"video_codec\": \"h264\","
. "\n \"h264_profile\": \"high\","
. "\n \"video_bitrate\": 2100,"
. "\n \"segment_seconds\": 4,"
. "\n \"keyframe_interval\": 60\n },"
. "\n {\n \"label\": \"hls540p\","
. "\n \"live_stream\": true,"
. "\n \"width\": 960,\n \"height\": 540,"
. "\n \"video_codec\": \"h264\","
. "\n \"h264_profile\": \"main\","
. "\n \"video_bitrate\": 1500,"
. "\n \"segment_seconds\": 4,"
. "\n \"keyframe_interval\": 60\n },"
. "\n {\n \"label\": \"hls360p\","
. "\n \"live_stream\": true,\n \"width\": 640,"
. "\n \"height\": 360,\n \"video_codec\": \"h264\","
. "\n \"h264_profile\": \"main\","
. "\n \"video_bitrate\": 800,"
. "\n \"segment_seconds\": 4,"
. "\n \"keyframe_interval\": 60\n }\n ]\n}\n");
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = "Cache-Control: no-cache";
$headers[] = "Content-Type: application/json";
$headers[] = "Postman-Token: postman_token";
$headers[] = "X-Api-Key: " . $api;
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
wp_send_json($result);
}
And I am getting my response but I can't see my live event in my account on bright cove. I am sort of stuck at this point that what is it that I am missing here or doing wrong.