QMediaPlayer isn't defined. Python.
Solved
General and Desktop
-
Hi, everybody.
I'm trying to use PySide2 with Python. Accordring to this page there should be QMediaPlayer class:
https://doc.qt.io/qtforpython/PySide2/QtMultimedia/QMediaPlayer.htmlBut when I'm trying to instantiate it:
import PySide2
player = QMediaPlayerTraceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'QMediaPlayer' is not defined -
Hi Mr.S, "new" is missing before QMediaPlayer to create your object player .
-
There is no "new" operator in Python. To create object it should be done as I did. Those examples at the link are for C++ obviously, though the page purposed for Python.
And if somebody know where to send a notice about this... so they would fix the page.