Unpredictable behaviour by QMediaPlayer when trying to mute the volume!



  • 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.



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.