Qt Android MediaPlayer NoMEdia
I have the strange situation that on any Android platform i try to play a movie, but nothing happens.
The code is simple:
videoItem = new QGraphicsVideoItem;
mediaPlayer = new QMediaPlayer;
qDebug() << QTime::currentTime().toString("HH:mm:ss:zzz") << "info_player" << "Movie does not exist" << movieName;
I have added the signals stateChanged and mediaStatusChanged. A don't get any signal either.
When I have added the statement:
qDebug() << QTime::currentTime().toString("HH:mm:ss:zzz") << "info_player" << mediaPlayer->mediaStatus();
I get the message in my log: QMediaPlayer::NoMedia
On windows this works wonderfull.
Do I need to add something in the Android Manifest?
I came a bit further.
When I create a QVideoWidget as a child of QWidget
and create the QMediaPlayer as:
I get the sound of the movie.
As soon as I add
I get the NoMedia result.
I have solved the issue myself.
I added the Qt kibraries in the apk file. That shouldn't. Ministro should download them on the tablet.
Then I got the eeror: Illegal state.
You have to create the mediaplayer with:
mediaPlayer = new QMediaPlayer(videoItem);
After that the player started to play the movies