focus method

void focus(
  1. Participant participant
)

Focuses participant, which means putting in to the focused.

If participant is paneled, then it will be placed to the focused if it's not empty, or to its default group otherwise.

Implementation

void focus(Participant participant) {
  if (focused.isNotEmpty) {
    if (paneled.contains(participant)) {
      focused.add(participant);
      paneled.remove(participant);
    } else {
      _putVideoTo(participant, focused);
    }

    _ensureCorrectGrouping();
  } else {
    if (paneled.contains(participant)) {
      _putVideoFrom(participant, paneled);
      _ensureCorrectGrouping();
    }
  }
}