| 588 | } |
| 589 | |
| 590 | auto PhotoData::createStreamingLoader( |
| 591 | Data::FileOrigin origin, |
| 592 | bool forceRemoteLoader) const |
| 593 | -> std::unique_ptr<Media::Streaming::Loader> { |
| 594 | if (!hasVideo()) { |
| 595 | return nullptr; |
| 596 | } |
| 597 | constexpr auto large = PhotoSize::Large; |
| 598 | if (!forceRemoteLoader) { |
| 599 | const auto media = activeMediaView(); |
| 600 | const auto bytes = media ? media->videoContent(large) : QByteArray(); |
| 601 | if (media && !bytes.isEmpty()) { |
| 602 | return Media::Streaming::MakeBytesLoader(bytes); |
| 603 | } |
| 604 | } |
| 605 | return v::is<StorageFileLocation>(videoLocation(large).file().data) |
| 606 | ? std::make_unique<Media::Streaming::LoaderMtproto>( |
| 607 | &session().downloader(), |
| 608 | v::get<StorageFileLocation>(videoLocation(large).file().data), |
| 609 | videoByteSize(large), |
| 610 | origin) |
| 611 | : nullptr; |
| 612 | } |
no test coverage detected