Pause other GIFs when playing round video message.

This commit is contained in:
John Preston 2017-04-04 16:43:41 +03:00
parent 5480a63beb
commit 1b7777e3a0
2 changed files with 6 additions and 1 deletions

View File

@ -2087,6 +2087,7 @@ bool HistoryGif::playInline(bool autoplay) {
if (App::main()) {
App::main()->mediaMarkRead(_data);
}
App::wnd()->controller()->enableGifPauseReason(Window::GifPauseReason::RoundPlaying);
}
if (_gif && autoplay) {
_gif->setAutoplay();
@ -2096,6 +2097,9 @@ bool HistoryGif::playInline(bool autoplay) {
}
void HistoryGif::stopInline() {
if (_gif && _gif->mode() == Media::Clip::Reader::Mode::Video) {
App::wnd()->controller()->disableGifPauseReason(Window::GifPauseReason::RoundPlaying);
}
clearClipReader();
_parent->setPendingInitDimensions();

View File

@ -27,7 +27,8 @@ enum class GifPauseReason {
InlineResults = (1 << 0),
SavedGifs = (1 << 1),
Layer = (1 << 2),
MediaPreview = (1 << 3),
RoundPlaying = (1 << 3),
MediaPreview = (1 << 4),
};
Q_DECLARE_FLAGS(GifPauseReasons, GifPauseReason);
Q_DECLARE_OPERATORS_FOR_FLAGS(GifPauseReasons);