Recover after a streaming error.
This commit is contained in:
parent
2e2aed5002
commit
dd9e317257
|
@ -62,12 +62,17 @@ Document::Document(
|
|||
, _radial(
|
||||
[=] { waitingCallback(); },
|
||||
st::defaultInfiniteRadialAnimation) {
|
||||
_player.updates(
|
||||
resubscribe();
|
||||
}
|
||||
|
||||
void Document::resubscribe() {
|
||||
_subscription = _player.updates(
|
||||
) | rpl::start_with_next_error([=](Update &&update) {
|
||||
handleUpdate(std::move(update));
|
||||
}, [=](Streaming::Error &&error) {
|
||||
handleError(std::move(error));
|
||||
}, _player.lifetime());
|
||||
resubscribe();
|
||||
});
|
||||
}
|
||||
|
||||
Player &Document::player() {
|
||||
|
|
|
@ -62,12 +62,15 @@ private:
|
|||
void waitingChange(bool waiting);
|
||||
|
||||
void validateGoodThumbnail();
|
||||
void resubscribe();
|
||||
|
||||
DocumentData *_document = nullptr;
|
||||
PhotoData *_photo = nullptr;
|
||||
Player _player;
|
||||
Information _info;
|
||||
|
||||
rpl::lifetime _subscription;
|
||||
|
||||
bool _waiting = false;
|
||||
mutable Ui::InfiniteRadialAnimation _radial;
|
||||
Ui::Animations::Simple _fading;
|
||||
|
|
Loading…
Reference in New Issue