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

QMultimedia cannot play QBuffer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.1, 5.13.0
    • Fix Version/s: None
    • Component/s: Multimedia
    • Labels:
      None
    • Platform/s:
      Android, iOS/tvOS/watchOS, macOS

      Description

      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();

        Attachments

        1. QtAndroidMediaPlayer.java
          0.5 kB
        2. speaker.mm
          0.6 kB

          Issue Links

          For Gerrit Dashboard: QTBUG-69101
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              valentyn.doroshchuk Valentyn Doroshchuk
              Reporter:
              reg31 Regis Duflaut
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There is 1 open Gerrit change