'How to Mute Sound in QWebEngineView PyQt5 Python

Problem

I Want to Mute all sound QWebEngineView on Button click. And Also UnMute all Sound on another Button Click. I searched a lot on the internet but no one asked this type of Questions.

Code

from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings
from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton
import sys


class Main(QWidget):
    def __init__(self):
        super(Main, self).__init__()
        self.vbox=QVBoxLayout()
        self.mutebtn=QPushButton('Mute this WebPage')
        self.mutebtn.clicked.connect(self.mutebrowser)
        self.vbox.addWidget(self.mutebtn)
        self.unmutebtn=QPushButton('UnMute this WebPage')
        self.unmutebtn.clicked.connect(self.unmutebrowser)
        self.vbox.addWidget(self.unmutebtn)
        self.browser=QWebEngineView()
        self.browser.setUrl(QUrl('https://youtu.be/B-wmrlzdK3k'))
        self.vbox.addWidget(self.browser)
        self.setMinimumSize(400,500)
        self.setLayout(self.vbox)

    def mutebrowser(self):
        # Code to Mute Sound in "self.browser"
        pass

    def unmutebrowser(self):
        # Code to UnMute Sound in "self.browser"
        pass

if __name__ == '__main__':
    app=QApplication(sys.argv)
    win=Main()
    win.show()
    sys.exit(app.exec_())


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source