March 28, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

How does QWebKit play a flash?

Page  
1

Hi guys,

I am using Qt 4.7.1 and hope to use QWebView to open a web site that has some flash source files.
My code like this:

  1. QWebView* webView = new QWebView;
  2. webView->settings()->setAttribute(QWebSettings::PluginEnabled, true);
  3. webView->load(QUrl("http://news.sina.com.cn/"));
  4. webView->show();

The above code can work on Windows. But, on Mac, I see some icons(a box with a question mark on it). Obviously, it is failed to load the plug-in. However, as the matter of fact, I installed the plug-in in “/Library/Internet Plug-Ins/Flash Player.plugin”. And, I can open this website with Safari/Firefox on Mac OS. By the way, my Mac is iMac and OS is 10.6.6.

I don’t know what is wrong in my code. Could you give me some help? Thank you so much. – Frank

EDIT: added @ tag (vcsala)

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

18 replies

March 28, 2011

rmccarthy rmccarthy
Lab Rat
5 posts

Hi Frank,

I had a similar problem recently. My issue was that I was running my app as 64-bit and the flash plugin is 32-bit, so they cannot interact.

I’m using Python and PyQt, so my solution is probably different to yours, but you’ll need to make sure your application compiles as 32-bit and possibly Qt as well (although this may have been compiled to support both architectures)

Hope this helps,
Rory

March 29, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

Hi Rory,

Thanks for your response.

Yes, my application is 64bit. The installed flash plug-in is 32bit. I guess that it could be the reason. But, my application must run as 64bit. So, :-(.

However, my Safari is 64bit. Why can it play flash? I searched this question on Internet. Some people think that I should lunch WebKitPluginHost.app. Through this host application, access 32bit flash plugin. Your idea? And, how do I lunch it in Qt? Could you help me? Thank you so much. Maybe, I should install a 64bit flash plugin. But, I don’t search it on Internet. Does flash plugin have 64bit version?

- Frank

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

March 29, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

I gdb my application. There is the error:

———————
Error loading /Library/Internet
Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player: dlopen(/Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash
Player, 262): no suitable image found. Did find:
/Library/Internet Plug-Ins/Flash Player.plugin/Contents/MacOS/Flash Player:
no matching architecture in universal wrapper
———————

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

March 29, 2011

rmccarthy rmccarthy
Lab Rat
5 posts

Hi Frank,

As far as I know, there is no version of flash for 64-bit architectures.

I don’t know what the solution to your problem is if you can’t compile your app as 32-bit. But you’re right, Safari is able to overcome this issue so it must be possible.

Using a 32-bit host app to run the flash plugin certainly sounds like a possibility, but I don’t have any experience using this. Sorry.

Good luck,
Rory

March 29, 2011

Tomma Tomma
Lab Rat
72 posts

There is preview version of 64bit adobe-flash and it works fine on linux.
http://labs.adobe.com/downloads/flashplayer10_square.html

March 30, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

Hi Rory,
Thanks for this quick response. When build my application as 32bit, a flash can be shown. But unfortunately, my application must be 64bit. Ooops…

Hi Tomma,
Thanks for your response. In fact, I installed this version of flash plug-in from “http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_mac_111710.dmg”. But, you can see that this plug-in still be 32bit, when use nm command to check its information(nm /Users/frank/Desktop/Test/fancybrowser/build/Debug/fancybrowser.app/Contents/MacOS/fancybrowser -arch x86_64). So, even if install this version of flash plug-in, a flash can not be shown, yet.

Hi Rory and Tomma,
Is there other way to show flash in Qt except for QtWebKit? Today, I will try Phonon library. Hope to see any progress. Thank guys.

-Frank

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

March 30, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

Hi guys,

Today, I tried Phonon library to play a flash. It is failed because QuickTime on which Phonon depends does not support swf(flash file format). Ooops :-(

-Frank

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

April 5, 2011

MAMartins MAMartins
Lab Rat
49 posts

I have the same problem, how do i compile my app as 32bit?

if I make an project only of qml and use an webview I can run html5 videos with no problem but the debugger shows lots of errors and some times the app crash, on qt I get the same error as the OP

April 6, 2011

MAMartins MAMartins
Lab Rat
49 posts

any help?!

April 7, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

Do you work on XCode?

If so, follow the step: “Targets” -> “(Your Application)” -> “Get Info” -> go to “Build” table -> go to “Architectures” -> go to “Architectures” -> Select “32-bit Itel”.

That’s all. Hope that it can help you.

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

April 7, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

I resolved this problem. The solution just is to invoke a 32bit process(in fact, it is a application) to play a flash while a 64bit application executes. So far, everything is OK. By the way, I don’t use WebKitPluginHost.app. :-)

Generally, I expect that Adobe can release early 64bit flash plug-in. After all, it is a real way.

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

April 7, 2011

frank.fang.kun frank.fang.k..
Lab Rat
14 posts

Anyway, thank Rory and Tomma.

 Signature 

Frank | .(JavaScript must be enabled to view this email address)

April 7, 2011

MAMartins MAMartins
Lab Rat
49 posts

thanks, I don’t work on xcode but i’ve figured it out how to do.

i’ve added this to my .pro file:
CONFIG -= x86_64 ppc64
CONFIG *= x86

I don’t need a native 64bit app so i can build it all in 32 :)

April 7, 2011

Volker Volker
Ant Farmer
5331 posts

If you want to make some older Mac users with PowerPC machines (yes, there are still a lot of them around running OS X 10.5!), then change your line to this in order to make a 32 bit universal app:

  1. CONFIG *= x86 ppc

April 7, 2011

MAMartins MAMartins
Lab Rat
49 posts

with ppc I get errors as i’ve posted in the other thread :)

Page  
1

  ‹‹ QtWebKit segfault on javascript alert()      Qt WebView and IP Camera ››

You must log in to post a reply. Not a member yet? Register here!