Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [qt5] QMediaPlayer - i can`t get metaData :/

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

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 6.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    superbobnoob
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      superbobnoob
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tirkedi
        wrote on last edited by
        #3

        I got the same issue! Bug in windows version?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aa13q
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aa13q
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Tirkedi
              wrote on last edited by
              #6

              Bugfix in next Qt5.2 release

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved