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. Unpredictable behaviour by QMediaPlayer when trying to mute the volume!
Forum Updated to NodeBB v4.3 + New Features

Unpredictable behaviour by QMediaPlayer when trying to mute the volume!

Scheduled Pinned Locked Moved Unsolved General and Desktop
qmediaplayer
2 Posts 2 Posters 903 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.
  • F Offline
    F Offline
    faisal.tum
    wrote on last edited by faisal.tum
    #1
    for(int i = 0; i<videoPlaylist.size(); i++)
    {
            videoPlayer->setMedia(QUrl::fromLocalFile(videoPlaylist.at(i)));
            videoPlayer->setMuted(true);
            videoPlayer->play();
            videoPlayer->setVolume(0);
            videoWidget->showFullScreen();
            while (videoPlayer->state() == QMediaPlayer::PlayingState)
            {
                 QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
            }
    }
    
    

    So I have this for loop where I iterate through each QString from the QStringList and put the file name to the pointer to the object of QMediaPlayer as the media. Then I play the file as and try to mute the volume using two different attempts. Yet, in some videos there is no sound, while in others there is a sound. Why is such unpredictable nature? The videos are .mp4. Does it have to do anything with the codec? FYI, I tried to use setVolume() and setMuted() individually as well, but even then the unpredictability persists. The program is running on Ubuntu 14.04.

    Thanks.

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

      This is happening to random videos or same videos for everytime?

      Perhaps you can try this in a different OS (Windows may be) to see if this is a platform specific issue.

      1 Reply Last reply
      0

      • Login

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