| Abstract: | This specification defines a payload format for communicating information about music to which a user is listening, including the title, track number, collection, performer, composer, length, and user rating. The payload format is typically transported using the personal eventing protocol, a profile of XMPP publish-subscribe specified in XEP-0163. |
| Author: | Peter Saint-Andre |
| Copyright: | © 1999 - 2011 XMPP Standards Foundation. SEE LEGAL NOTICES. |
| Status: | Draft |
| Type: | Standards Track |
| Version: | 1.2 |
| Last Updated: | 2008-01-30 |
NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.
1. Introduction
2. Protocol
2.1. Container Element and Child Elements
2.2. Transport Mechanism
3. Implementation Notes
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
6.1. Protocol Namespaces
7. XML Schema
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
This document 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:
| Element | Description | Example | Datatype |
|---|---|---|---|
| artist | The artist or performer of the song or piece | Yes | xs:string |
| length | The duration of the song or piece in seconds | 686 | xs:unsignedShort |
| rating | The user's rating of the song or piece, from 1 (lowest) to 10 (highest). | 8 | xs:positiveInteger |
| source | The collection (e.g., album) or other source (e.g., a band website that hosts streams or audio files) | Yessongs | xs:string |
| title | The title of the song or piece | Heart of the Sunrise | 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 |
| uri | A URI or URL pointing to information about the song, collection, or artist | http://www.yesworld.com/lyrics/Fragile.html#9 | xs:anyURI |
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] subset specified in Personal Eventing Protocol [3]. 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/14793c64-0f94-11dc-9430-000bcd821bfb'
id='tunes123'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/tune'>
<item>
<tune xmlns='http://jabber.org/protocol/tune'>
<artist>Yes</artist>
<length>686</length>
<rating>8</rating>
<source>Yessongs</source>
<title>Heart of the Sunrise</title>
<track>3</track>
<uri>http://www.yesworld.com/lyrics/Fragile.html#9</uri>
</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='stpeter@jabber.org'
to='maineboy@jabber.org'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/tune'>
<item id='bffe6584-0f9c-11dc-84ba-001143d5d5db'>
<tune xmlns='http://jabber.org/protocol/tune'>
<artist>Yes</artist>
<length>686</length>
<rating>8</rating>
<source>Yessongs</source>
<title>Heart of the Sunrise</title>
<track>3</track>
<uri>http://www.yesworld.com/lyrics/Fragile.html#9</uri>
</tune>
</item>
</items>
</event>
</message>
In order to indicate that the user is no longer listening to any tunes (or has simply disabled publication), the user's client shall send an empty <tune/> element, which can be considered a "stop command" for user tunes:
Example 3. User Disables Publishing
<iq type='set'
from='stpeter@jabber.org/14793c64-0f94-11dc-9430-000bcd821bfb'
id='tunes345'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/tune'>
<item>
<tune xmlns='http://jabber.org/protocol/tune'/>
</item>
</publish>
</pubsub>
</iq>
Example 4. Empty Tune Information is Delivered to All Subscribers
<message
from='stpeter@jabber.org'
to='maineboy@jabber.org'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/tune'>
<item id='cbbb3f5a-0f9c-11dc-afe0-001143d5d5db'>
<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 SHOULD 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 NOT be included.
A typical interface for user ratings is to show one to five star icons such as ★★★★. If this interface is used, the numbers 2, 4, 6, 8, and 10 should be mapped to one, two, three, four, and five stars respectively, and odd numbers should be mapped to half stars (e.g., the number 9 would be mapped to four-and-a-half stars).
The publication of user tune information is not known to introduce any new security considerations above and beyond those defined in XEP-0060: Publish-Subscribe.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [4].
The XMPP Registrar [5] includes '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:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0118: http://www.xmpp.org/extensions/xep-0118.html
</xs:documentation>
</xs:annotation>
<xs:element name='tune'>
<xs:complexType>
<xs:sequence minOccurs='0'>
<xs:element name='artist' type='xs:string' minOccurs='0'/>
<xs:element name='length' type='xs:unsignedShort' minOccurs='0'/>
<xs:element name='rating'>
<xs:simpleType>
<xs:restriction base='xs:positiveInteger'>
<xs:maxInclusive value='10'/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name='source' type='xs:string' minOccurs='0'/>
<xs:element name='title' type='xs:string' minOccurs='0'/>
<xs:element name='track' type='xs:string' minOccurs='0'/>
<xs:element name='uri' type='xs:anyURI' minOccurs='0'/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Series: XEP
Number: 0118
Publisher: XMPP Standards Foundation
Status:
Draft
Type:
Standards Track
Version: 1.2
Last Updated: 2008-01-30
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0163
Supersedes: None
Superseded By: None
Short Name: tune
Schema: <http://www.xmpp.org/schemas/tune.xsd>
Source Control:
HTML
This document in other formats:
XML
PDF
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XML Schema Part 2: Datatypes <http://www.w3.org/TR/xmlschema-2/>.
2. XEP-0060: Publish-Subscribe <http://xmpp.org/extensions/xep-0060.html>.
3. XEP-0163: Personal Eventing Protocol <http://xmpp.org/extensions/xep-0163.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 XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Added rating element.
(psa)Removed non-PEP examples; added uri element.
(psa)Per a vote of the Jabber Council, advanced status to Draft.
(psa)Added example with URL.
(psa)Changed recommendation to not include the <length/> element if the track time is unknown.
(psa)Added implementation notes; clarified nature of <source/> and <track/> elements; if length is unknown, set to zero.
(psa)Changed <length/> datatype from xs:duration to xs:unsignedShort.
(psa)Corrected several errors; added reference to XEP-0033.
(psa)Reverted from infobits to tune elements.
(psa)Slight modifications to track changes to infobits specifications.
(psa)Replaced tune elements with infobits.
(psa)Added "stop" function via empty <tune/> element.
(psa)Initial version.
(psa)END