Qt6 Replacement for QMediaPlayer::hasSupport()
-
QMediaPlayer::hasSupport() has been removed in Qt6 and the Qt5 docs make no mention of its obsolescence or a suggested replacement. How can I replicate this functionality in Qt6?
I searched the following doc pages:
https://doc.qt.io/qt-5/qmediaplayer-obsolete.html
https://doc.qt.io/qt-5/qmediaplayer.html -
@flatland3r It certainly would be helpful to hear an answer on this from the Qt team.
I can only speak for myself and say what I would do if I were "in dire straights" and forced to get something working in a way that replicated Qt5 functionality.
Assuming I only really needed 1 or 2 lower-level media backends, I would look at what Qt5 was actually doing, and base my new approach on that.
It seems that Qt5 (as I would have expected) is querying lower-level media platform libraries to see what those libraries report as supported.
Some examples:
- https://github.com/qt/qtmultimedia/blob/5.15/src/gsttools/qgstutils.cpp#L805
- https://github.com/qt/qtmultimedia/blob/5.15/src/plugins/avfoundation/mediaplayer/avfmediaplayerserviceplugin.mm#L94
I am not suggesting that anyone copy-and-paste. Consult licensing restrictions. I am only suggesting to become aware of what the lower-level platform media libraries provide in terms of querying support of different media types.
-
Hi,
To add to @KH-219Design, since 6.5, the default backend has been set to ffmpeg.