PDA

View Full Version : Running flash .swf files in widget?



ashukla
23rd October 2007, 12:14
Dear Everyone!
I want to run flash file .swf in my widget. At a moment I am using gnash for it.
But It is not working good.
There is a problem of resizing object as well as it cannot render object completely.

So any other way is available to run flash .swf files in widget.

mchara
23rd October 2007, 12:23
Try using some freware flashPlayer(adobe or shockwave) as activeX - works good for me.

ashukla
23rd October 2007, 12:25
Try using some freware flashPlayer(adobe or shockwave) as activeX - works good for me.
for Fedora 6 which is prefrable.
Sir! may u give any example?

Brandybuck
23rd October 2007, 17:43
Under X11, you could use XEmbed and QX11EmbedContainer to embed the proprietary flash player in a window.

wysota
23rd October 2007, 19:51
WebKit might soon be a good choice too. Provided that it can run netscape (or some other) plugins...

ashukla
24th October 2007, 11:02
WebKit might soon be a good choice too. Provided that it can run netscape (or some other) plugins...

I am using WebKit in my application but it is not opening flash files, however it opens html files. How to open flash files using webkit?

ashukla
24th October 2007, 14:56
I am using WebKit in my application but it is not opening flash files, however it opens html files. How to open flash files using webkit?
What I do for above this?

wysota
24th October 2007, 19:22
I don't feel qualified to answer the question. If WebKit doesn't support netscape (or other) plugins, then it won't play flash movies. Period. Hence the "provided" part in my previous post.

ashukla
25th October 2007, 06:36
Under X11, you could use XEmbed and QX11EmbedContainer to embed the proprietary flash player in a window.
How to use this!
Can u give any example or link!

mchara
25th October 2007, 07:14
QAxWidget *flash("ShockWave Flash Object");
flash->dynamicCall("Movie(const QString&)", filename);
flash->dynamicCall("Play");

ashukla
25th October 2007, 07:30
QAxWidget *flash("ShockWave Flash Object");
flash->dynamicCall("Movie(const QString&)", filename);
flash->dynamicCall("Play");


QAxWidget only runs on Windows OS. I want to ask problem using with Fedora 6.
Have u any alternative.

ashukla
25th October 2007, 11:28
QAxWidget only runs on Windows OS. I want to ask problem using with Fedora 6.
Have u any alternative.

Dear Experts!

Give suggestion for above!
with reards!

Brandybuck
25th October 2007, 18:00
How to use this!
Can u give any example or link!
Qt Assistant! :D

It is very good documentation. Very good. When you want to know how to use a class, it should be the first place you look. It tells you all about QX11Embed classes.

wysota
25th October 2007, 21:29
But it doesn't tell you how to get a window id of a particular window from a 3rd party app ;)

ashukla
26th October 2007, 07:19
But it doesn't tell you how to get a window id of a particular window from a 3rd party app ;)
Dear Sir!
Tell some link, suggestions & any alternative to acheive goal!

pshukla
26th October 2007, 07:56
This is the code which embeds webkit inside a widget. Only problem is plugins not loaded. there are qwebobjectplugin.cpp and qobjectpluginconnector.cpp files in API of webkit. But I don't know how to use these two files and classes inside it to enable plugin.


#include <qwebpage.h>
#include <qwebframe.h>
#include <qwebsettings.h>
.
.
.
QWebSettings settings = QWebSettings::global();
settings.setAttribute(QWebSettings::PluginsEnabled );
QWebSettings::setGlobal(settings);
QUrl url("http://www.yahoo.com");
page= new QWebPage(this);
page->open(url);
show();

Kindly help if there is a way to include plugin. I can provide the code for qwebobjectplugin.cpp and qobjectpluginconnector.cpp .

wysota
26th October 2007, 08:10
The problem is not embedding WebKit into the app, but embedding a 3rd party player into WebKit or directly in your app. If you use native X calls to fetch the winId, it shouldn't be a problem. But you have to dig into Xlib to see how to get the id of a particular window which I doubt will be very simple.

pshukla
26th October 2007, 08:25
there is api for inclusion of 3rd party plugin inside QtWebKIt. I am giving content of qwebobjectplugin.cpp . In this you can see that /webplugins folder is included where third party plugins library may be placed. but how to include this and use.


#include "qwebobjectplugin_p.h"
#include <qwebobjectpluginconnector.h>
#include <qcoreapplication.h>
#include <qfileinfo.h>

