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. QMediaPlayer Android Gives NoMedia
Forum Updated to NodeBB v4.3 + New Features

QMediaPlayer Android Gives NoMedia

Scheduled Pinned Locked Moved Mobile and Embedded
1 Posts 1 Posters 1.0k 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.
  • C Offline
    C Offline
    carlinski
    wrote on last edited by
    #1

    Hello,

    Ubuntu 12.04, Qt5.2.1, Android

    @
    QVideoWidget* ptr_videoWidget = new QVideoWidget(this);

    this->setCentralWidget(ptr_videoWidget);
    
    QMediaPlayer* player = new QMediaPlayer(ptr_videoWidget);
    player->setVideoOutput(ptr_videoWidget);
    
    QFile file("/storage/extSdCard/test1.mp4");
    if(!file.open(QIODevice::ReadOnly))
        qDebug() << "file not found";
    
    player->setMedia( QUrl::fromLocalFile&#40;QFileInfo(file&#41;.absoluteFilePath()));
    player->play();
    qDebug() << "mediasStatus=" << player->mediaStatus();
    

    @

    Get this back:

    mediasStatus= QMediaPlayer::NoMedia

    File exists (however it is on an sd card, would that make a difference?)

    I do all this in the initialisation of the MainWindow.

    Working on the desktop it works fine, a video displays (change path obviously).

    I found another post on here where somebody had same problem, and they used Ministro to install. I have tried it that way also.

    Thankyou, Carl

    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