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

QMultimedia cannot play QBuffer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.11.1, 5.13.0
    • Multimedia
    • None
    • 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

              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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change