2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use Streaming::Player in video messages playback.

This commit is contained in:
John Preston
2019-03-26 12:54:51 +04:00
parent 8aaa70a05a
commit 3bd1bbc77a
20 changed files with 255 additions and 499 deletions

View File

@@ -750,13 +750,18 @@ bool Player::active() const {
}
bool Player::ready() const {
return (_stage != Stage::Uninitialized) && (_stage != Stage::Initializing);
return (_stage != Stage::Uninitialized)
&& (_stage != Stage::Initializing);
}
rpl::producer<Update, Error> Player::updates() const {
return _updates.events();
}
QSize Player::videoSize() const {
return _information.video.size;
}
QImage Player::frame(const FrameRequest &request) const {
Expects(_video != nullptr);
@@ -775,6 +780,8 @@ Media::Player::TrackState Player::prepareLegacyState() const {
? State::StoppedAtError
: finished()
? State::StoppedAtEnd
: (_stage == Stage::Uninitialized)
? State::Stopped
: paused()
? State::Paused
: State::Playing;