hanhkim
hanhkim

Reputation: 11

Video doesn't show on Android by QVideoWidget and QMediaPlayer (QT 5.2.1)

I really need help here! :(

I am working on QT by deploying a small project to Android 4.0.3 (API 15). I use this code below to run a small video. I built it successfully and run by Desktop 5.2.1 MinGW 32bit, everything is fine! but when I deploy it to the emulator. the audio is fine but the video doesn’t show on and the screen is white ! I don’t know what the problem is. I hope you can give me some advices. Thanks in advance.

QWidget *widget = new QWidget;

layout = new QVBoxLayout;
player = new QMediaPlayer;
QVideoWidget *vw = new QVideoWidget;

layout->addWidget(vw);
widget->setLayout(layout);

player->setMedia(QUrl::fromLocalFile("/sdcard/Music/video.mp4"));
player->setVideoOutput(vw);
widget->show();

vw->show();
player->play();

Upvotes: 1

Views: 900

Answers (1)

Nejat
Nejat

Reputation: 32685

The Qt Multimedia Widgets module is not supported on Android. That's an issue in Qt for Android. You can check it here that video display is only available using the VideoOutput and Video QML items.

Upvotes: 1

Related Questions