Added ability to start video chat with RTMP as well.

This commit is contained in:
23rd 2022-02-28 12:43:26 +03:00
parent 7cea4efac1
commit 40d97bc6a4
3 changed files with 20 additions and 9 deletions

View File

@ -2381,9 +2381,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"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_menu_start_group_call" = "Start live stream";
"lng_menu_start_group_call_scheduled" = "Schedule live stream";
"lng_menu_start_group_call" = "Start video chat";
"lng_menu_start_group_call_scheduled" = "Schedule video chat";
"lng_menu_start_group_call_with" = "Stream with...";
"lng_menu_start_group_call_channel" = "Start live stream";
"lng_menu_start_group_call_scheduled_channel" = "Schedule live stream";
"lng_menu_start_group_call_with_channel" = "Stream with...";
"lng_group_call_rtmp_title" = "Stream with other apps";
"lng_group_call_rtmp_url_subtitle" = "Server URL";

View File

@ -243,7 +243,8 @@ void ChooseJoinAsBox(
auto next = (context == Context::Switch)
? tr::lng_settings_save()
: tr::lng_continue();
if ((context == Context::Create) && !livestream) {
#if 0
if ((context == Context::Create)) {
const auto makeLink = [](const QString &text) {
return Ui::Text::Link(text);
};
@ -264,6 +265,7 @@ void ChooseJoinAsBox(
return false;
});
}
#endif
box->addButton(std::move(next), [=] {
auto copy = info;
copy.joinAs = controller->selected();

View File

@ -65,9 +65,8 @@ constexpr auto kEmojiInteractionSeenDuration = 3 * crl::time(1000);
inline bool HasGroupCallMenu(const not_null<PeerData*> &peer) {
return !peer->groupCall()
&& peer->isChannel()
&& !peer->isMegagroup()
&& peer->asChannel()->amCreator();
&& ((peer->isChannel() && peer->asChannel()->amCreator())
|| (peer->isChat() && peer->asChat()->amCreator()));
}
} // namespace
@ -345,16 +344,23 @@ void TopBarWidget::showGroupCallMenu(not_null<PeerData*> peer) {
const auto callback = [=](Calls::StartGroupCallArgs &&args) {
controller->startOrJoinGroupCall(peer, std::move(args));
};
const auto livestream = !peer->isMegagroup() && peer->isChannel();
_menu->addAction(
tr::lng_menu_start_group_call(tr::now),
livestream
? tr::lng_menu_start_group_call_channel(tr::now)
: tr::lng_menu_start_group_call(tr::now),
[=] { callback({}); },
&st::menuIconStartStream);
_menu->addAction(
tr::lng_menu_start_group_call_scheduled(tr::now),
livestream
? tr::lng_menu_start_group_call_scheduled_channel(tr::now)
: tr::lng_menu_start_group_call_scheduled(tr::now),
[=] { callback({ .scheduleNeeded = true }); },
&st::menuIconReschedule);
_menu->addAction(
tr::lng_menu_start_group_call_with(tr::now),
livestream
? tr::lng_menu_start_group_call_with_channel(tr::now)
: tr::lng_menu_start_group_call_with(tr::now),
[=] { callback({ .rtmpNeeded = true }); },
&st::menuIconStartStreamWith);
_menu->moveToRight(