Pages

LBEvo Music Player widgets. How-to and Download

This is pretty amazing I must say. LBEvo has the ability to add any iWidgets to the lockscreen. With this in mind I figured I would add a way for the widget to communicate with the cydget. By doing this I would be able to run obj-c commands through the iWidgets.

I wanted to make this simple as possible for users/themers/coders to make these little widgets. At the bottom I will include a download link for an iWidget. Just so you can see the process and have a good example.


First off, to play the music you need to set at least a play function.

 window.parent.playmusic();  You can have a button press, swipe, basically any interaction to play this function. window.parent.playmusic(); means it will tell LBEvo to run the playmusic function. Which in turn will run the obj-c command, to play the music.

Functions are.
window.parent.playmusic();
window.parent.nexttrack();
window.parent.previoustrack();

If you call any of these through the iWidget that is opened in LBEvo it will do what it says.

On top of that we all like to know what the name of the track is, and maybe display album art.
for this I saved these into a global variable that you can access from the widget.

To get these you just need

parent.songName; //name of the song
parent.songArtist; //name of the artist
parent.songAlbum; //name of the album
parent.albumCover; //album cover in base 64

Example in the widget would be:
var songname = parent.songName;

you could then alert('songname'); and it would alert the current song name. More than likely you will set this to a div so.

var songname = parent.songName;
   document.getElementById('song').innerHTML = songname;

 You will need to update this every time you press next or back or even play. Take a look at the example it works great. You could even take this example move the css, change images and be good to go. (Much easier)

Here is the download. You place this in your iWidget directory. var/mobile/Library/iWidgets. Go to LBEvo and select it. (IT WILL NOT WORK IN IWIDGETS ON THE SPRINGBOARD)

I will make a few more of these and sure others will too. They will all be on http://LBEvo.com

Another first brought to you by LockBuilder Evo:)

Download Music Widget for LBEvo
http://adf.ly/mCkMp





Get LockBuilder Evo http://LBEvo.com

Reviewshttp://mrth3m3s.blogspot.com/
Videos: https://www.youtube.com/watch?v=TmZji9Z04RE&feature=youtu.be



JunesiPhone.com