Hi i have simple script that run a URL, reason im using python is because the URL require chromium and i do not like chromium browsers so i opt to use python
This is the script,
import os
import sys
from PyQt6.QtCore import QUrl
from PyQt6.QtWidgets import QApplication
from PyQt6.QtWebEngineWidgets import QWebEngineView
from PyQt6.QtWebEngineCore import QWebEnginePage
# chromium flags, GL/desktop failure, angle preference, do remember to check on the chromium flags and nvidia flags, if GBM still fail stay with vulkan in meantime, idk what cause "js fail" < #511 on obsidian write.
os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = "--no-sandbox --enable-features=WebRTC-PipeWire-Capturer"
# configuration
APP_URL = "http://localhost:18888/"
APP_TITLE = "Viris Decoda"
WINDOW_SIZE = (1280, 800)
# per mission logic
class WebEnginePage(QWebEnginePage):
def featurePermissionRequested(self, url, feature):
# Grant permission for microphone
if feature == QWebEnginePage.Feature.MediaAudioCapture:
self.setFeaturePermission(
url, feature, QWebEnginePage.PermissionPolicy.PermissionGrantedByUser
)
# grant permission for audio playback
elif feature == QWebEnginePage.Feature.MediaAudioPlay:
self.setFeaturePermission(
url, feature, QWebEnginePage.PermissionPolicy.PermissionGrantedByUser
)
else:
self.setFeaturePermission(
url, feature, QWebEnginePage.PermissionPolicy.PermissionDeniedByUser
)
# MAIN APPLICATION (DO NOT FORGET THE ICON)
if __name__ == "__main__":
app = QApplication(sys.argv)
web_view = QWebEngineView()
page = WebEnginePage(web_view)
web_view.setPage(page)
web_view.load(QUrl(APP_URL))
web_view.setWindowTitle(APP_TITLE)
web_view.resize(WINDOW_SIZE[0], WINDOW_SIZE[1])
web_view.show()
sys.exit(app.exec())
I have checked the URL, and it detects my microphone and speaker when I open it in a browser, but not when I run it through the Python script.
Hereβs more information about my setup:
I use an NVIDIA GPU.
Iβm on Arch Linux with KDE Plasma.
The last log I get when opening the Python script is:
GBM is not supported with the current configuration. Fallback to Vulkan rendering in Chromium.
pci id for fd 80: 10de:2504, driver (null)
pci id for fd 82: 10de:2504, driver (null)
libEGL warning: pci id for fd 80: 10de:2504, driver (null)
pci id for fd 69: 10de:2504, driver (null)
pci id for fd 82: 10de:2504, driver (null)
libEGL warning: egl: failed to create dri2 screen
pci id for fd 80: 10de:2504, driver (null)
pci id for fd 82: 10de:2504, driver (null)
libEGL warning: egl: failed to create dri2 screen
js: [CVV] is not ready for set audio output.
js: [CVV] is not ready for set audio output.
js: [useWebInfo] clientState is not initialized yet
js: [useWebInfo] this is not web edition