Important: Please read the Qt Code of Conduct -

[Solved] Qt 5 multimedia : how to check if media has video ?

  • 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.


  • I had just to wait the media status be QMediaPlayer::LoadedMedia (instead of QMediaPlayer::LoadingMedia) and then test the video availability with QMediaPlayer::isVideoAvailable().

Log in to reply