Ejemplo n.º 1
0
 /**
 *This method calls getMeetings on the bigbluebuttonbn server, then calls getMeetingInfo for each meeting and concatenates the result.
 *
 *@param URL -- the url of the bigbluebuttonbn server
 *@param SALT -- the security salt of the bigbluebuttonbn server
 *
 *@return 
 *	- Null if the server is unreachable
 *	- If FAILED then returns an array containing a returncode, messageKey, message.
 *	- If SUCCESS then returns an array of all the meetings. Each element in the array is an array containing a meetingID, 
 	  moderatorPW, attendeePW, hasBeenForciblyEnded, running.
 */
 public static function getRecordingsArray($meetingID, $URL, $SALT)
 {
     $xml = BigBlueButtonBN::_wrap_simplexml_load_file(BigBlueButtonBN::getRecordingsURL($meetingID, $URL, $SALT));
     if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) {
         //The meetings were returned
         return array('returncode' => (string) $xml->returncode, 'message' => (string) $xml->message, 'messageKey' => (string) $xml->messageKey);
     } else {
         if ($xml && $xml->returncode == 'SUCCESS') {
             //If there were meetings already created
             $recordings = array();
             foreach ($xml->recordings->recording as $recording) {
                 $recordings[(string) $recording->recordID] = array('recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime);
                 $recordings[(string) $recording->recordID]['playbacks'] = array();
                 foreach ($recording->playback->format as $format) {
                     $recordings[(string) $recording->recordID]['playbacks'][(string) $format->type] = array('type' => (string) $format->type, 'url' => (string) $format->url);
                 }
                 // THIS IS FOR TESTING MULTIPLE FORMATS, DO REMOVE IT FOR FINAL RELEASE
                 //$recordings[(string) $recording->recordID]['playbacks']['desktop'] = array( 'type' => 'desktop', 'url' => (string) $recording->playback->format->url );
                 //Add the metadata to the recordings array
                 $metadata = get_object_vars($recording->metadata);
                 while ($data = current($metadata)) {
                     $recordings[(string) $recording->recordID]['meta_' . key($metadata)] = $data;
                     next($metadata);
                 }
             }
             ksort($recordings);
             return $recordings;
         } else {
             if ($xml) {
                 //If the xml packet returned failure it displays the message to the user
                 return array('returncode' => (string) $xml->returncode, 'message' => (string) $xml->message, 'messageKey' => (string) $xml->messageKey);
             } else {
                 //If the server is unreachable, then prompts the user of the necessary action
                 return NULL;
             }
         }
     }
 }