Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69101

QMultimedia cannot play QBuffer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.11.1, 5.13.0
    • Multimedia
    • None
    • Android, iOS/tvOS/watchOS, macOS

      OSX 10.13.5

      Android 6

      IOS 11

      QT 5.11.1

       

      I am loading a base64 encoded mp3 into a QBuffer. Then attempt to play it using a QMediaPlayer object. This sample code plays fine on Windows10 but does not output any song.

      The code works if I replace the QBuffer by a QFile with the extension .mp3

      It seems that playing a sound from a QBuffer is not implemented on OSX, Android and IOS. This breaks the expectation that a QT code should be running on any platform.

      buffer.open(QIODevice::ReadWrite); buffer.write(QByteArray::fromBase64(QJsonDocument::fromJson(reply->readAll()) .object()["audioContent"].toString().toUtf8()));

      buffer.seek(0);

      player.setMedia(QMediaContent(),&buffer);

      player.play();

        1. QtAndroidMediaPlayer.java
          0.5 kB
        2. speaker.mm
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            valentyn.doroshchuk Valentyn Doroshchuk
            reg31 Regis Duflaut
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There is 1 open Gerrit change