Video element plays video at wrong position on IOS
-
I want to write a video player for IOS, when I put a video element and set the media source, it plays very well except for that, the video surface is on the top left, not the position I put the video element. I have used a Rectangle to test the Video element is at the right Position.
Is this a bug?
-
Hi,
I am not using QML. Here are the important code snippets:
@MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);player = new QMediaPlayer; player->setVideoOutput(ui->videoWidget); ui->videoWidget->show();
}
void MainWindow::onActionOpen()
{
QString file = QFileDialog::getOpenFileName(this, tr("Open Video File"), ".");
if(file.isEmpty())
return;player->setMedia(QUrl::fromLocalFile(file)); player->setVolume(50); player->play();
}@
ui->videoWidget is of type QVideoWidget
On my Ubuntu 14.04 64bit host everything works fine. Qt is version 4.8.6 for host and 4.8.5 for target. QtMobility is 1.2.0 for both. -
Hi,
I am not using QML. Here are the important code snippets:
@MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);player = new QMediaPlayer; player->setVideoOutput(ui->videoWidget); ui->videoWidget->show();
}
void MainWindow::onActionOpen()
{
QString file = QFileDialog::getOpenFileName(this, tr("Open Video File"), ".");
if(file.isEmpty())
return;player->setMedia(QUrl::fromLocalFile(file)); player->setVolume(50); player->play();
}@
ui->videoWidget is of type QVideoWidget
On my Ubuntu 14.04 64bit host everything works fine. Qt is version 4.8.6 for host and 4.8.5 for target. QtMobility is 1.2.0 for both. -
-Oh okay, your thread is in the QtQuick(QML)-section so i thought you did it with QML-. Well, how do you position your MediaPlayer?
My bad, this thread is a few months old and you are not OP. Still, i will try to help you trough your problem even if i haven't worked with the QMediaPlayer so far.
-
-Oh okay, your thread is in the QtQuick(QML)-section so i thought you did it with QML-. Well, how do you position your MediaPlayer?
My bad, this thread is a few months old and you are not OP. Still, i will try to help you trough your problem even if i haven't worked with the QMediaPlayer so far.
-
See "QTBUG-42721":https://bugreports.qt-project.org/browse/QTBUG-42721
I raised this as an issue with iOS video placement (using the QML VideoOutput, but it presumably sits on the same underlying code as the C++ ) a week or so ago which sounds like it's the same as hailong's problem. If it helps identify it's the same thing:
- It came in with Qt5.3.2; I never saw the problem on 5.3.1.
- If you rotate the device while the video is playing, it'll move to where you expect it to! (At least until the video ends; if you have it set up to loop, it might move back to the top corner again).
-
See "QTBUG-42721":https://bugreports.qt-project.org/browse/QTBUG-42721
I raised this as an issue with iOS video placement (using the QML VideoOutput, but it presumably sits on the same underlying code as the C++ ) a week or so ago which sounds like it's the same as hailong's problem. If it helps identify it's the same thing:
- It came in with Qt5.3.2; I never saw the problem on 5.3.1.
- If you rotate the device while the video is playing, it'll move to where you expect it to! (At least until the video ends; if you have it set up to loop, it might move back to the top corner again).