Reputation: 1978
I need to store the full path of current playing audio in QMediaPlayer
in a QString
Variable. I need this to get metadata using taglib
library which require file path of the media.
Upvotes: 1
Views: 1759
Reputation: 4620
Take a look at the docs.
You can do it by calling
mediaplayer.currentMedia().canonicalUrl().toString()
Upvotes: 3
Reputation: 2339
Using:
http://doc.qt.io/qt-5/qmediaplayer.html#media-prop,
http://doc.qt.io/qt-5/qmediacontent.html#resources,
http://doc.qt.io/qt-5/qmediaresource.html#url and
http://doc.qt.io/qt-5/qurl.html#path
you can use mediaPlayer->media.resources.first().url().path()
.
Upvotes: 0