You are here

public function NodeMeeting::init in BigBlueButton 8

Init meeting.

2 calls to NodeMeeting::init()
NodeMeeting::create in modules/bbb_node/src/Service/NodeMeeting.php
Create meeting.
NodeMeeting::update in modules/bbb_node/src/Service/NodeMeeting.php
Update meeting.

File

modules/bbb_node/src/Service/NodeMeeting.php, line 113

Class

NodeMeeting
Class NodeMeeting.

Namespace

Drupal\bbb_node\Service

Code

public function init(NodeInterface $node, CreateMeetingParameters $params = NULL) {
  if (empty($params)) {
    $params = new CreateMeetingParameters($node
      ->uuid(), $node
      ->getTitle());
  }

  /** @var \Drupal\bbb_node\Entity\BBBNodeTypeInterface $bbb_config */
  $bbb_config = $this->entityTypeManager
    ->getStorage('bbb_node_type')
    ->load($node
    ->getType());
  $params
    ->setMeetingName($params
    ->getMeetingName() ?: $node
    ->getTitle());
  $params
    ->setWelcomeMessage($params
    ->getWelcomeMessage() ?: $bbb_config
    ->get('welcome') ?: $this
    ->t('Welcome to @title', [
    '@title' => $node
      ->getTitle(),
  ]));
  $params
    ->setDialNumber($params
    ->getDialNumber() ?: $bbb_config
    ->get('dialNumber') ?: NULL);
  $params
    ->setModeratorPassword($params
    ->getModeratorPassword() ?: $bbb_config
    ->get('moderatorPW') ?: user_password());
  $params
    ->setAttendeePassword($params
    ->getAttendeePassword() ?: $bbb_config
    ->get('attendeePW') ?: user_password());
  $logout_url = $bbb_config
    ->get('logoutURL');
  $params
    ->setLogoutUrl($params
    ->getLogoutUrl() ?: (empty($logout_url) ? NULL : Url::fromUserInput($bbb_config
    ->get('logoutURL'), [
    'absolute' => TRUE,
  ])
    ->toString()));
  $params
    ->setRecord($params
    ->isRecorded() ?: (bool) $bbb_config
    ->get('record'));

  // This is the PIN that a dial-in user must enter to join the conference.
  // 5-digit value.
  $params
    ->setVoiceBridge($params
    ->getVoiceBridge() ?: random_int(10000, 99999));

  // TODO: Add support for the next values:

  /*$params->setLogo(
      $params->getLogo() ?:
        Url::fromUserInput($bbb_config->get('logoURL'), ['absolute' => TRUE])->toString()
    );*/

  // $params->setAllowStartStopRecording();
  // $params->setAutoStartRecording();
  // $params->setCopyright($params->getCopyright());
  // $params->setDuration($params->getDuration());
  // $params->setEndCallbackUrl();
  // $params->setMaxParticipants($params->getMaxParticipants());
  // $params->setModeratorOnlyMessage($params->getModeratorOnlyMessage());
  // $params->setMuteOnStart($params->isMuteOnStart());
  // $params->setParentMeetingId($params->getParentMeetingId());
  // $params->setWebcamsOnlyForModerator($params->isWebcamsOnlyForModerator());
  // $params->setBreakout($params->isBreakout());
  // $params->setFreeJoin($params->isFreeJoin());
  // $params->setSequence($params->getSequence());
  // $params->setWebVoice($params->getWebVoice());
  return $params;
}