Photos Slideshow

From WebOS Internals
Jump to navigation Jump to search

This will give you the option when viewing a fullscreen photo to start a slide show. This makes a great addition when on the touchstone.

Since we are doing this on just the fullscreen we will only be editing one file: /usr/palm/applications/

First get a couple icons for playing and pausing.

I used the ones in the music player. I named mine menu-icon-play.png and menu-icon-pause.png and placed them in the '/usr/palm/applications/' folder. If you dont care what the picture is, you can change the code below to use menu-icon-send.png where ever you see play or pause. (just remember the menu, the second icon is the play and the first one is the send.

Second, add the play button to the top menu.

Find 'updateViewMenu' function, Directly after:

this.menuModel.items[0].items =
    iconPath: 'images/menu-icon-send.png',
    command: 'menu-share'

Add This:

    iconPath: 'images/menu-icon-play.png',
    command: 'menu-play'

Third, handle the 'menu-play' command.

Find the 'additionalHandleCommand' function. Directly after:

case 'menu-share':

Add This:

case 'menu-play':

Finally, add two functions to control the play.

Change the timeout (15000) to how many milliseconds you want them to show for. (I added mine directly after 'handleShare' function).

handlePlay: function(event)
        delete this._playing;
        this.menuModel.items[0].items[1].iconPath = 'images/menu-icon-play.png';
        this.menuModel.items[0].items[1].iconPath = 'images/menu-icon-pause.png';
handlePlayNext: function()
        this.urlProvider.jumpTo(Math.floor(Math.random() * this.urlProvider.getTotal()));
        //10 second pause
        this._playing = this.controller.window.setTimeout(this.handlePlayNext.bind(this),10000);

To Do:

  • Configurable Display Time
  • Pass Parameter to start automatically
  • Configurable Option to auto start on charging


Adding the menu item and handling it to automatically change to next picture every X seconds by dacablegy.

I notice we have a pause icon but I don't see where we set it up to do anything. mamouton