maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   QtMobility Media Player Example Problem (https://talk.maemo.org/showthread.php?t=78473)

st00pid 2011-10-03 16:12

QtMobility Media Player Example Problem
 
Hi there. I recently bought an n900 and trying to program sth.
Stumbled over the QtMobility Media Player Example.
(http://doc.qt.nokia.com/qtmobility-1.2/player.html)
Everything compiles fine, but on the device it throws:

The QMediaPlayer object does not have a valid service
Please check the media service plugins are installed

Am i missing sth?

using:
n900 kp48
libqtm-1.0.2 & libqtm-1.2.0 installed
latest Qt SDK/Creator

nicolai 2011-10-03 20:02

Re: QtMobility Media Player Example Problem
 
1 Attachment(s)
I think there is a bug in the example.
It is about this line http://doc.qt.nokia.com/qtmobility-1...layer-cpp.html
Quote:

if (!player->isAvailable()) {
QMessageBox::warning(this, tr("Service not available"),
tr("The QMediaPlayer object does not have a valid service.\n"\
"Please check the media service plugins are installed."));

controls->setEnabled(false);
playlistView->setEnabled(false);
openButton->setEnabled(false);
#ifndef PLAYER_NO_COLOROPTIONS
colorButton->setEnabled(false);
#endif
fullScreenButton->setEnabled(false);
}

In the constructor of Player.
At this point of time the player object (a QMediaObject)
isn't available.
I changed the code a bit and moved this part of the initialization
in a public slot and connected QMediaObjects' availabilityChanged
signal with this code.
Now it works and you can open and play a video file:

st00pid 2011-10-03 23:00

Re: QtMobility Media Player Example Problem
 
Thank you very much. Haha, wasted about 2 Hours checking and altering prerequisites, never thought 1 second about a possible error in the example code.
Thx again, greets

%edit
btw, slow as hell the thing, maybe sticking to good ol' Qwidgets w/ Phonon

nicolai 2011-10-04 11:23

Re: QtMobility Media Player Example Problem
 
BTW, it seems the controls (hue, brightness, ...) doesn't work.


All times are GMT. The time now is 06:42.

vBulletin® Version 3.8.8