[qt5] QMediaPlayer - i can`t get metaData :/



  • Hi
    I try to get the meta data of music file (i try different files and udio formats mp3 wav etc) all files are good becaouse other players shows meta data :C
    I try it on different ways but no one method work :/
    my code:
    @testPlayer = new QMediaPlayer;
    playList = new QMediaPlaylist;

    testPlayer->setVolume(50);
    

    // testPlayer->setMedia(QUrl::fromLocalFile("test2.mp3")); // try without playlist -> dont work :C
    playList->addMedia(QUrl::fromLocalFile("test2.mp3"));
    testPlayer->setPlaylist(playList);
    playList->setCurrentIndex(0);
    qDebug() << "Test: " << testPlayer->metaData(QMediaMetaData::Title);

    connect(testPlayer, SIGNAL(metaDataChanged()), this, SLOT(stc()));
    
    stc();@
    

    @void MainWindow::stc()
    {
    qDebug() << testPlayer->isMetaDataAvailable();
    if(testPlayer->isMetaDataAvailable())
    {
    qDebug() << testPlayer->metaData(QMediaMetaData::Duration);
    }
    }@

    and i always get result data

    bq. Test: QVariant(Invalid)
    false
    false
    false
    false

    what i do wrong :C ?
    please help



  • Can just someone test my code i write result please :(



  • I got the same issue! Bug in windows version?



  • Similar issues in my windows 7 and 8 (qt 5.0.2, mingw), but no problems with linux (qt 5.0.2)



  • Update: Qt 5.0.2 for Windows 64-bit (VS 2012) and VS Express 2012 -- seems fine on Windows 8



  • Bugfix in next Qt5.2 release


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.