Fix for url bug in the qmlvideo examples.
In the FileBrowser paths where being prepended with file:///, since all the paths already starts with a forward slash, navigating away from the initial directory was therefore not possible. To make the examples work on Android, QT += multimedia was added. Change-Id: Iff96729d476c4292999b022bdd6d5770b6b011e7 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
committed by
The Qt Project
parent
fca12620b1
commit
ccc4138304
@@ -116,13 +116,13 @@ int main(int argc, char *argv[])
|
||||
FileReader fileReader;
|
||||
viewer.rootContext()->setContextProperty("fileReader", &fileReader);
|
||||
|
||||
QUrl appPath(QString("file:///%1").arg(app.applicationDirPath()));
|
||||
QUrl appPath(QString("file://%1").arg(app.applicationDirPath()));
|
||||
QUrl imagePath;
|
||||
const QStringList picturesLocation = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
|
||||
if (picturesLocation.isEmpty())
|
||||
imagePath = appPath.resolved(QUrl("images"));
|
||||
else
|
||||
imagePath = QString("file:///%1").arg(picturesLocation.first());
|
||||
imagePath = QString("file://%1").arg(picturesLocation.first());
|
||||
viewer.rootContext()->setContextProperty("imagePath", imagePath);
|
||||
|
||||
QUrl videoPath;
|
||||
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
|
||||
if (moviesLocation.isEmpty())
|
||||
videoPath = appPath.resolved(QUrl("./"));
|
||||
else
|
||||
videoPath = QString("file:///%1").arg(moviesLocation.first());
|
||||
videoPath = QString("file://%1").arg(moviesLocation.first());
|
||||
viewer.rootContext()->setContextProperty("videoPath", videoPath);
|
||||
|
||||
viewer.setTitle("qmlvideofx");
|
||||
|
||||
Reference in New Issue
Block a user