openPopup method

Future<void> openPopup()

Opens this PlayerView as a separate window.

Only meaningful for the Web platform currently.

Implementation

Future<void> openPopup() async {
  final ChatId? chatId = resourceId?.chatId;

  if (chatId != null) {
    final bool hasWindow = WebUtils.openPopupGallery(
      chatId,
      id: post?.id,
      index: post?.index.value,
    );

    if (!hasWindow) {
      notify(ErrorNotification(message: 'err_media_popup_was_blocked'.l10n));
    } else {
      shouldClose?.call();
    }
  }
}