mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Also stop audio player
This commit is contained in:
parent
3beed3508a
commit
3aeeed49a9
1 changed files with 5 additions and 1 deletions
|
@ -850,11 +850,15 @@ MediaUpload::MediaUpload(std::unique_ptr<QIODevice> source_,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(mediaPlayer, &QMediaPlayer::durationChanged, [this, mediaPlayer](qint64 duration) {
|
connect(mediaPlayer, &QMediaPlayer::durationChanged, [this, mediaPlayer](qint64 duration) {
|
||||||
if (duration > 0)
|
if (duration > 0) {
|
||||||
this->duration_ = mediaPlayer->duration();
|
this->duration_ = mediaPlayer->duration();
|
||||||
|
if (mimeClass_ == u"audio")
|
||||||
|
mediaPlayer->stop();
|
||||||
|
}
|
||||||
nhlog::ui()->debug("Duration changed {}", duration);
|
nhlog::ui()->debug("Duration changed {}", duration);
|
||||||
});
|
});
|
||||||
mediaPlayer->setMedia(QMediaContent(originalFilename_), source.get());
|
mediaPlayer->setMedia(QMediaContent(originalFilename_), source.get());
|
||||||
|
|
||||||
mediaPlayer->play();
|
mediaPlayer->play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue