Qt 6.11 is out! See what's new in the release
blog
Qml video metaData returns undefined values
-
hi guys
lets take a look at this codeVideo { id: video anchors.fill: parent autoPlay: true source: vidPath !== "" ? ("file:" + vidPath) : "" focus: true loops: MediaPlayer.Infinite MouseArea{ anchors.fill: parent hoverEnabled: true onEntered: { console.log(video.metaData.videoBitRate) console.log(video.metaData.size) console.log(video.metaData.videoFrameRate) console.log(video.metaData.duration) } } }the problem that i have no idea to figure out is all console.log print undefined
any help will be appreciate -
Hello,
Though it's a later response, you can try:console.log(video.metaData.value(key)).
The key is a fixed number which indicates the metaData keys,like:
video.metaData.value(0) //title
video.metaData.value(0) //duration
etc.When you load a media, the keys will be in array but in random order, you can run
console.log(video.metaData.keys())
to get the keys first.I'm not a programmer, so I'm not so surre about if it's the best way to read the MetaData, but it works on Qt6.10