Show information about absent RTMP stream.

This commit is contained in:
John Preston 2022-02-28 20:26:37 +03:00
parent 6d46590312
commit 7a602690bb
3 changed files with 39 additions and 2 deletions

View file

@ -2364,8 +2364,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_call_unpinned_camera" = "{user}'s video is unpinned.";
"lng_group_call_unpinned_screen" = "{user}'s screencast is unpinned.";
"lng_group_call_sure_screencast" = "{user} is screensharing. This action will make your screencast pinned for all participants.";
"lng_group_call_pinned_on_top" = "Live stream pinned on top.";
"lng_group_call_unpinned_on_top" = "Live stream unpinned from top.";
"lng_group_call_pinned_on_top" = "Live stream is pinned on top.";
"lng_group_call_unpinned_on_top" = "Live stream is unpinned from top.";
"lng_group_call_recording_start_sure" = "Participants will see the chat is being recorded.";
"lng_group_call_recording_stop_sure" = "Do you want to stop recording this chat?";
"lng_group_call_recording_start_field" = "Recording Title";
@ -2383,6 +2383,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_call_title_changed_channel" = "Live stream title changed to {title}";
"lng_group_call_join_as_changed" = "Members of this voice chat will now see you as {name}";
"lng_group_call_join_as_changed_channel" = "Members of this live stream will now see you as {name}";
"lng_group_call_no_stream_admin" = "Oops! Telegram doesn't see any stream coming from your streaming app. Please make sure you entered the right Server URL and Stream Key in your app..";
"lng_group_call_no_stream" = "{group} is currently not broadcasting live stream data to Telegram.";
"lng_menu_start_group_call" = "Start video chat";
"lng_menu_start_group_call_scheduled" = "Schedule video chat";

View file

@ -795,6 +795,7 @@ void Panel::setupMembers() {
_members->show();
setupEmptyRtmp();
refreshControlsBackground();
raiseControls();
@ -1596,6 +1597,38 @@ void Panel::updateButtonsStyles() {
: st::groupCallHangup);
}
void Panel::setupEmptyRtmp() {
_call->emptyRtmpValue(
) | rpl::start_with_next([=](bool empty) {
if (!empty) {
_emptyRtmp.destroy();
return;
} else if (_emptyRtmp) {
return;
}
auto text = _call->rtmpUrl().isEmpty()
? tr::lng_group_call_no_stream(
lt_group,
rpl::single(_peer->name))
: tr::lng_group_call_no_stream_admin();
_emptyRtmp.create(
widget(),
std::move(text),
st::groupCallVideoLimitLabel);
widget()->sizeValue(
) | rpl::start_with_next([=](QSize size) {
const auto width = std::min(
size.width() - st::groupCallWidth / 10,
st::groupCallWidth);
_emptyRtmp->resizeToWidth(width);
_emptyRtmp->move(
(size.width() - _emptyRtmp->width()) / 2,
(size.height() - _emptyRtmp->height()) / 3);
}, _emptyRtmp->lifetime());
}, lifetime());
}
void Panel::refreshControlsBackground() {
if (!_members) {
return;

View file

@ -161,6 +161,7 @@ private:
std::optional<bool> overrideWideMode = std::nullopt);
void refreshTopButton();
void createPinOnTop();
void setupEmptyRtmp();
void toggleWideControls(bool shown);
void updateWideControlsVisibility();
[[nodiscard]] bool videoButtonInNarrowMode() const;
@ -225,6 +226,7 @@ private:
object_ptr<Ui::RpWidget> _countdown = { nullptr };
std::shared_ptr<Ui::GroupCallScheduledLeft> _countdownData;
object_ptr<Ui::FlatLabel> _startsWhen = { nullptr };
object_ptr<Ui::FlatLabel> _emptyRtmp = { nullptr };
ChooseJoinAsProcess _joinAsProcess;
std::optional<QRect> _lastSmallGeometry;
std::optional<QRect> _lastLargeGeometry;