Difference between revisions of "Patch MediaPlayer Bookmarking"

From WebOS Internals
Jump to navigation Jump to search
(fixed link)
(No difference)

Revision as of 07:20, 1 August 2009

Bookmark-mediaplayer.jpg

Motivation

There are fields in the /var/luna/data/mediadb.db3 file that seem to indicate that Palm intends to have the current song in a playlist, as well as the current position within a song bookmarked. However, that is not implemented yet (ARGH). This is torture for podcast listeners. After reading the chapter on cookies in the rough cuts book, I thought it would be relatively straightforward to add some cookie code into the MediaPlayer to support bookmarks.

The source for the musicplayer is in /usr/palm/applications/com.palm.app.musicplayer/. You should follow the steps in stock-application-mods to ensure you have a copy of the original MusicPlayer. Go ahead and make changes to the original once you have a backup. If you make changes to a copied application, the dashboard won't call the proper application without further changes (that I didn't feel like tracking down).

Changed behaviour

A bookmark is now created when you do any of the following functions outside the first 15 seconds of a song:

  • pause
  • hit "next" 1
  • hit "previous" 2
  • shutdown the player
  • jump/swipe/browse to another song
  • NOTE: Playback does NOT automatically resume at the bookmark. You must hit "next" to skip ahead to the bookmark. I didn't want to change the default functionality of the player that much, so this was the best I could come up with.

1Hitting "next" when you are before a bookmark will take you to that bookmark. 2Hitting "prev" when in the first 4 seconds of a song takes you to the previous song. Outside that range will take you to the beginning of the song. This is stock behavior. The modification is to record a bookmark before taking you to the beginning of the song.

Only one bookmark will be retained per song, and they will never be removed. There is no ability to clear a bookmark. When you finish a song, a cookie is created at the end of the song. This is relatively useless, but at least this will make the "next" button basically take you to the next song. Bookmarks are stored as cookies. To see all the cookies generated, run

sqlite3 /var/palm/data/cookies.db "select name, value from Cookies where name like '%musicplayer.bookmark.song%'"

To remove all bookmark cookies, run

sqlite3 /var/palm/data/cookies.db "delete from Cookies where name like '%musicplayer.bookmark.song%'"

Screenshot details

  • PalmCast is finished
  • ITC is currently playing and has a bookmark in it
  • Java Posse has a bookmark, but is not currently playing
  • TWiT is finished

Installation

This mod, and hopefully many more in the future can be installed using the instructions found on Applying Patches. Please follow the instructions there and choose the /opt/src/modifications/musicplayer/bookmark.patch

verified to work as written by optik678