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

QMediaPlayer + QIODevice

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.3k 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
    CarryGun
    wrote on last edited by
    #1

    Hello everyone.

    I have a problem trying to use QMediaPlayer with QIODevice. I want to play audio from URL and know audio downloaded progress. So I decided to use QNetworkReply as QIODevice. But it didn't work. I don't know when I should call setMedia(). I tried to call it after QNetworkAccessManager's method get(), after first QNetworkReply's signal readyRead() and after finished() and no results. So i need some help. Is it possible to use QNetworkReply as QIODevice with QMediaPlayer? How? There is nothing about QIODevice in QMediaPlayer docs.


    For example I've tried to use QFile and it works fine:
    @
    mf = new QFile("test.mp3");
    mf->open(QIODevice::ReadOnly);
    m_mediaPlayer->setMedia(QMediaContent(), mf);
    m_mediaPlayer->setVolume(50);
    m_mediaPlayer->play();
    @

    0xc0de1e55

    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