diff options
-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(); } } |