#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QWebFactoryLoader, loader,
(QWebObjectPluginFactoryInterface_iid, QCoreApplication::libraryPaths(), QLatin1String("/webplugins")))
#endif


QWebFactoryLoader::QWebFactoryLoader(const char *iid, const QStringList &paths, const QString &suffix, Qt::CaseSensitivity)
: QFactoryLoader(iid, paths, suffix)
{
QStringList plugins = keys();
foreach(QString k, plugins) {
QWebObjectPlugin *plugin = qobject_cast<QWebObjectPlugin *>(instance(k));
if (!plugin)
continue;
Info info;
info.name = k;
info.description = plugin->descriptionForKey(k);
QStringList mimetypes = plugin->mimetypesForKey(k);
foreach(QString m, mimetypes) {
MimeInfo mime;
mime.type = m;
mime.extensions = plugin->extensionsForMimetype(m);
info.mimes << mime;
}
m_pluginInfo.append(info);
}
}

QWebFactoryLoader *QWebFactoryLoader::self()
{
return loader();
}


QString QWebFactoryLoader::descriptionForName(const QString &key) const
{
foreach(const Info &info, m_pluginInfo) {
if (info.name == key)
return info.description;
}
return QString();
}

QStringList QWebFactoryLoader::mimetypesForName(const QString &key) const
{
foreach(const Info &info, m_pluginInfo) {
if (info.name == key) {
QStringList mimetypes;
foreach (const MimeInfo &m, info.mimes)
mimetypes.append(m.type);
return mimetypes;
}
}
return QStringList();
}

QString QWebFactoryLoader::mimeTypeForExtension(const QString &extension)
{
foreach(const Info &info, m_pluginInfo) {
foreach (const MimeInfo &m, info.mimes) {
if (m.extensions.contains(extension))
return m.type;
}
}
return QString();
}


QStringList QWebFactoryLoader::extensions() const
{
QStringList extensions;
foreach(const Info &info, m_pluginInfo) {
foreach (const MimeInfo &m, info.mimes)
extensions << m.extensions;
}
return QStringList();

}

QString QWebFactoryLoader::nameForMimetype(const QString &mimeType) const
{
foreach(const Info &info, m_pluginInfo) {
foreach (const MimeInfo &m, info.mimes)
if (m.type == mimeType)
return info.name;
}
return QString();
}

QObject *QWebFactoryLoader::create(QWebFrame *frame,
const QUrl &url,
const QString &_mimeType,
const QStringList &argumentNames,
const QStringList &argumentValues)
{
QString mimeType = _mimeType;
if (mimeType.isEmpty()) {
QFileInfo fi(url.path());
mimeType = mimeTypeForExtension(fi.suffix());
}
QString name = nameForMimetype(mimeType);
QWebObjectPlugin *plugin = qobject_cast<QWebObjectPlugin *>(instance(name));
if (!plugin)
return 0;
QWebObjectPluginConnector *connector = new QWebObjectPluginConnector(frame);
return plugin->create(connector, url, mimeType, argumentNames, argumentValues);
}



/*! \class QWebObjectPlugin

This class is a plugin for the HTML object tag. It can be used to embed arbitrary content in a web page.
*/


QWebObjectPlugin::QWebObjectPlugin(QObject *parent)
: QObject(parent)
{
}

QWebObjectPlugin::~QWebObjectPlugin()
{
}

/*!
\fn QStringList QWebObjectPlugin::keys() const

The keys should be unique names.
*/

/*!
A description for \a key.
*/
QString QWebObjectPlugin::descriptionForKey(const QString &key) const
{
return QString();
}

/*!
returns the mimetypes that can be handled by \a key.
*/
QStringList QWebObjectPlugin::mimetypesForKey(const QString &key) const
{
return QStringList();
}


/*!
\fn QStringList QWebObjectPlugin::extensionsForMimetype() const

Should return a list of extensions that are recognised to match the \a mimeType.
*/
QStringList QWebObjectPlugin::extensionsForMimetype(const QString &mimeType) const
{
return QStringList();
}

pshukla
27th October 2007, 07:57
How to resize anything for ex: gnash inside QX11EmbedContainer window? gnash is running flash movie inside QX11EmbedContainer but not resizing it of the same size as of QX11EmbedContainer.

ashukla
27th October 2007, 14:28
Dear Experts!
Kindly give me a contact address of WebKit developers!
Specially I want the contact/e-mail address of Jack belongs from London.
b/z he says that it can be possible when I am searching on google! but the link of file is not exists!
hoping an earlier response!
with regards!

wysota
27th October 2007, 20:23
WebKit is developped by Apple.

