AttributeError: type object 'QMediaPlayer' has no attribute 'Media'

Traceback (most recent call last):
File “filename.py”, line 32, in play_video
media = QMediaPlayer.Media(QMediaContent(video_url))
AttributeError: type object ‘QMediaPlayer’ has no attribute ‘Media’.

Getting this error when try to use the QMediaContent in QMediaPlayer.
i m using PyQt6, which i installed and uninstalled lot of time. cleared cache and all. but of no use.
Please somebody help.

Qt uses attributes name which start with lowercase, so the correct name here would be .media(). If the name contains multiple words, the second word on will be capitablized, e.g. setMedia().