'Streaming using pyqt5
I've tried using the pyqt web engine to log into discord.com, everything works fine, but when I try screen sharing, this error is seen:
"Uncaught (in promise) notallowederror: invalid state".
it looks like a JS error, I am not sure how I would solve a js error in pyqt5
def class_runner():
class WebEnginePage(QWebEnginePage):
def __init__(self, *args, **kwargs):
QWebEnginePage.__init__(self, *args, **kwargs)
self.featurePermissionRequested.connect(self.onFeaturePermissionRequested)
def onFeaturePermissionRequested(self, url, feature):
if feature in (QWebEnginePage.MediaAudioCapture,
QWebEnginePage.MediaVideoCapture,
QWebEnginePage.MediaAudioVideoCapture):
self.setFeaturePermission(url, feature, QWebEnginePage.PermissionGrantedByUser)
else:
self.setFeaturePermission(url, feature, QWebEnginePage.PermissionDeniedByUser)
app = QApplication(sys.argv)
app.setApplicationName("Discord Lite")
view = QWebEngineView()
page = WebEnginePage()
view.setPage(page)
view.load(QUrl("https://discord.com/app"))
view.show()
scriptDir = os.path.dirname(os.path.realpath(__file__))
app.setWindowIcon(QIcon(scriptDir + os.path.sep + 'logo4.png'))
app.exec_()
class_runner()
This is the python code.
I tried looking up other sites and the closest I came to was this
GitHub.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
