2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

ClipReader was moved to a separate namespace and different files.

This commit is contained in:
John Preston
2016-06-24 13:37:29 +03:00
parent 8fc38d9ac2
commit d64892584d
24 changed files with 1877 additions and 1503 deletions

View File

@@ -947,9 +947,10 @@ void DocumentOpenClickHandler::doOpen(DocumentData *data, ActionOnLoad action) {
}
bool playVoice = data->voice() && audioPlayer();
bool playMusic = data->song() && audioPlayer();
bool playVideo = data->isVideo() && audioPlayer();
bool playAnimation = data->isAnimation() && item && item->getMedia();
const FileLocation &location(data->location(true));
if (!location.isEmpty() || (!data->data().isEmpty() && (playVoice || playMusic || playAnimation))) {
if (!location.isEmpty() || (!data->data().isEmpty() && (playVoice || playMusic || playVideo || playAnimation))) {
if (playVoice) {
AudioMsgId playing;
AudioPlayerState playingState = AudioPlayerStopped;
@@ -975,6 +976,16 @@ void DocumentOpenClickHandler::doOpen(DocumentData *data, ActionOnLoad action) {
audioPlayer()->play(song);
if (App::main()) App::main()->documentPlayProgress(song);
}
} else if (playVideo) {
if (!data->data().isEmpty()) {
App::wnd()->showDocument(data, item);
} else if (location.accessEnable()) {
App::wnd()->showDocument(data, item);
location.accessDisable();
} else {
psOpenFile(location.name());
}
if (App::main()) App::main()->mediaMarkRead(data);
} else if (data->voice() || data->isVideo()) {
psOpenFile(location.name());
if (App::main()) App::main()->mediaMarkRead(data);