diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index f0edbd3c4..32b3cdd07 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -74,6 +74,8 @@ "ktg_call_button": "Call", "ktg_settings_ffmpeg_multithread": "Multithread video decoding", "ktg_settings_ffmpeg_multithread_about": "When enabled, CPU and RAM consumption is higher, video decodes faster. When disabled, CPU and RAM consumption is lower, video decodes slower. The more CPU cores you have, the more RAM consumption you have when this option is enabled. You can set exact number of threads in the JSON configuration file.", + "ktg_settings_external_video_player": "External video player", + "ktg_settings_external_video_player_about": "When this option is enabled, autoplay is force-disabled and system video player is used to play videos.", "ktg_settings_adaptive_bubbles": "Adaptive bubbles", "ktg_settings_recent_stickers_limit": { "zero": "Recent stickers: show {count} stickers", diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp index f1e3d43f0..88249d0d3 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -791,6 +791,23 @@ void SetupKotatoOther( AddSkip(container); AddDividerText(container, rktr("ktg_settings_ffmpeg_multithread_about")); AddSkip(container); + + AddButton( + container, + rktr("ktg_settings_external_video_player"), + st::settingsButton + )->toggleOn( + rpl::single(cUseExternalVideoPlayer()) + )->toggledValue( + ) | rpl::filter([](bool enabled) { + return (enabled != cUseExternalVideoPlayer()); + }) | rpl::start_with_next([=](bool enabled) { + cSetUseExternalVideoPlayer(enabled); + controller->session().saveSettingsDelayed(); + }, container->lifetime()); + + AddSkip(container); + AddDividerText(container, rktr("ktg_settings_external_video_player_about")); } Kotato::Kotato( diff --git a/Telegram/SourceFiles/settings/settings_codes.cpp b/Telegram/SourceFiles/settings/settings_codes.cpp index 464c82bf8..7e688a137 100644 --- a/Telegram/SourceFiles/settings/settings_codes.cpp +++ b/Telegram/SourceFiles/settings/settings_codes.cpp @@ -116,17 +116,6 @@ auto GenerateCodes() { } }); }); - codes.emplace(qsl("videoplayer"), [](SessionController *window) { - if (!window) { - return; - } - auto text = cUseExternalVideoPlayer() ? qsl("Use internal video player?") : qsl("Use external video player?"); - Ui::show(Box(text, [=] { - cSetUseExternalVideoPlayer(!cUseExternalVideoPlayer()); - window->session().saveSettingsDelayed(); - Ui::hideLayer(); - })); - }); codes.emplace(qsl("endpoints"), [](SessionController *window) { if (!Core::App().domain().started()) { return;