mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Use streamed video for GIFs in History.
This commit is contained in:
@@ -3199,25 +3199,30 @@ void Session::unregisterContactItem(
|
||||
}
|
||||
}
|
||||
|
||||
void Session::registerAutoplayAnimation(
|
||||
not_null<::Media::Clip::Reader*> reader,
|
||||
not_null<ViewElement*> view) {
|
||||
_autoplayAnimations.emplace(reader, view);
|
||||
void Session::registerPlayingVideoFile(not_null<ViewElement*> view) {
|
||||
_playingVideoFiles.emplace(view);
|
||||
}
|
||||
|
||||
void Session::unregisterAutoplayAnimation(
|
||||
not_null<::Media::Clip::Reader*> reader) {
|
||||
_autoplayAnimations.remove(reader);
|
||||
void Session::unregisterPlayingVideoFile(not_null<ViewElement*> view) {
|
||||
_playingVideoFiles.remove(view);
|
||||
}
|
||||
|
||||
void Session::stopAutoplayAnimations() {
|
||||
for (const auto [reader, view] : base::take(_autoplayAnimations)) {
|
||||
void Session::stopPlayingVideoFiles() {
|
||||
for (const auto view : base::take(_playingVideoFiles)) {
|
||||
if (const auto media = view->media()) {
|
||||
media->stopAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Session::checkPlayingVideoFiles() {
|
||||
for (const auto view : base::take(_playingVideoFiles)) {
|
||||
if (const auto media = view->media()) {
|
||||
media->checkAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HistoryItem *Session::findWebPageItem(not_null<WebPageData*> page) const {
|
||||
const auto i = _webpageItems.find(page);
|
||||
if (i != _webpageItems.end()) {
|
||||
|
Reference in New Issue
Block a user