medialize/URI.js — Issue #18: Add accessors for Media Fragments URI
Author: rodneyrehm
Created: 2012-02-28 19:17:00+00:00
State: open

The [Media Fragments URI Specification](http://www.w3.org/TR/media-frags/) defines how dimensions (spatial, temporal, track, …) can be specified. `` would specify to show a cropped version of the actual image (100x40 pixels at a 10x20 pixel offset). `` wouls specify to play the audio file from 5th second till 20th second.

`URI('foo.png#xywh=10,20,100,40').mediaFragment()` could return `{x: 10, y: 20, w:100, height:40}`, while `URI('foo.png').mediaFragment({y: 20, w:100, x: 10, height:40})` could lead to `foo.png#xywh=10,20,100,40`.

Things get more interesting with converting different representations of the same information, as the [Temporal Dimension](http://www.w3.org/TR/media-frags/#naming-time) notation shows.

### Resources ###

* [Media Fragments URI Specification](http://www.w3.org/TR/media-frags/)
* [Showcase](http://www.w3.org/2008/WebVideo/Fragments/wiki/Showcase)
* [JS Implementation by tomayac](https://github.com/tomayac/Media-Fragments-URI)