October 16, 2010

bunjee bunjee
Lab Rat
122 posts

QWebView / QGraphicsWebView + Javascript HTML 5 music player

 

Dear trolls,

I’m currently embedding the jPlayer “JQuery audio player” inside of my QGraphicsWebView (I also tried on the Demo QWebView Browser).

You can access the demo page here:
http://www.happyworm.com/jquery/jplayer/latest/demo-02.htm [happyworm.com]

This playlist is half working using the 4.7 webkit on windows vista:

  • Playing a title works fine.
  • Advancing the playback to a given time does not work.
  • When a title is over the player does not go to the next.

I know this is some random JQuery library but maybe you guys have an idea on what’s happening here.

Besides, all these features are working fine in Chrome / Safari.

Is there something specific in the equation that might be unsupported by the current Qt 4.7 build ? Is it work in progress ?

Thank you.

Benjamin Arnaud.

7 replies

October 17, 2010

Benjamin Poulain Benjamin Poulain
Lab Rat
153 posts
bunjee wrote:
Dear trolls, Is there something specific in the equation that might be unsupported by the current Qt 4.7 build ? Is it work in progress ?

Yep, this is using HTML 5 audio element, which is not yet fully supported by QtWebKit. The current implementation uses Phonon, and is experimental. Some features of the media elements simply cannot be implemented via Phonon.

There is research work being done to have HTML 5 media elements implemented with QtMultimediaKit of QtMobility. A first support is planned for QtWebKit 2.2.

October 17, 2010

bunjee bunjee
Lab Rat
122 posts

Thanks / Merci Benjamin,

Do you think I can expect to have support for this in the next Qt release (4.8) ? Or is it “highly experimental” ?

October 17, 2010

Benjamin Poulain Benjamin Poulain
Lab Rat
153 posts
bunjee wrote:
Do you think I can expect to have support for this in the next Qt release (4.8) ? Or is it “highly experimental” ?

The scope of Qt 4.8 is not yet defined so it is hard to say what will be and won’t be in there. :)

If you feel adventurous, you can already try installing QtMobility and compiling QtWebKit trunk with it. Some basic support is already there. This is not as seamless as we would like, there are plenty of bugs in QtMultimedia that needs to be fixed.

October 17, 2010

bunjee bunjee
Lab Rat
122 posts

Thanks Benjamin,

I’ve tested my jQuery player a little bit and found a way to disable HTML 5 audio and use flash instead.

A demo of this behavior can be found here:
http://www.happyworm.com/jquery/jplayer/latest/demo-02-nativeSupportFalse.htm [happyworm.com] .

  • This happens to work just fine in a traditionnal QWebView + PluginsEnabled.
  • But it’s not working in a QGraphicsScene + QGraphicsWebView + PluginsEnabled.

In this precise case the javascript is just running a simple swf file instead of HTML 5 routines. Are there some Flash restrictions in the QGraphicsWebView ?

Thanks.

October 17, 2010

Benjamin Poulain Benjamin Poulain
Lab Rat
153 posts
bunjee wrote:
Thanks Benjamin, In this precise case the javascript is just running a simple swf file instead of HTML 5 routines. Are there some Flash restrictions in the QGraphicsWebView ?

When flash is in QGraphicsWebView, it is in windowless mode, so it is a bit different on the flash side (see http://blog.forwardbias.in/2009/12/flash-in-qgraphicsview.html [blog.forwardbias.in] for more info).
But that should not affect the plugin other than the rendering. Is it a recent version of the Flash plugin?

October 17, 2010

bunjee bunjee
Lab Rat
122 posts

According to the Dev Guide [happyworm.com] :

Jplayer.swf
The plugin’s Flash 8 file, compiled using the Open Source ActionScript 2 Compiler MTASC.
This file is used in browsers that do not support HTML5 <audio>.

It’s Flash 8.

But that should not affect the plugin other than the rendering

I agree, not sure why windowless would affect audio playback.

October 18, 2010

bunjee bunjee
Lab Rat
122 posts

Alright tested out this morning on Mac OS X.

  • Using Cocoa: flash does not run at all. As expected after reading your blog post.
  • Using Carbon: it works fine in both QWebView / QGraphicsWebView. So it appears to be something specific to Windows (Vista ?).
  • Using Carbon on HTML 5: I get the exact same issues than on Windows PC, so I guess Phonon behave consistently :).

Anyone can try running a simple QGraphicsWebView + this url [happyworm.com] on a Windows platform to double check it does not work ?

Thanks.

B.A.

 
  ‹‹ QGraphicsWebView smooth pixmap      Webkit, Disable selection ››

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