MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / loadVideo

Method loadVideo

Telegram/SourceFiles/data/data_photo.cpp:536–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536void PhotoData::loadVideo(Data::PhotoSize size, Data::FileOrigin origin) {
537 if (!_videoSizes) {
538 return;
539 }
540 const auto autoLoading = false;
541 const auto finalCheck = [=] {
542 if (const auto active = activeMediaView()) {
543 return active->videoContent(size).isEmpty();
544 }
545 return true;
546 };
547 const auto done = [=](QByteArray result) {
548 if (const auto active = activeMediaView()) {
549 active->setVideo(size, std::move(result));
550 }
551 };
552 Data::LoadCloudFile(
553 &session(),
554 videoFile(size),
555 origin,
556 LoadFromCloudOrLocal,
557 autoLoading,
558 Data::kAnimationCacheTag,
559 finalCheck,
560 done);
561}
562
563const ImageLocation &PhotoData::videoLocation(Data::PhotoSize size) const {
564 static const auto empty = ImageLocation();

Callers 3

saveAsMethod · 0.80
downloadMediaMethod · 0.80
videoWantedMethod · 0.80

Calls 4

LoadCloudFileFunction · 0.85
videoContentMethod · 0.80
isEmptyMethod · 0.45
setVideoMethod · 0.45

Tested by

no test coverage detected