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

Use full volume for video messages.

Set video volume to VideoVolume in MediaView and to 1 in HistoryGif.
This commit is contained in:
John Preston
2017-04-15 22:51:53 +03:00
parent 0ff299758a
commit 7312114b75
5 changed files with 30 additions and 2 deletions

View File

@@ -229,6 +229,8 @@ bool MediaView::gifShown() const {
auto rounding = (_doc && _doc->isRoundVideo()) ? ImageRoundRadius::Ellipse : ImageRoundRadius::None;
_gif->start(_gif->width() / cIntRetinaFactor(), _gif->height() / cIntRetinaFactor(), _gif->width() / cIntRetinaFactor(), _gif->height() / cIntRetinaFactor(), rounding, ImageRoundCorner::All);
const_cast<MediaView*>(this)->_current = QPixmap();
updateMixerVideoVolume();
Global::RefVideoVolumeChanged().notify();
}
return true;// _gif->state() != Media::Clip::State::Error;
}
@@ -647,6 +649,12 @@ void MediaView::showSaveMsgFile() {
File::ShowInFolder(_saveMsgFilename);
}
void MediaView::updateMixerVideoVolume() const {
if (_doc && (_doc->isVideo() || _doc->isRoundVideo())) {
Media::Player::mixer()->setVideoVolume(Global::VideoVolume());
}
}
void MediaView::close() {
if (_menu) _menu->hideMenu(true);
if (App::wnd()) {
@@ -1571,6 +1579,7 @@ void MediaView::onVideoSeekFinished(TimeMs positionMs) {
void MediaView::onVideoVolumeChanged(float64 volume) {
Global::SetVideoVolume(volume);
updateMixerVideoVolume();
Global::RefVideoVolumeChanged().notify();
}