-
-
Save laabroo/0945ff215c48ba7ee0a7 to your computer and use it in GitHub Desktop.
Implementation QMediaPlayer and QMediaPlaylist on Blackberry 10 development.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Reffrence : | |
http://harmattan-dev.nokia.com/docs/library/html/qtmobility/qmediaplaylist.html | |
http://harmattan-dev.nokia.com/docs/library/html/qtmobility/qmediaplayer.html | |
*/ | |
/* | |
on your file .pro | |
Please add this path declaration QMediaPlayer lib | |
CONFIG += mobility | |
MOBILITY = multimedia | |
QT += multimedia multimediakit | |
LIBS += -lbbmultimedia | |
*/ | |
/* | |
on your file bar-description.xml | |
Please check permission "access_shared" to access file from your device or your path application | |
*/ | |
#include <QMediaPlaylist> | |
#include <QMediaPlayer> | |
void MyPlayer::playSongs(){ | |
QMediaPlayer player = new QMediaPlayer(this); | |
QMediaPlaylist playlist = new QMediaPlaylist(this); | |
playlist.addMedia(QUrl(YOUR_SONG_PATH+"song1.mp3")); | |
playlist.addMedia(QUrl(YOUR_SONG_PATH+"song2.mp3")); | |
playlist.addMedia(QUrl(YOUR_SONG_PATH+"song3.mp3")); | |
playlist.addMedia(QUrl(YOUR_SONG_PATH+"song4.mp3")); | |
playlist.addMedia(QUrl(YOUR_SONG_PATH+"song5.mp3")); | |
//replace YOUR_SONG_PATH to your really path songs | |
playlist.setCurrentPosition(0); | |
player.play(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment