No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0221.xml 7.5KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Data Forms Media Element</title>
  10. <abstract>This specification defines an XMPP protocol extension for including media data in XEP-0004 data forms.</abstract>
  12. <number>0221</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0004</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>media-element</shortname>
  23. <schemaloc>
  24. <url></url>
  25. </schemaloc>
  26. &ianpaterson;
  27. &stpeter;
  28. <revision>
  29. <version>1.0</version>
  30. <date>2008-09-03</date>
  31. <initials>psa</initials>
  32. <remark><p>Per a vote of the XMPP Council, advanced status to Draft; concurrently, the XMPP Registrar issued the urn:xmpp:media-element namespace.</p></remark>
  33. </revision>
  34. <revision>
  35. <version>0.6</version>
  36. <date>2008-08-06</date>
  37. <initials>psa</initials>
  38. <remark><p>Further modified examples to track changes to XEP-0231.</p></remark>
  39. </revision>
  40. <revision>
  41. <version>0.5</version>
  42. <date>2008-08-06</date>
  43. <initials>psa</initials>
  44. <remark><p>Modified examples to track changes to XEP-0231.</p></remark>
  45. </revision>
  46. <revision>
  47. <version>0.4</version>
  48. <date>2008-07-27</date>
  49. <initials>psa</initials>
  50. <remark><p>Generalized text regarding inclusion of parameters in type attribute per RFC 2045.</p></remark>
  51. </revision>
  52. <revision>
  53. <version>0.3</version>
  54. <date>2008-06-18</date>
  55. <initials>psa</initials>
  56. <remark><p>Changed MUST to SHOULD regarding inclusion of uri element; allowed inclusion of codecs parameter in type attribute per RFC 4281; added Security Considerations section.</p></remark>
  57. </revision>
  58. <revision>
  59. <version>0.2</version>
  60. <date>2008-01-30</date>
  61. <initials>psa</initials>
  62. <remark><p>Modified to reuse data element from XEP-0231.</p></remark>
  63. </revision>
  64. <revision>
  65. <version>0.1</version>
  66. <date>2007-07-11</date>
  67. <initials>psa/ip</initials>
  68. <remark><p>Initial version, split off from XEP-0158.</p></remark>
  69. </revision>
  70. </header>
  71. <section1 topic='Introduction' anchor='intro'>
  72. <p>In certain protocols that make use of &xep0004;, it can be helpful to include media data such as small images. One example of such a "using protocol" is &xep0158;. This document defines a method for including media data in a data form.</p>
  73. </section1>
  74. <section1 topic='Media Element' anchor='media'>
  75. <p>The root element for media data is &lt;media/&gt;. This element MUST be qualified by the "urn:xmpp:media-element' namespace. The &lt;media/&gt; element MUST be contained within a &lt;field/&gt; element qualified by the 'jabber:x:data' namespace.</p>
  76. <p>If the media is an image or video then the &lt;media/&gt; element SHOULD include 'height' and 'width' attributes specifying the recommended display size of the media in pixels.</p>
  77. <p>The &lt;media/&gt; element SHOULD contain at least one &lt;uri/&gt; element to specify the out-of-band location of the media data. <note>Constrained execution environments prevent some clients (e.g., Web clients) from rendering media unless it has been received out-of-band.</note> If included, the &lt;uri/&gt; element MUST contain a URI that indicates the location and MUST include a 'type' attribute that specifies the MIME type of the media. If the URI scheme is cid: then the identifier MUST refer to a bit of binary data as described in &xep0231;.</p>
  78. <p>The 'type' attribute of the &lt;uri/&gt; element is REQUIRED. The value of the 'type' attribute MUST match the syntax specified in &rfc2045;. That is, the value MUST include a top-level media type, the "/" character, and a subtype; in addition, it MAY include one or more optional parameters (e.g., the "audio/ogg" MIME type in the example shown below includes a "codecs" parameter as specified in &rfc4281;). The "type/subtype" string SHOULD be registered in the &ianamedia;, but MAY be an unregistered or yet-to-be-registered value.</p>
  79. <example caption='Audio Media Element'><![CDATA[
  80. <media xmlns='urn:xmpp:media-element'>
  81. <uri type='audio/x-wav'>
  83. </uri>
  84. <uri type='audio/ogg; codecs=speex'>
  86. </uri>
  87. <uri type='audio/mpeg'>
  89. </uri>
  90. </media>
  91. ]]></example>
  92. <p>The cid: URI points to data that can be retrieved using the protocol described in &xep0231; and the data element would be included along with the XMPP stanza containing the data form.</p>
  93. <p>The following example is provided only for the purpose of illustration; consult the specifications for using protocols (e.g., <cite>XEP-0158</cite>) to see canonical examples.</p>
  94. <example caption='Inclusion in Data Form'><![CDATA[
  95. <x xmlns='jabber:x:data' type='form'>
  96. [ ... ]
  97. <field var='ocr'>
  98. <media xmlns='urn:xmpp:media-element'
  99. height='80'
  100. width='290'>
  101. <uri type='image/jpeg'>
  103. </uri>
  104. <uri type='image/jpeg'>
  106. </uri>
  107. </media>
  108. </field>
  109. [ ... ]
  110. </x>
  111. ]]></example>
  112. </section1>
  113. <section1 topic='Security Considerations' anchor='security'>
  114. <p>The ability to include arbitrary binary data implies that it is possible to send scripts, applets, images, and executable code, which may be potentially harmful. To reduce the risk of such exposure, an implementation MAY choose to not display or process such data but instead either completely ignore the data, show only the value of the 'alt' attribute (if included), or prompt a human user for approval (either explicitly via user action or implicitly via a list of approved entities from whom the user will accept binary data without per-event approval).</p>
  115. </section1>
  116. <section1 topic='IANA Considerations' anchor='iana'>
  117. <p>This document requires no interaction with &IANA;.</p>
  118. </section1>
  119. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  120. <section2 topic='Protocol Namespaces' anchor='ns'>
  121. <p>The &REGISTRAR; includes "urn:xmpp:media-element" in its registry of protocol namespaces (see &NAMESPACES;).</p>
  122. </section2>
  123. </section1>
  124. <section1 topic='XML Schema' anchor='schema'>
  125. <code><![CDATA[
  126. <?xml version='1.0' encoding='UTF-8'?>
  127. <xs:schema
  128. xmlns:xs=''
  129. targetNamespace='urn:xmpp:media-element'
  130. xmlns='urn:xmpp:media-element'
  131. elementFormDefault='qualified'>
  132. <xs:annotation>
  133. <xs:documentation>
  134. The protocol documented by this schema is defined in
  135. XEP-0221:
  136. </xs:documentation>
  137. </xs:annotation>
  138. <xs:element name='media'>
  139. <xs:complexType>
  140. <xs:sequence>
  141. <xs:element ref='uri' minOccurs='0' maxOccurs='unbounded'/>
  142. </xs:sequence>
  143. <xs:attribute name='height' type='xs:unsignedShort' use='optional'/>
  144. <xs:attribute name='width' type='xs:unsignedShort' use='optional'/>
  145. </xs:complexType>
  146. </xs:element>
  147. <xs:element name='uri'>
  148. <xs:complexType>
  149. <xs:simpleContent>
  150. <xs:extension base='xs:anyURI'>
  151. <xs:attribute name='type' type='xs:string' use='required'/>
  152. </xs:extension>
  153. </xs:simpleContent>
  154. </xs:complexType>
  155. </xs:element>
  156. </xs:schema>
  157. ]]></code>
  158. </section1>
  159. </xep>