This JEP defines a protocol for communicating information about the music to which a user is listening.
NOTICE: This JEP is currently within Last Call or under consideration by the Jabber Council for advancement to the next stage in the JSF standards process. For further details, visit <http://www.jabber.org/council/queue.php>.
Status: Proposed
Type: Standards Track
Number: 0118
Version: 0.8
Last Updated: 2004-10-26
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, XMPP IM, JEP-0060
Supersedes: None
Superseded By: None
Short Name: tune
Email: stpeter@jabber.org
JID: stpeter@jabber.org
This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined in this JEP have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
This JEP defines a protocol for communicating information about the music to which a user is listening. Such information may be seen as a kind of "extended presence", and users may want to communicate such information to their contacts on the network as a fun add-on to traditional IM applications or to provide integration with common music-player applications.
Information about tunes is provided by the user and propagated on the network by the user's client. The information container for tune data is a <tune/> element that is qualified by the 'http://jabber.org/protocol/tune' namespace. The tune information itself is provided as the XML character data of the following children of the <tune/> element:
Table 1: Child Elements
| Element | Description | Example | Datatype |
|---|---|---|---|
| artist | The artist or performer of the song or piece | Yes | xs:string |
| title | The title of the song or piece | Heart of the Sunrise | xs:string |
| source | The collection (e.g., album) or other source (e.g., a band website that hosts streams or audio files) | Yessongs | xs:string |
| track | A unique identifier for the tune; e.g., the track number within a collection or the specific URI for the object (e.g., a stream or audio file) | 3 | xs:string |
| length | The duration of the song or piece in seconds | 686 | xs:unsignedShort |
NOTE: The datatypes specified above are defined in XML Schema Part 2 [1].
Tune information SHOULD be communicated and transported by means of the Publish-Subscribe [2] protocol. Because tune information is not pure presence information and can change independently of the user's availability, it SHOULD NOT be provided as an extension to <presence/>.
Example 1. User Publishes Tune Information
<iq type='set'
from='stpeter@jabber.org/work'
to='pubsub.jabber.org'
id='tunes123'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='generic/tunes/stpeter@jabber.org'>
<item id='current'>
<tune xmlns='http://jabber.org/protocol/tune'>
<artist>Yes</artist>
<title>Heart of the Sunrise</title>
<source>Yessongs</source>
<track>3</track>
<length>686</length>
</tune>
</item>
</publish>
</pubsub>
</iq>
The tune information is then delivered to all subscribers:
Example 2. Tune Information is Delivered to All Subscribers
<message
from='pubsub.jabber.org'
to='maineboy@jabber.org'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='generic/tunes/stpeter@jabber.org'>
<item id='current'>
<tune xmlns='http://jabber.org/protocol/tune'>
<artist>Yes</artist>
<title>Heart of the Sunrise</title>
<source>Yessongs</source>
<track>3</track>
<length>686</length>
</tune>
</item>
</items>
</event>
</message>
.
.
.
As mentioned in JEP-0060, the stanza containing the event notification or payload MAY also include 'replyto' data (as specified by the Extended Stanza Addressing [3] protocol) to provide an explicit association between the published data and the user:
Example 3. Event notification with extended stanza addressing
<message
from='pubsub.jabber.org'
to='maineboy@jabber.org'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='generic/tunes/stpeter@jabber.org'>
<item id='current'>
<tune xmlns='http://jabber.org/protocol/tune'>
<artist>Yes</artist>
<title>Heart of the Sunrise</title>
<source>Yessongs</source>
<track>3</track>
<length>686</length>
</tune>
</item>
</items>
</event>
<addresses xmlns='http://jabber.org/protocol/address'>
<address type='replyto' jid='juliet@capulet.com'/>
</addresses>
</message>
In order to indicate that the user is no longer listening to any tunes, the user's client SHOULD send an empty <tune/> element, which can be considered a "stop command" for user tunes:
Example 4. User Publishes "Stop Playing" Information
<iq type='set'
from='stpeter@jabber.org/work'
to='pubsub.jabber.org'
id='tunes345'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='generic/tunes/stpeter@jabber.org'>
<item id='current'>
<tune xmlns='http://jabber.org/protocol/tune'/>
</item>
</publish>
</pubsub>
</iq>
Example 5. Empty Tune Information is Delivered to All Subscribers
<message
from='pubsub.jabber.org'
to='maineboy@jabber.org'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='generic/tunes/stpeter@jabber.org'>
<item id='current'>
<tune xmlns='http://jabber.org/protocol/tune'/>
</item>
</items>
</event>
</message>
.
.
.
To prevent a large number of updates when a user is skipping through tracks, an implementation may wait several seconds before publishing new tune information.
If the length is unknown (e.g., the user is listening to a stream), the <length/> element SHOULD be set to zero.
This protocol introduces no security considerations above and beyond those defined in Publish-Subscribe (JEP-0060).
This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [4].
The Jabber Registrar [5] shall include 'http://jabber.org/protocol/tune' in its registry of protocol namespaces.
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/tune'
xmlns='http://jabber.org/protocol/tune'
elementFormDefault='qualified'>
<xs:element name='tune'>
<xs:complexType>
<xs:sequence>
<xs:element name='artist' type='xs:string' minOccurs='0'/>
<xs:element name='title' type='xs:string' minOccurs='0'/>
<xs:element name='source' type='xs:string' minOccurs='0'/>
<xs:element name='track' type='xs:string' minOccurs='0'/>
<xs:element name='length' type='xs:unsignedShort' minOccurs='0'/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
1. XML Schema Part 2: Datatypes <http://www.w3.org/TR/xmlschema-2/>.
2. JEP-0060: Publish-Subscribe <http://www.jabber.org/jeps/jep-0060.html>.
3. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.
4. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
5. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.
END