I have modified the Qt Media Player Example, trying to get QMediaGaplessPlaybackControl for a crossfade effect.
Here is my code:
auto service = m_player->service();
auto cc = service->requestControl("org.qt-project.qt.mediaplayercontrol/5.0");
Q_ASSERT(cc != nullptr);
QMessageBox::information(this, "", cc->metaObject()->className());
QMediaGaplessPlaybackControl* control = qobject_cast<QMediaGaplessPlaybackControl*>(cc);
Q_ASSERT(control != nullptr);
The problem is, that when I request the control, a nullptr
is returned. Does anyone know why?
I'm using Qt 5.11 on Windows with MSVC compiler.