ashukla
28th October 2007, 04:42
WebKit is developped by Apple.
Dear Sir!
May you provide the e-mail or contact no. of developers of WebKit.
with regards!

jpn
28th October 2007, 08:03
Did you try searching Google for "webkit"?

ashukla
28th October 2007, 10:15
Did you try searching Google for "webkit"?
Dear Sir!
I am unable to find the individuals who contribute upon this!

jpn
28th October 2007, 10:17
Go to webkit.org and follow the link called "Keep in Touch".

ashukla
28th October 2007, 11:41
Go to webkit.org and follow the link called "Keep in Touch".
Thanks for it!

Dear Sir!
Except gnash & webkit, Can any altrnative is possible to open .swf files in a child widget with resizing feature.

MarkoSan
8th December 2007, 05:07
So, there is no class in Qt (ver. 4.3.2) that can play flash animation on qwidget?

jpn
8th December 2007, 08:48
So, there is no class in Qt (ver. 4.3.2) that can play flash animation on qwidget?
That's right.

MarkoSan
8th December 2007, 08:52
How sad ...

beto
7th February 2008, 19:15
What about using QT4.4 and its integrated Webkit? I've noticed that even the demo browser application provided with it is unable to load flash and other videos.

So, is it possible to integrate a flash plugin inside QT Webkit? How?

ashukla
8th February 2008, 05:07
What about using QT4.4 and its integrated Webkit? I've noticed that even the demo browser application provided with it is unable to load flash and other videos.

So, is it possible to integrate a flash plugin inside QT Webkit? How?
I have done it; but I would have to fix some issue of sound control in multiple frames.
It is also possible with gnash; but It does not provide the full resizing feature against different Aspect ratio.

przemoc
8th February 2008, 11:34
I have done it; but I would have to fix some issue of sound control in multiple frames.
Can you show us your achievement or at least key parts of it?

beto
8th February 2008, 12:24
Have you used the classes contained in qwebobjectplugin.cpp and qobjectpluginconnector.cpp?

Can you give some indications or directions of how you implemented it?

ashukla
9th February 2008, 04:43
Using gnash with QProcess.

beto
10th February 2008, 02:11
I have done it; but I would have to fix some issue of sound control in multiple frames.
It is also possible with gnash; but It does not provide the full resizing feature against different Aspect ratio.

When thing I didn't understand though: have you integrated the plugin using two different (and separate) methods (1 - through webkit; 2 - through gnash)

Or, on the contrary, you integrated the plugin using, at the same time, Webkit + Gnash?

ashukla
10th February 2008, 04:48
When thing I didn't understand though: have you integrated the plugin using two different (and separate) methods (1 - through webkit; 2 - through gnash)

Or, on the contrary, you integrated the plugin using, at the same time, Webkit + Gnash?
Dear beto!
Both the gnash & webkit; I have done seperately. But Some issue remain to fix. And I am thinking the best way to solve this; using webkit.

beto
11th February 2008, 10:51
Ashukla, thanks for your kind answers.

I'm interested mainly in the Webkit integration: I have a browser-like app built with the latest QT 4.4 snapshot, using the QT Webkit API. It works fine, apart from the video plugins.

I'm stuck on that, because I didn't find a way to properly integrate a video plugin inside the QT/Webkit modules. How did you make it? Using the classes inside qwebobjectplugin.cpp and qobjectpluginconnector.cpp? I've seen these classes, but I don't know how to use them.:confused:

Or maybe have you used the QAxWidget? This is part of the ActiveQT framework, and not included in the Free/Non-Commercial QT editions, right?

ashukla
12th February 2008, 04:14
Ashukla, thanks for your kind answers.

I'm interested mainly in the Webkit integration: I have a browser-like app built with the latest QT 4.4 snapshot, using the QT Webkit API. It works fine, apart from the video plugins.

I'm stuck on that, because I didn't find a way to properly integrate a video plugin inside the QT/Webkit modules. How did you make it? Using the classes inside qwebobjectplugin.cpp and qobjectpluginconnector.cpp? I've seen these classes, but I don't know how to use them.:confused:

Or maybe have you used the QAxWidget? This is part of the ActiveQT framework, and not included in the Free/Non-Commercial QT editions, right?
Dear Beto!
I am not using ActiveQt Framework because it is not possible in Linux/Unix.
The simplest way is; You can call any swf file in web browser using <embed> of Java Script.
first you create a temporary html file for particular .swf object and then play it. Another way is also possible; but I am bounded with company rules.
hoping its help!