Use SharedMediaMergedViewer() for audio player.

That way audio files and voice/video messages will play in context
(one after another with ability to go to next or previous in player)
almost always, no matter at what part of message history we are.
This commit is contained in:
John Preston
2017-12-09 14:02:51 +04:00
parent 9bbcbd4bb3
commit 4e2c8bbc26
8 changed files with 207 additions and 60 deletions
+3 -3
View File
@@ -2316,12 +2316,12 @@ void MediaView::setContext(base::optional_variant<
_user = _peer ? _peer->asUser() : nullptr;
}
bool MediaView::moveToNext(int32 delta) {
bool MediaView::moveToNext(int delta) {
if (!_index) {
return false;
}
auto newIndex = *_index + delta;
auto entity = entityByIndex(*_index + delta);
auto entity = entityByIndex(newIndex);
if (!entity.data && !entity.item) {
return false;
}
@@ -2345,7 +2345,7 @@ bool MediaView::moveToNext(int32 delta) {
return true;
}
void MediaView::preloadData(int32 delta) {
void MediaView::preloadData(int delta) {
if (!_index) {
return;
}