Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. mp3 via QMediaPlayer on Androis based XPeria Z2
Forum Updated to NodeBB v4.3 + New Features

mp3 via QMediaPlayer on Androis based XPeria Z2

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 573 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.
  • Flaming MoeF Offline
    Flaming MoeF Offline
    Flaming Moe
    wrote on last edited by
    #1

    Hello there,

    i try to play a mp3 on an Android based XPeria Z2.
    Code is very simple

    #include "mainwindow.h"
    #include <QApplication>
    #include <QMediaPlayer>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;

    QMediaPlayer* player = new QMediaPlayer;
    // ...
    //player->setMedia(QUrl::fromLocalFile("C:/WithASpirit.mp3"));
    player->setMedia(QUrl::fromLocalFile("Music/Adiemus.mp3"));
    player->setVolume(100);
    player->play();
    
    w.show();
    
    return a.exec();
    

    }

    On Desktop Win7 PC is works fine.
    When deploying it to the Smartphone i get a

    E/MediaPlayer-JNI(11261): QCMediaPlayer mediaplayer NOT present
    D/Qt MediaPlayer(11261): null

    note. I guess it relates to the documentation saying
    "The compressed audio formats supported does depend on the operating system environment, and also what media plugins the user may have installed."

    I´m not deep enough in the material to figure out my self what to do.
    Has someone a hint?

    best regards!!

    A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

    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