• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/lib/integration/zoom/recording.php
  • Класс: BitrixSocialServicesIntegrationZoomRecording
  • Вызов: Recording::getRecordings
static function getRecordings($conferenceId): Result
{
	$result = new Result();
	if (!Loader::includeModule('socialservices'))
	{
		return $result->addError(new Error('Module socialservices is not installed.'));
	}

	$meetingResult = ZoomMeetingTable::getById($conferenceId);

	if ($meetingData = $meetingResult->fetch())
	{
		$recordingsResult = ZoomMeetingRecordingTable::getList([
			'select' => ['*'],
			'filter' => [
				'=MEETING_ID' => $meetingData['ID'],
			],
			'order' => [
				'START_DATE' => 'ASC'
			]
		]);
		$currentStartDate = '';
		while ($recording = $recordingsResult->fetch())
		{
			if ($currentStartDate != $recording['START_DATE']->format(DATE_ATOM))
			{
				$currentStartDate = $recording['START_DATE']->format(DATE_ATOM);
				$allRecordings[$currentStartDate] = [];
			}
			$recording['LENGTH'] = static::getRecordingLength($recording['START_DATE'], $recording['END_DATE']);
			$recording['LENGTH_FORMATTED'] = static::formatLength($recording['LENGTH']);
			$recording['LENGTH_HUMAN'] = static::formatLength($recording['LENGTH'], static::LENGTH_FORMAT_FULL);

			$recording['END_DATE_TS'] = $recording['END_DATE']->getTimestamp();

			if ($recording['FILE_ID'] > 0 && Loader::includeModule('disk') && $file = BitrixDiskFile::loadById($recording['FILE_ID']))
			{
				$recording['DOWNLOAD_URL'] = BitrixDiskDriver::getInstance()->getUrlManager()->getUrlForDownloadFile($file, true);
			}
			else
			{
				$parsedDownloadUrl = new Uri($recording['DOWNLOAD_URL']);
				$recording['DOWNLOAD_URL'] = $parsedDownloadUrl->addParams(['access_token' => $recording['DOWNLOAD_TOKEN']])->__toString();
			}
			$allRecordings[$currentStartDate][static::getRecordingKind($recording['FILE_TYPE'])] = $recording;
		}
	}
	if (!empty($allRecordings))
	{
		$result->setData(array_values($allRecordings));
	}

	return $result;
}