PDA

View Full Version : phonon mediaplayer as browser plugin ?



MartinS
17th February 2009, 00:31
Finally, i succeeded in building the demos/examples supplied with Qt 4 and phonon.

Well, now i tried to embed the 'mediaplayer' (demos/mediaplayer) demonstration
into the 'browser plugin' project example 'trivial' that can be found here (http://www.qtsoftware.com/products/appdev/add-on-products/catalog/4/Utilities/qtbrowserplugin).

I did this by simply merging those two pieces of code together and calling an instanciation of the media player object in the constructor of the 'trivial' plug in.

Well, so far so good.

When the 'trivial' plug in example is run now, it also shoots the media player window.
All dialogs work, but if i try to open some media file, nothing happens.

( I double checked if the file is really opened, but it seems like the actual playback is never triggered. I use the very unchanged source of the media player example. )

Why ?

( Also, it is mentioned in the doc about browser plugin development [ see here (http://doc.trolltech.com/solutions/4/qtbrowserplugin/developingplugins.html)] that 'since any QWidget or QObject subclass can be turned into a plugin with little effort it is usually easiest to do the development as a stand-alone Qt application'. Can someone point me to some more information regarding this process ? Because this seems to be exactly what i'm trying to do ... )

talk2amulya
17th February 2009, 07:23
how are u providing it the file to be played? from the system?

MartinS
17th February 2009, 14:41
Using the file open dialog which is included in the media player.

MartinS
21st February 2009, 17:24
Still hoping for a useful answer here.

talk2amulya
21st February 2009, 17:32
i m not sure but if u wanna play a music file on a browser..u might wanna add the file using URL..not a file from the computer..

aamer4yu
21st February 2009, 19:18
Are you using opensource or commercial edition ?

I see that in trivial hello world example, ActiveQt is included, which is available only for commericial editions.

Might be that it is causing the problem :rolleyes:

MartinS
24th February 2009, 03:36
Hmmm ... nay, nay and nay.

Neither it is the media file opened as URL instead of file ( already tried that ) nor the possible usage of ActiveQt (the trivial example itself runs like a charm and the mediaplayer also shows up and is 'usable' so far)

No, it has to be something different here.

When i try to open any file also the media player window shows the name of the file as window title ... seems like it tries to open the media at least ...

MartinS
24th February 2009, 21:42
Update:

After playing a bit with phonon in an ordinary application environment, i changed my plugin source so i can see the state of the mediaObject used within.

Seems like the mediaObject never ever overcomes the Loading state, so it'll never start actual playback ... but why's that ?

I'm getting somewhat hopeless here :(

MartinS
25th February 2009, 11:32
another update:

some weirdness i discovered - when i set the file name of the media file to somewhat non-existant, it still reports NO error but keeps being stuck in the loading state instead

...

MartinS
28th February 2009, 02:44
still no useful solution here ...

Brandybuck
28th February 2009, 05:34
I don't know anything about writing Netscape API plugins (which is what you are trying to do). But I have used mediaplayer as a plugin for QtWebKit. See http://www.qtcentre.org/forum/f-qt-webkit-36.html for more info.

MartinS
28th February 2009, 14:26
First of all, thank you for your reply, Brandybuck.

QtWebKit is one of the things i came across when i was looking for ressources for my issue.
But it wouldn't solve my problem here, as within a webkit environment, phonon is again
treated like it is treated within a stand-alone application. ( in which it runs flawless, like described above )

Again, looking at the behaviour of the phonon module within the plugin running in a browser
session, i suppose the phonon backend never gets initialized.

This is evidenced by having the phonon module sitting in the Phonon::LoadingState forever,
which is already considered being a bug, because it should switch to the ErrorState then.

Also it is somewhat strange to have phonon also not having toggle to ErrorState when
supplying it with a non-existant filename, like i did and also described in the posts above.

As a third proof, i tried to have phonon within the browser plugin have output the
Phonon::BackendCapabilities, which are NULL (when run within browser, same code again
runs without any flaws when run stand alone in simple windowed application )

So any further investigation should focus on the backend initialization, respectively why it's not loaded correcty.

nunzianteantonio
26th September 2011, 12:42
Hi, I'm interested on your problem because I'm involved in a similar project. Have you solved it?
It would be useful work on this topic for the community. Thank you