Labs/Jetpack/JEP/26: Difference between revisions

From MozillaWiki
< Labs‎ | Jetpack‎ | JEP
Jump to navigation Jump to search
Line 10: Line 10:
=== Introduction ===
=== Introduction ===


This module allows the developer to access the host media player (currently, iTunes on Mac; players supporting [http://wiki.xmms2.xmms.se/wiki/Media_Player_Interfaces dbus] on Linux; no support for Windows as of yet). The developer may query the media player for track, play or pause them, and perform other functions such as skip track and go to previous track.
This module allows the developer to access the host media player (currently, iTunes on Mac; players supporting [http://wiki.xmms2.xmms.se/wiki/Media_Player_Interfaces dbus] on Linux; no support for Windows as of yet). The developer may query the media player for tracks, play or pause them, and perform other functions such as skip track and go to previous track.


=== API ===
=== API ===

Revision as of 11:18, 10 September 2009

JEP 26 - Music

  • Champion: Anant Narayanan <anant at mozilla dot com>
  • Status: Implementing
  • Type: API Track
  • Created: 10 September 2009
  • Reference Implementation: jetpack.future.import("music")
  • JEP Index

Introduction

This module allows the developer to access the host media player (currently, iTunes on Mac; players supporting dbus on Linux; no support for Windows as of yet). The developer may query the media player for tracks, play or pause them, and perform other functions such as skip track and go to previous track.

API

The Music module will be available under jetpack.music.

To search for a track, album or artist, call: jetpack.music.search(term). An array of IMusicTrack objects will be returned. Each object contains the artist, album and title properties.

You may pass a IMusicTrack object to jetpack.music.playTrack(obj) in order to play that track. jetpack.music.getCurrentTrack() returns the track currently playing.

Other methods available are play(), pause(), stop(), gotoNextTrack(), and gotoPreviousTrack().