hmedia: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Undo revision 38004 by WebOrganics (Talk) undoing to previous version (dont know how that happened!))
(adding implementations)
Line 311: Line 311:
== Implementations ==
* The [ Hypermedia Podcast] uses [[hmedia|hMedia]] + [[hatom|hAtom]] to generate a [ MediaRSS] feed ([[hmedia#hAtom_and_hMedia|as demonstrated above]])
* There is a web-service that extracts [[hmedia|hMedia]] + [[hatom|hAtom]] as [ MediaRSS] available at [ Transformr]

== History ==
== History ==

Revision as of 12:49, 9 April 2009

<entry-title>hMedia</entry-title> This document represents a draft microformat specification. Although drafts are somewhat mature in the development process, the stability of this document cannot be guaranteed, and implementers should be prepared to keep abreast of future developments and changes. Watch this wiki page, or follow discussions on the #microformats IRC channel to stay up-to-date.

hMedia ("Hypermedia") is a simple and open format for publishing Images Video and Audio. hMedia may be embedded in HTML or XHTML, Atom, RSS, and arbitrary XML. hMedia is one of several open microformat standards.

hMedia Draft Specification 2009-01-04



In historical order of contribution

Inspiration and Acknowledgements

Many thanks to Tantek Çelik, Kevin Marks, Mary Hodder, Chris Newell, Chris Messina, Charles Iliya Krempeaux and Manu Sporny for their valuable contributions to Media Info and Media Metadata in general.


This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

Semantic XHTML Design Principles

Note: the Semantic XHTML Design Principles were written primarily within the context of developing hCard and hCalendar, thus it may be easier to understand these principles in the context of the hCard design methodology (i.e. read that first). Tantek

XHTML is built on XML, and thus XHTML based formats can be used not only for convenient display presentation, but also for general purpose data exchange. In many ways, XHTML based formats exemplify the best of both HTML and XML worlds. However, when building XHTML based formats, it helps to have a guiding set of principles.

  1. Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
    1. For types with multiple components, use nested elements with class names equivalent to the names of the components.
    2. Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
  2. Use the most accurately precise semantic XHTML building block for each object etc.
  3. Otherwise use a generic structural element (e.g. <span> or <div>), or the appropriate contextual element (e.g. an <li> inside a <ul> or <ol>).
  4. Use class names based on names from the original schema, unless the semantic XHTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
  5. Finally, if the format of the data according to the original schema is too long and/or not human-friendly, use <abbr> instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human readable equivalent into the element itself. Further informative explanation of this use of <abbr>: Human vs. ISO8601 dates problem solved


Images, Video and Audio regularly share several common fields. hMedia has been based on a minimal common subset based on the analysis of 225 media related web pages. All fields discovered during analysis occur more than 80% of the time or more across each of the target domains listed on the Media Info Examples page. hMedia was developed using the Microformats Process and Design Principles.


Mary Hodder - 22 Jan 2006

There are many ways to publish media by users, but as people try to access those remixing and aggregation become more and more prevalent, having consistent records becomes important. Audio, photos and video show up in each other's publishing spaces, even though they are unique media objects. A photo might be next to the link for an audio piece, as it's visual artwork. A video can be comprised of quotes of other videos, photos and audio. Still photos can be made from videos. All three types of objects can contain subsets of media that is tagged and described.



hMedia is a single media publishing format that relates to Images, Video and Audio with an Emphasis on Practical, Simple, and Minimal. Wherever possible field names have been chosen from those defined by the hCard standard.


See key.

  • hMedia hmedia{1}.
    • fn. {1}.
    • contributor *. Using text or hcard.
    • photo ?. Using the HTML IMG element.
    • player ?. Using use any appropriate html element such as OBJECT.
    • enclosure *. A URL using the rel-design-pattern


Based on Perl's standard quantifiers:

bold {1} MUST be present exactly once
italic* OPTIONAL, and MAY occur more than once
+ MUST be present, and MAY occur more than once
? OPTIONAL, but MUST NOT occur more than once
[square brackets] list of common values
(parentheses) data format
# comment
! awaiting documentation

Schema Definition

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


hMedia is used to describe information associated with Images, Videos and Audio.


The name of a media.

  • The element is identified by the class name fn.
  • hMedia MUST include one fn element.


A Contributor is any person or organization that takes part in the creation or distribution of the Media

  • The element is identified by the class name contributor.
  • hMedia MAY include one or more contributors.
  • The contents of the element SHOULD include a valid hCard.


An embedded Image or Photograph of the Media

  • The element is identified by the class name photo.
  • hMedia MAY include one photo element.
  • The element SHOULD use an <img> element.
  • The <img> element attributes height and width MAY be used to determine the dimensions of a photo


The contents are an embedded video or movie of the Media such as a Flash Movie.

  • The element is identified by the class name player.
  • hMedia MAY include one player element.
  • The element MAY use any appropriate html element such as <object>.
  • The <object> element attributes height and width MAY be used to determine the dimensions of a player


Indicates that the referred url is a download of the Media.

  • The element is identified by a URL using the rel-design-pattern, the rel attribute SHOULD contain the value of enclosure..
  • hMedia MAY include one or more enclosure's.
  • The media type of the enclosure SHOULD be specified by using a type specifier for a url, the contents MAY be any iana assigned media type .
  • Multiple enclosure elements SHOULD be used for different representations of the same Audio, video or Image.

XMDP Profile

<dl class="profile">
  <a rel="help" href="">
   HTML4 definition of the 'class' attribute.</a>
  This meta data profile defines some 'class' attribute values (class names) 
  and their meanings as suggested by a 
  <a href="">
   draft of "Hypertext Links in HTML"</a>.</p>
    Used to describe semantic information associated with Images, Videos and Audio.
    The name of a media
    A Contributor is any person or organization that takes part in the creation or distribution of the Media
    An embedded Image or Photograph of the Media.
    An embedded video or movie of the Media.
     Indicates that the referred url is a download of the Media.


Although media items are sometimes presented on their own they are often found in data structures that are supported by existing microformats. It should therefore be possible to use the hMedia microformat as a child (or in some cases a parent) of these microformats.

Media Distribution and Syndication

Podcast and Vidcast feeds reference a sequence of media items. hMedia can therefore be used as a child element of hAtom.

Please see: hAtom+hMedia example.

Media Events

hMedia may used to describe a continuous media stream for example a TV channel. An event or a schedule of events on the channel can be signaled using vevent as child elements. A combination of hMedia and hCalendar may provide what is necessary to capture a specific event, the media stream information and the timing information.

Please see: hCalendar and hMedia.

Media Reviews

A Review about Audio, Video or Images often occurs in media publishing, hMedia reviews can often be published using hReview, capturing the reviewer, the reviewed item, a rating, a description, and the Date of a media review. hMedia may therefore be published as a child element of a hReview item

Please see: hReview and hMedia.


Using Real world Examples found on the media-info-examples page


<div class="hmedia">
  <a rel="enclosure" type="image/jpeg" href="">
    <img class="photo" alt="Saturday Nights alright for fighting, by treeswing" 
    <span class="fn">Saturday Night's Alright For Fighting</span>, 
    <em>by <span class="contributor vcard">
       <a class="url fn" href="">Treeswing</a> 
      (<a class="url" href="">profile</a>)


<div class="hmedia">
<span class="fn">Introduction to the Open Media Web</span>
<object class="player" type="application/x-shockwave-flash" data="">
  <param name="movie" value=""/>
  <param name="allowScriptAccess" value="always"/>
  <param name="allowFullScreen" value="true"/>
 <li><a rel="enclosure" type="video/mp4" title="Download the original source file for this movie" 


<span class="hmedia">
<a rel="enclosure" type="audio/mpeg" href="">
    <span class="contributor vcard">
      <span class="fn">Steve Earle</span>
    </span> - 
    <span class="fn">"Way Down in the Hole" (Tom Waits cover)</span>


hAtom and hMedia

<div id="example" class="hentry hmedia">
<h2 class="entry-title"><a class="fn" href="#example" rel="bookmark">Introduction to the Open Media Web</a></h2>
<p>by <cite class="author vcard"><span class="fn">Author</span></cite> on:
<abbr class="updated" title="2008-12-14T11:08:00+01:00">14th Dec, 2008</abbr></p>
<div class="entry-content"><p>The introductory video describing the Open Media Web project and where it's -- roughly -- going!</p></div>
<object class="player" width="545" height="451" type="application/x-shockwave-flash" data="">
  <param name="movie" value=""/>
  <param name="allowScriptAccess" value="always"/>
  <param name="allowFullScreen" value="true"/>
 <p>Download: <a rel="enclosure" type="video/mp4;length=18454938" href="">

hCalendar and hMedia

<div class="hmedia">
<div id="bip-play-emp">
<object class="player" height="395" width="640" 
  <param name="movie" value="
  <param name="allowScriptAccess" value="always"/>
  <param name="allowFullScreen" value="true"/>
  <param name="wmode" value="default"/>
  <param name="quality" value="high"/>
<div class="vevent">
  <span class="summary">
  <a class="url fn" href="">
  Doctor Who: The Next Doctor
   Broadcast on: <span class="location">BBC One</span>,  
  <abbr class="dtstart" title="2008-12-25T18:10:00+01:00">6:00pm Thursday 25th December</abbr>, 
  <abbr class="duration" title="PT60M">60</abbr> minutes,
   Available until: 
  <abbr class="dtend" title="2009-01-08T15:49:00+01:00">3:49pm Thursday 8th January</abbr>

hReview and hMedia

<div class="hreview">
 Reviewed by: <span class="reviewer vcard">
  <span class="fn">anonymous</span>, 
  On: <abbr class="dtreviewed" title="2009-01-03">January 3rd, 2009</abbr>.
 <div class="item hmedia">
    <p><a class="url fn" rel="enclosure" href="" type="audio/mpeg">Mis-takes</a>
      by: <span class="contributor vcard">
          <span class="fn">The Charlatans</span>
 <div>Rating: <abbr class="rating" title="4">****</abbr> out of 5 stars</div>
  <div class="description">
    <p>This is a great track from The Charlatans latest album You Cross My Path, well worth a listen.</p> 



  • Thu Sep 1st 2005, a discussion about a Playlist Microformat by Lucas Gonze, hPlaylist
  • On Jan 1st 2006 Tantek Çelik calls for a simple media microformat which describes the 80/20 of information about a particular piece of media and nothing more. see: [1]
  • hMedia 0.1 Draft Specification 2009-01-04


Normative References

Informative References

Similar Work

Work in progress


Do you want to help develop the next version of hMedia? Please add your thoughts and insight on the hmedia-brainstorming page.



Please see: hmedia-issues

Related pages