Issue
I can load the webplayer just fine I have set the path for widevinecdm. But when I try to play any song on spotify,
import sys
import os
from PySide2.Qt import *
from PySide2.QtCore import QUrl
from PySide2.QtWebEngineWidgets import *
from PySide2.QtWidgets import QApplication
app = QApplication(sys.argv)
web = QWebEngineView()
web.load(QUrl("https://open.spotify.com/"))
web.show()
sys.exit(app.exec_())
I get this error:
js: Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('audio/mp4; codecs="mp4a.40.2"') is unsupported.
However, Youtube works fine.
How can I add mp4a
codec into the webengine? Chromium can play spotify too.
Is there a flag I can set? I couldn't find if there is.
Solution
Chances are that your build of WebEngine is not including that codec. WebEngine can include/exclude proprietary codecs at build-time with the -webengine-proprietary-codecs. According to https://doc.qt.io/qt-6/qtwebengine-features.html#audio-and-video-codecs:
Qt WebEngine supports the MPEG-4 Part 14 (MP4) file format only if the required proprietary audio and video codecs, such as H.264 and MPEG layer-3 (MP3), have been enabled.
So you may try to rebuild WebEngine with that option and then rebuild pyqtwebengine with the new Qt build.
Answered By - Luca Carlon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.