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. Qt5 QML Video and MediaPlayer Share Audio?
Forum Update on Monday, May 27th 2025

Qt5 QML Video and MediaPlayer Share Audio?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.4k Views
  • 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.
  • G Offline
    G Offline
    Gilgrum
    wrote on last edited by
    #1

    I have found the audio that plays on the Video element and audio that is played by MediaPlayer appear to be sharing properties, as if this audio is statically shared across both element types (at least on Windows 7). As an example, the following QML file does not behave as expected:

    @import QtQuick 2.0
    import QtMultimedia 5.0

    Rectangle {
    width: 360
    height: 360

    Video
    {
        id: video
        volume: 0.1
        source: "yoursamplevideo.wmv"
        anchors.fill: parent
    }
    
    MediaPlayer
    {
        id: sound
        source: "yoursamplesound.mp3"
        volume: 1.0
    }
    
    
    MouseArea {
        anchors.fill: parent
        onClicked: sound.muted = !sound.muted
    }
    
    Component.onCompleted:  {
        video.play()
        sound.play()
    }
    

    }@

    In the above example you would expect to mute ONLY the second audio channel by clicking, but instead both audio gets muted / unmuted AND ONLY SOME OF THE TIME (across multiple program executions). Also, Video and MediaPlayer have different volume levels specified but will play at the same volume level.

    Is this something that is only happening on my end, is it a bug in Qt5, or is this intended behavior?

    1 Reply Last reply
    1
    • A Offline
      A Offline
      aykutb
      wrote on last edited by
      #2

      Is there any progress on that? I have the same problem..

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved