Load and show video thumbnails in the panel.

This commit is contained in:
John Preston
2020-05-22 15:15:09 +04:00
parent 33c1c48ad9
commit 3c9ca2eb94
11 changed files with 206 additions and 17 deletions
@@ -154,6 +154,25 @@ void DocumentMedia::setThumbnail(QImage thumbnail) {
_owner->session().downloaderTaskFinished().notify();
}
QByteArray DocumentMedia::videoThumbnailContent() const {
return _videoThumbnailBytes;
}
QSize DocumentMedia::videoThumbnailSize() const {
const auto &location = _owner->videoThumbnailLocation();
return { location.width(), location.height() };
}
void DocumentMedia::videoThumbnailWanted(Data::FileOrigin origin) {
if (_videoThumbnailBytes.isEmpty()) {
_owner->loadVideoThumbnail(origin);
}
}
void DocumentMedia::setVideoThumbnail(QByteArray content) {
_videoThumbnailBytes = std::move(content);
}
void DocumentMedia::checkStickerLarge() {
if (_sticker) {
return;