PDA

View Full Version : Offline flash video



iUser59
9th June 2009, 12:04
Hi,

I've a strange (everyone said me this) problem.

This is my main.cpp



#include <QtGui/QApplication>
#include <QWidget>
#include <QtWebKit>
#include <QWebSettings>
#include <QWebView>
#include <QVBoxLayout>
#include <QUrl>
#include <QtPlugin>
Q_IMPORT_PLUGIN(qjpeg)

int main(int argc, char *argv[])
{
QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
QWebSettings::globalSettings()->setAttribute(QWebSettings::AutoLoadImages, true);
QApplication a(argc, argv);
QWidget *win = new QWidget();
QVBoxLayout *lay = new QVBoxLayout();
QWebView *web = new QWebView();
QString qstring = QString(QApplication::applicationDirPath());
//qstring += "../../../../.folder/index.html"; // Mac OS X
qstring += "./.folder/index.html"; // Windows
QUrl qurl = QUrl::QUrl(qstring);
web->load(qurl);
web->show();
lay->setContentsMargins(0, 0, 0, 0);
lay->addWidget(web);
win->setLayout(lay);
win->setGeometry(150, 60, 980, 680);
win->show();

return a.exec();
}



In fact, as you can see, I've a cached folder in the same repertory of my .exe (or my .app for MacOS X).
In this folder, I've an index.html and all is working well. The images and the firstframeimage are displaying well but, on windows, the video can be displaying.

In fact, when I test my application with online website, it works well but not with local folder.

I don't know what I'm doing wrong.

Can someone help me?

wysota
9th June 2009, 21:28
Did you use QUrl::fromLocalFile()?

iUser59
10th June 2009, 08:18
As you can see, I'm using QUrl with the application Path.

But I don't think it's the problem because the application find the images and the html files and mainly it works on Mac Os X with the same code.

Can someone try please?

iUser59
10th June 2009, 08:39
Can it be a problem of flash security?

wysota
10th June 2009, 14:17
As you can see, I'm using QUrl with the application Path.
That's exactly why I'm asking about QUrl::fromLocalFile().