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

QML Audio refuses to play repeatedly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.4.2, 5.5.1
    • Fix Version/s: None
    • Component/s: Multimedia
    • Labels:
      None
    • Environment:
      Ubuntu desktop, gcc, 64-bit

      Description

      In the following example the sound is played only when I click Play button for the first time. Subsequent clicks have no effect.

      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.4
      import QtMultimedia 5.5
      
      Window {
          visible: true
      
          Column {
              anchors.centerIn: parent
              Button {
                  text: "Play"
                  onClicked:
                      audio.play()
              }
              Button {
                  text: "Stop"
                  onClicked:
                      audio.stop()
              }
          }
          Audio {
              id: audio
              source: "success.ogg"
              onError: {
                  console.log("error: " + error)
              }
              onStatusChanged:
                  console.log("status: " + status)
          }
      }
      

      I already tried:

      • to set loops property to 3, but the media is still played just once
      • MediaPlayer instead of Audio element
      • to click Stop button after the music finishes and then again Play
      • to load the audio file from resources

      No error message is printed.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            valentyn.doroshchuk Valentyn Doroshchuk
            Reporter:
            ondrejandrej Andrej Repisky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes