qt


Qt get file path of current playing media?


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.
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().
Take a look at the docs.
You can do it by calling
mediaplayer.currentMedia().canonicalUrl().toString()

Related Links

How to clip left side of column cell when resizing a pyqt tableview
Opening a chm file containing merged files in a Qt application
Unable to build Qt 5.0 on Solaris 10
How to get list of visible QModelIndex in QAbstractItemView
Qt: Run a script BEFORE make
Qt 5: Debug\release and Release\debug directories
Xlib: unexpected async reply when testing Qt application from a separate QThread within same Qt application
Getting a signal to a QListView when its populated by QComboBoxes
Qt Subclassing and “No matching function for call to connect”
How to solve undefined reference errors when linking log4cxx in qmake project
In QT,how to distinguish debug and relase in someway like preprocessor
Sort a QAbstractListModel derived model by role in QML ListView
Compiling in Qt Creator on OS X: “dyld: Library not loaded”
Rotating a QGraphicsPixmapItem results in extremly low quality texture
QRubberBand on a definite label
Regular Expression with no LookBehind feature

Categories

HOME
elasticsearch
powerbi
opencart
yaml
focus
android-fragments
workflow
softlayer
redmine
tcsh
odata
android-emulator
celery
biztalk-2010
sympy
polymer-2.x
mutation-testing
circleci
smooks
reselect
google-cloud-logging
rest-assured
jqxgrid
gravity
parceler
web-analytics
multi-upload
websphere-portal
pdf.js
raima
tortoisemerge
echosign
ibm-connections
source-insight
steam-web-api
memory-fences
fotorama
appcode
sql-execution-plan
kendo-listview
buildforge
cargo
klee
web-inspector
jqgrid-asp.net
asihttprequest
vesta
gcal
rightnow-crm
viewmodel
windows-media-player
image-registration
beeline
spring.net
android-webservice
simple-schema
asp.net-web-api-routing
mobile-angular-ui
polymaps
swiperefreshlayout
hmmlearn
email-injection
e
fuzzer
svnserve
node.js-connect
ajaxmin
powerpoint-2013
apache-pig-grunt
rails-engines
sharepoint-apps
mathnet
taco
android-mapview
dsa
cfwheels
embeddedwebserver
artisan
com0com
prism-4
mojo
jquery-mobile-flipswitch
coding-efficiency
csslint
stripe.net
neo4jphp
usb-flash-drive
progress-db
discovery
tnt4j
flv
rikulo
dibs
days
android-authenticator
itunes-sdk
session-0-isolation
multiscaleimage
spark-view-engine
stretch
audiotoolbox
instance-variables
exponent
yuidoc
data-dump
rtd
servlet-container
jdownloader
outlook-2007-addin
stretchblt
acceleration
error-detection
synthesizer

Resources

Encrypt Message