Harmattan QUrl and QMediaPlayer problem with source
-
Hello!
Okay, as the title says: In my application I'm trying to use QMediaPlayer to play music in my app, for Harmattan target.
The sound files are included via deploymentfolders.From PC, it is already working: (in Qt Simulator)
@playlist->addMedia(QUrl::fromLocalFile("/files/sound_1.mp3"))@However, it's not working when installed in the device.
I've been going back and forth with QA because of this, because I don't have a device to test
and I think Harmattan QEMU and RDA doesnt give me sound output because Angry Birds has no sound.Things I've tried:
- I noticed that the default working directory when I run the app is not in my application directory, so I've set it with
@QDir::setCurrent("/opt/myapp/")@
by adding this code, the device can now read my textfiles ( with QFile )
however QUrl still don't seem to work.
-I've tried to write the absolute path of the file with:
@playlist->addMedia(QUrl::fromLocalFile(QDir::current().path() + QString("/files/sound_1.mp3")));@
and still won't work.Or can you post an example working QUrl local source with QMediaPlaylist when deployed in Harmattan?
Please help..
Big thanks!
- I noticed that the default working directory when I run the app is not in my application directory, so I've set it with
-
"Media Player example ":http://harmattan-dev.nokia.com/docs/library/html/qtmobility/multimedia.html?tab=0#examples
-
Thank you, I will check on it.