Qt 6.12 LTS is out! See what's new in the release
blog
[Solved] Qt 5 multimedia : how to check if media has video ?
General and Desktop
2
Posts
1
Posters
1.3k
Views
1
Watching
-
Hi,
As said in the title, how can i know if loaded media with QMediaPlayer is a simple audio file or a video file (without testing the extension file) ? More exactly, i'm looking for the equivalent for Phonon::MediaObject::hasVideo() method !
I'm using Qt 5.2.Thanks.
-
I had just to wait the media status be QMediaPlayer::LoadedMedia (instead of QMediaPlayer::LoadingMedia) and then test the video availability with QMediaPlayer::isVideoAvailable().