Results 1 to 5 of 5

Thread: Offline flash video

  1. #1
    Join Date
    Jun 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Offline flash video

    Hi,

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

    This is my main.cpp

    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include <QWidget>
    3. #include <QtWebKit>
    4. #include <QWebSettings>
    5. #include <QWebView>
    6. #include <QVBoxLayout>
    7. #include <QUrl>
    8. #include <QtPlugin>
    9. Q_IMPORT_PLUGIN(qjpeg)
    10.  
    11. int main(int argc, char *argv[])
    12. {
    13. QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
    14. QWebSettings::globalSettings()->setAttribute(QWebSettings::AutoLoadImages, true);
    15. QApplication a(argc, argv);
    16. QWidget *win = new QWidget();
    17. QVBoxLayout *lay = new QVBoxLayout();
    18. QWebView *web = new QWebView();
    19. QString qstring = QString(QApplication::applicationDirPath());
    20. //qstring += "../../../../.folder/index.html"; // Mac OS X
    21. qstring += "./.folder/index.html"; // Windows
    22. QUrl qurl = QUrl::QUrl(qstring);
    23. web->load(qurl);
    24. web->show();
    25. lay->setContentsMargins(0, 0, 0, 0);
    26. lay->addWidget(web);
    27. win->setLayout(lay);
    28. win->setGeometry(150, 60, 980, 680);
    29. win->show();
    30.  
    31. return a.exec();
    32. }
    To copy to clipboard, switch view to plain text mode 

    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?
    Last edited by iUser59; 9th June 2009 at 15:00.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Offline flash video

    Did you use QUrl::fromLocalFile()?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Offline flash video

    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?

  4. #4
    Join Date
    Jun 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Offline flash video

    Can it be a problem of flash security?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Offline flash video

    Quote Originally Posted by iUser59 View Post
    As you can see, I'm using QUrl with the application Path.
    That's exactly why I'm asking about QUrl::fromLocalFile().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 19th March 2009, 13:51
  2. Video freezes during mpeg video playback using Phonon
    By davejames in forum Qt Programming
    Replies: 2
    Last Post: 12th January 2009, 08:45
  3. To make audio and video file player in Qt
    By merry in forum Qt Programming
    Replies: 11
    Last Post: 24th January 2008, 06:31
  4. Video and QSlider
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2006, 19:37
  5. Flash with QT
    By Kapil in forum Qt Programming
    Replies: 1
    Last Post: 6th March 2006, 09:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.