diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-03-21 01:32:31 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-03-21 01:32:31 +0100 |
commit | 3aeeed49a9f3c18fa59dedd15100711c68552c9d (patch) | |
tree | c0db8e0a7cd0ae7d15b648ace23ceb8cc4d9896f | |
parent | Thumbnail video (diff) | |
download | nheko-3aeeed49a9f3c18fa59dedd15100711c68552c9d.tar.xz |
Also stop audio player
-rw-r--r-- | src/timeline/InputBar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index 61c807cf..a2228541 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -850,11 +850,15 @@ MediaUpload::MediaUpload(std::unique_ptr<QIODevice> source_, } }); connect(mediaPlayer, &QMediaPlayer::durationChanged, [this, mediaPlayer](qint64 duration) { - if (duration > 0) + if (duration > 0) { this->duration_ = mediaPlayer->duration(); + if (mimeClass_ == u"audio") + mediaPlayer->stop(); + } nhlog::ui()->debug("Duration changed {}", duration); }); mediaPlayer->setMedia(QMediaContent(originalFilename_), source.get()); + mediaPlayer->play(); } } |