You are here

function zoomapi_meeting_create_instant_meeting in Zoom API 7

Create Instant Meeting for Account.

Parameters

object $account: The Drupal account to act as the host.

array $options: Optional array of meeting options.

Return value

array An array of the meeting setup.

File

./zoomapi.module, line 549
Main file for the Zoom API module.

Code

function zoomapi_meeting_create_instant_meeting($account, array $options = []) {
  if (empty($account->data['zoomapi_user_id'])) {
    return [];
  }
  $options['type'] = ZOOMAPI_MEETING_TYPE_INSTANT;
  if (empty($options['topic'])) {
    $options['topic'] = zoomapi_meeting_topic_generate_for_entity($account, $account, 'user', $options);
  }
  $zoom_meeting = zoomapi_meeting_create_for_entity($account, $account, 'user', $options);
  $zoom_meeting['entity_type'] = 'user';
  $zoom_meeting['entity_id'] = $account->uid;
  zoomapi_track_meeting($zoom_meeting);
  return $zoom_meeting;
}