diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index 28ff4dcd0..b508be407 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -186,6 +186,7 @@ "ktg_disable_chat_themes": "Disable chat themes", "ktg_settings_remember_compress_images": "Remember compress images", "ktg_settings_compress_images_default": "Compress images by default", + "ktg_pip_not_supported": "Sorry, Picture-in-Picture mode is not supported here.", "ktg_forward_quiz_unquoted": "Sorry, quizzes that are currently open and unvoted on cannot be forwarded unquoted.", "ktg_in_app_update_disabled": "In-app updater is disabled.", "ktg_settings_view_profile_on_top": "Show \"View Profile\" first", diff --git a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp index 3bbc98fb9..ea8edafca 100644 --- a/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp +++ b/Telegram/SourceFiles/media/view/media_view_overlay_widget.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "media/view/media_view_overlay_widget.h" +#include "kotato/kotato_lang.h" #include "apiwrap.h" #include "api/api_attached_stickers.h" #include "api/api_peer_photo.h" @@ -1065,8 +1066,8 @@ QSize OverlayWidget::videoSize() const { bool OverlayWidget::streamingRequiresControls() const { return !_stories - && _document - && (!_document->isAnimation() || _document->isVideoMessage()); + && _document; + //&& (!_document->isAnimation() || _document->isVideoMessage()); } QImage OverlayWidget::videoFrame() const { @@ -4221,8 +4222,11 @@ float64 OverlayWidget::playbackControlsCurrentSpeed(bool lastNonDefault) { } void OverlayWidget::switchToPip() { + if (_document == nullptr) { + Ui::Toast::Show(_widget, ktr("ktg_pip_not_supported")); + return; + } Expects(_streamed != nullptr); - Expects(_document != nullptr); const auto document = _document; const auto messageId = _message ? _message->fullId() : FullMsgId();