views:

629

answers:

1

Has anyone built a Qt S60 app (3rd edition, FP2) that plays (streaming or local) video?

I want to play video 'in' a widget, not with (say) QDesktopServices.

I know there's documentation about how to do this with Symbian, such as here and here but I'm still stuck.

(Apologies in advance for cross-posting: I've asked elsewhere, but with no success.)

+4  A: 

Qt 4 includes a suite of multimedia APIs called Phonon, which allow you to do just this. They are currently being implemented for Symbian - while the Qt for S60 "Tower" pre-release does not include support for Phonon on Symbian, Qt 4.6 will do.

In the meantime, your only option is to use the Symbian MMF APIs directly. Specifically, your video widget - or an object owned by it - will need to create an instance of CVideoPlayerUtility, and therefore will need to implement MVideoPlayerUtilityObserver. The video player API requires the client to provide an RWindow in which to display the video - this can be obtained by calling QWidget::winId(), which returns a CCoeControl* pointer. You can therefore obtain a window handle by calling

RWindow& window = *static_cast<RWindow*>(widget->winId()->DrawableWindow())

All in all however, playing video from a Qt app (or indeed any app) on Symbian currently requires quite a lot of work - especially if you want to support dynamic re-sizing and/or re-positioning of the video content. Note also that the way in which Qt is currently implemented on Symbian means that moving other widgets (partially or completely) on top of the video widget will not work correctly - the video will continue to appear on top. This is due to the fact that calling QWidget::winId() currently doesn't cause Qt to create a native Symbian window, and will be rectified in 4.6.

In summary, unless you are in a hurry to do this, it is probably better to wait for the 4.6 beta which is due in a few weeks time.

Gareth Stockwell
Thanks for that. I've got a simple app working with CVideoPlayerUtility and will follow your instructions for incorporating it in a Qt app. I've seen the details of the 4.6 technology preview but, as far as I can see (despite some video classes) there isn't support for simple video playback: http://doc.qt.nokia.com/4.6-snapshot/qt4-6-intro.html
Sam Dutton
It's probably worth pointing out that there are two separate sets of multimedia APIs in Qt. The first, Phonon, is fully developed - although as I said, not yet implemented for Symbian. The second is the QtMultimedia project, which has so far defined the audio services APIs described in the link you mention. The plan (described in full in http://labs.trolltech.com/blogs/2009/09/09/multimedia-in-qt-whats-the-story/) is for QtMultimedia to evolve to become much more feature-rich than Phonon. For simple video playback in the short term however, Phonon remains your best bet.
Gareth Stockwell
So -- is an S60 Phonon backend available, or will it become available with 4.6 for S60?
Sam Dutton
It's currently in development, and will be included in the 4.6 release. Because Qt is open source however, you can always pull the latest code from the git repo (http://qt.gitorious.org/qt/qt/commits/4.6) - YMMV etc :)
Gareth Stockwell
The MMF Phonon backend is now available in the 4.6.0 beta release - see http://labs.trolltech.com/blogs/2009/10/14/qt-460-beta1-for-symbian-is-out/.
Gareth Stockwell