原文:http://wiki.forum.nokia.com/index.php/QtMobilityYouPlayer
YouPlayer - QtMobility Api application
Introduction
YouPlayer is small mediaplayer written in Qt. It serves a single purpose: use YouTube API to search, fetch music and stream media directly from YouTube. Similar idea like spotify client but use YouTube as a mediasource. It also includes interface which to extend to add other media source which to query playlists. Application uses three [QtMobility] API: multimedia, location and bearermanagement. When using location api you can limit your search results containing those near you (radius is used). Bearer management api is used to help connecting to the Internet with default connection.
Application has been developed using Ubuntu Linux using and QtCreator 1.3. Also some quick emulator test with Symbian 5th Edition SDK and Carbide.
How to use it
- Enter a search string and press search. If you want to limit search to a location near you check the "use location" checkbox.
- Save button enables one to save the playlist for a later purpose (to /home/username/youplayer_list.m3u)
- Load button loads previously saved list from filesystem.
- Clear buttons clears/empties playlist.
- To listen/watch playlist entries use playlist or use control buttons at the bottom.
The Code
How to add your own Media feed provider (not YouTube)
- extend class MediaFeedApi
- take at look what methods are currently implemented for YouTube in GDataApi.cpp (this class implements MediaFeedApi)
- tweak to your own needs
How to compile and test it
- First Dependencies (=needed libraries for successfull compilation):
- Qt (4.6), QtMobility modules: Multimedia, Bearer Management and Location (corrected for QtMobility-Beta release). If new to Qt and QtMobility see Getting started with Qt Mobility APIs
- Qjson library that converts Google data api to Maps and Lists. Source is available at http://gitorious.org/qjson. Main site is at http://qjson.sourceforge.net/. Installation instructions for symbian/linux/windows are available in http://qjson.sourceforge.net/get_it. Note the capabilities for Symbian below. For linux remember to run make install so that libs gets installed (also ldconfig might be needed).
- Needed capabilities for Symbian, add to qjson/src/src.pro file before compilation and remember to run qmake after updating pro file
TARGET.CAPABILITY = Location / NetworkServices / ReadUserData / WriteUserData / UserEnvironment / ReadDeviceData / WriteDeviceData / SwEvent
- After dependencies and capabilitys get the File:Youplayer against beta.zip file and unzip it somewhere. Then cd to that dir and build it with following commands:
-
- qmake
- make #for linux this is sufficient and for symbian emulator build
- make release-gcce #for symbian device
- make sis # for symbian package
- For installing sis Youplayer.sis to Symbian device sis-package needs to be signed. Easiest way to get it done is to use open signed online service from SymbianSigned (https://www.symbiansigned.com/app/page/public/openSignedOnline.do ). Just enter your phones IMEI, email address and YouPlayer.sis to the reserver fields. After a moment you will have the signed sis in email. Install this sis to the phone.
- Note! New zip package File:Youplayer against beta.zip uploaded which contains unsigned sis files for YOUplayer and qjson under sis folder.
Related Wiki Articles
No related wiki articles found