Пример #1
0
if ($_SESSION["role"] == "ROLE-002") {
    ?>
                    <th>#</th>
                    <?php 
}
?>
                  </tr>
                </thead>
                <tbody>
                  <?php 
require_once 'bbb-api-php/includes/bbb-api.php';
$bbb = new BigBlueButton();
$recordingsParams = array('meetingId' => $_GET["room_id"]);
$itsAllGood = true;
try {
    $result = $bbb->getRecordingsWithXmlResponseArray($recordingsParams);
} catch (Exception $e) {
    echo 'Caught exception: ', $e->getMessage(), "\n";
    $itsAllGood = false;
}
if ($itsAllGood == true) {
    if ($result == null) {
        echo "Failed to get any response. Maybe we can't contact the BBB server.";
    } else {
        if ($result['returncode'] == 'SUCCESS') {
            foreach ($result as $key => $value) {
                if ($value["recordId"] != null) {
                    $start_date = date("d/m/Y H:i:s", intval($value["startTime"]) / 1000);
                    $end_date = date("d/m/Y H:i:s", intval($value["endTime"]) / 1000);
                    $date_diff = abs(intval($value["endTime"]) / 1000 - intval($value["startTime"]) / 1000);
                    $hour = intval($date_diff / 3600);
 public function getRecordings($meetingId = 1)
 {
     $bbb = new BigBlueButton($this->salt, $this->url);
     $recordingsParams = array('meetingId' => $meetingId);
     $itsAllGood = true;
     try {
         $result = $bbb->getRecordingsWithXmlResponseArray($recordingsParams);
     } catch (Exception $e) {
         echo 'Caught exception: ', $e->getMessage(), "\n";
         $itsAllGood = false;
     }
     if ($itsAllGood == true) {
         if ($result == null) {
             echo "Failed to get any response. Maybe we can't contact the BBB server.";
         } else {
             $final = array();
             if ($result['returncode'] == 'SUCCESS') {
                 foreach ((array) $result as $data) {
                     $item['recordId'] = (string) $data['recordId'][0];
                     $item['playbackFormatUrl'] = (string) $data['playbackFormatUrl'][0];
                     $item['published'] = (string) $data['published'][0];
                     $item['startTime'] = date("j-F-Y, g:i:s A", (int) $data['startTime'][0] / 1000);
                     $item['endTime'] = date("j-F-Y, g:i:s A", (int) $data['endTime'][0] / 1000);
                     array_push($final, $item);
                 }
             } else {
                 echo "<p>Failed to get meeting info.</p>";
             }
         }
     }
     echo json_encode($final);
 }