QtitanMultimedia Quick Start
We did our best to make the process of installing and using QtitanMultimedia as easy and hassle-free as at all possible. Below is a description of just two simple steps you need to take to start using the advanced features of QtitanMultimedia in your own Qt applications:
Windows
- Open the Windows command line (cmd.exe) and switch to the folder where QtitanMultimedia files were installed.
- Run the "qtitanvars.bat" bat file.
The bat file will add the QTITANDIR environment variable with the value and will add
/lib to the PATH environment variable.
-
Add the following code to the *.pro(Qt Project) file of your application:
include($$(QTITANDIR)/src/shared/qtitanmedia.pri)
-
Reconfigure your application using qmake -r or qmake -tp vc -r (for Visual Studio projects) commands
in the folder where your project file is located.
Linux
- Open the unix shell and switch to the folder where QtitanMultimedia files were installed.
- Launch the "qtitanvars.sh" script from the command line using the following command: ". ./qtitanvars.sh"
The script will add the QTITANDIR environment variable with the value and will set the value
of the LD_LIBRARY_PATH environment variable to /lib for the current unix shell.
-
Add the following code to the *.pro(Qt Project) file of your application:
include($$(QTITANDIR)/src/shared/qtitanmedia.pri)
-
Reconfigure your application using the qmake -r command in the same folder your project file is located in.
QTITANDIR = $$(QTITANDIR)
include($$QTITANDIR/src/shared/qtitanmedia.pri)
The minimal project utilizing Qtitan::FlashPlayer would look as follows:
hello.pro
TEMPLATE = app
QTITANDIR = $$(QTITANDIR)
include($$QTITANDIR/src/shared/qtitanmedia.pri)
SOURCES += hello.cpp
hello.cpp
#include <QApplication>
#include <QtitanMM.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Qtitan::FlashPlayer flashPlayer;
flashPlayer->setSource("c://flashmovie.swf");
flashPlayer->setActive(true);
if (!flashPlayer->isActive())
{
QMessageBox::about(this, tr("Adobe Flash"),
tr("The <b>Adobe Flash</b> is not installed at your PC."));
return -1;
}
flashPlayer.show();
return app.exec();
}
If everything goes well, you will see the movie flashmovie.swf.